Compare commits

...

4202 Commits

Author SHA1 Message Date
Emil Velikov
20e0546cc2 docs: Add sha256 sums for the 10.3.7 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-12 10:17:08 +00:00
Emil Velikov
6b00e5585a Add release notes for the 10.3.7 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-12 10:06:40 +00:00
Emil Velikov
e342f82fff Update version to 10.3.7
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-12 10:02:08 +00:00
Marek Olšák
e635510ce3 st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEX
Cc: 10.2 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit eaae92a349)
2015-01-07 16:34:27 +00:00
Marek Olšák
2c26f5cc96 vbo: ignore primitive restart if FixedIndex is enabled in DrawArrays
From GL 4.4 Core profile:

  If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are
  enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX is
  used. If PRIMITIVE_RESTART_FIXED_INDEX is enabled, primitive restart is not
  performed for array elements transferred by any drawing command not taking a
  type parameter, including all of the *Draw* commands other than *DrawEle-
  ments*.

Cc: 10.2 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8f5d309521)
2015-01-07 16:12:31 +00:00
Ilia Mirkin
9bfdf3ae51 nv50/ir: fix texture offsets in release builds
assert's get compiled out in release builds, so they can't be relied
upon to perform logic.

Reported-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Roy Spliet <rspliet@eclipso.eu>
Cc: "10.2 10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fb1afd1ea5)
2015-01-06 15:31:33 +00:00
Chad Versace
9fbacc1945 i965: Use safer pointer arithmetic in gather_oa_results()
This patch reduces the likelihood of pointer arithmetic overflow bugs in
gather_oa_results(), like the one fixed by b69c7c5dac.

I haven't yet encountered any overflow bugs in the wild along this
patch's codepath. But I get nervous when I see code patterns like this:

   (void*) + (int) * (int)

I smell 32-bit overflow all over this code.

This patch retypes 'snapshot_size' to 'ptrdiff_t', which should fix any
potential overflow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 414be86c96)
2015-01-04 21:19:20 +00:00
Chad Versace
71cd8f1388 i965: Use safer pointer arithmetic in intel_texsubimage_tiled_memcpy()
This patch reduces the likelihood of pointer arithmetic overflow bugs in
intel_texsubimage_tiled_memcpy() , like the one fixed by b69c7c5dac.

I haven't yet encountered any overflow bugs in the wild along this
patch's codepath. But I recently solved, in commit b69c7c5dac, an overflow
bug in a line of code that looks very similar to pointer arithmetic in
this function.

This patch conceptually applies the same fix as in b69c7c5dac. Instead
of retyping the variables, though, this patch adds some casts. (I tried
to retype the variables as ptrdiff_t, but it quickly got very messy. The
casts are cleaner).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 225a09790d)
2015-01-04 21:19:14 +00:00
Marek Olšák
87017f210d glsl_to_tgsi: fix a bug in copy propagation
This fixes the new piglit test: arb_uniform_buffer_object/2-buffers-bug

Cc: 10.2 10.3 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 48094d0e65)
2015-01-04 21:07:02 +00:00
Kenneth Graunke
8f22574e89 i965: Fix start/base_vertex_location for >1 prims but !BRW_NEW_VERTICES.
This is a partial revert of c89306983c.
It split the {start,base}_vertex_location handling into several steps:

1. Set brw->draw.start_vertex_location = prim[i].start
   and brw->draw.base_vertex_location = prim[i].basevertex.
   (This happened once per _mesa_prim, in the main drawing loop.)
2. Add brw->vb.start_vertex_bias and brw->ib.start_vertex_offset
   appropriately.  (This happened in brw_prepare_shader_draw_parameters,
   which was called just after brw_prepare_vertices, as part of state
   upload, and only happened when BRW_NEW_VERTICES was flagged.)
3. Use those values when emitting 3DPRIMITIVE (once per _mesa_prim).

If we drew multiple _mesa_prims, but didn't flag BRW_NEW_VERTICES on
the second (or later) primitives, we would do step #1, but not #2.
The first _mesa_prim would get correct values, but subsequent ones
would only get the first half of the summation.

The reason I originally did this was because I needed the value of
gl_BaseVertexARB to exist in a buffer object prior to uploading
3DSTATE_VERTEX_BUFFERS.  I believed I wanted to upload the value
of 3DPRIMITIVE's "Base Vertex Location" field, which was computed
as: (prims[i].indexed ? prims[i].start : prims[i].basevertex) +
brw->vb.start_vertex_bias.  The latter value wasn't available until
after brw_prepare_vertices, and the former weren't available in the
state upload code at all.  Hence the awkward split.

However, I believe that including brw->vb.start_vertex_bias was a
mistake.  It's an extra bias we apply when uploading vertex data into
VBOs, to move [min_index, max_index] to [0, max_index - min_index].

>From the GL_ARB_shader_draw_parameters specification:
"<gl_BaseVertexARB> holds the integer value passed to the <baseVertex>
 parameter to the command that resulted in the current shader
 invocation.  In the case where the command has no <baseVertex>
 parameter, the value of <gl_BaseVertexARB> is zero."

I conclude that gl_BaseVertexARB should only include the baseVertex
parameter from glDraw*Elements*, not any internal biases we add for
optimization purposes.

With that in mind, gl_BaseVertexARB only needs prim[i].start or
prim[i].basevertex.  We can simply store that, and go back to computing
start_vertex_location and base_vertex_location in brw_emit_prim(), like
we used to.  This is much simpler, and should actually fix two bugs.

Fixes missing geometry in Unvanquished.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85529
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit c633528cba)
2015-01-04 21:06:56 +00:00
Ilia Mirkin
3bcde5a954 nv50,nvc0: set vertex id base to index_bias
Fixes the piglits which check that gl_VertexID includes the base vertex
offset:
  arb_draw_indirect-vertexid elements
  gl-3.2-basevertex-vertexid

Note that this leaves out the original G80, for which this will continue
to fail. It could be fixed by passing a driver constbuf value in, but
that's beyond the scope of this change.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit be0311c962)
2015-01-04 21:06:48 +00:00
Michel Dänzer
6ecffc89fd radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0
E.g. this could happen on older kernels which don't support the
RADEON_INFO_SI_BACKEND_ENABLED_MASK query yet. The code in
si_write_harvested_raster_configs() doesn't deal with this correctly and
would probably mangle the value badly.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit b3057f8097)
2015-01-04 21:06:41 +00:00
Kenneth Graunke
4b1332dbf8 i965: Add missing BRW_NEW_*_PROG_DATA to texture/renderbuffer atoms.
This was probably missed when moving from a fixed binding table layout
to a dynamic one that changes based on the shader.

Fixes newly proposed Piglit test fbo-mrt-new-bind.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87619
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Mike Stroyan <mike@LunarG.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 4616b2ef85)
2015-01-04 21:06:04 +00:00
Emil Velikov
2e49560a5c docs: Add sha256 sums for the 10.3.6 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-30 01:44:43 +00:00
Emil Velikov
d28a758e44 Add release notes for the 10.3.6 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-30 01:21:22 +00:00
Emil Velikov
2836d47791 Update version to 10.3.6
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-30 01:06:56 +00:00
Emil Velikov
78a134c04e Revert "glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)"
This reverts commit d332e5046e.

May not be the correct fix. Discussion is ongoing.

http://lists.freedesktop.org/archives/mesa-dev/2014-December/072969.html
2014-12-30 00:56:33 +00:00
Ian Romanick
5878e18ac7 linker: Assign varying locations geometry shader inputs for SSO
Previously only geometry shader outputs would be assigned locations if
the geometry shader was the only stage in the linked program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: pavol@klacansky.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit a909b995d9)
Nominated-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-21 20:54:41 +00:00
Ian Romanick
f19fc096e6 linker: Wrap access of producer_var with a NULL check
producer_var could be NULL if consumer_var is not NULL and
consumer_is_fs is false.  This will occur when the producer is NULL and
the consumer is the geometry shader for a program that contains only a
geometry shader.  This will occur starting with the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: pavol@klacansky.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 5eca78a00a)
Nominated-by: Ian Romanick <ian.d.romanick@intel.com>
2014-12-21 20:51:54 +00:00
Maxence Le Doré
d81e14d29f glsl: Add gl_MaxViewports to available builtin constants
It seems to have been forgotten during viewports array implementation time.

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 19e05d6898)
2014-12-21 20:17:33 +00:00
Andres Gomez
43f1ad921a i965/brw_reg: struct constructor now needs explicit negate and abs values.
We were assuming, when constructing a new brw_reg struct, that the
negate and abs register modifiers would not be present by default in
the new register.

Now, we force explicitly setting these values when constructing a new
register.

This will avoid problems like forgetting to properly set them when we
are using a previous register to generate this new register, as it was
happening in the dFdx and dFdy generation functions.

Fixes piglit test shaders/glsl-deriv-varyings

Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82991
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 8517e665bc)
2014-12-21 20:16:37 +00:00
Mario Kleiner
da8cde2f21 glx/dri3: Don't fail on glXSwapBuffersMscOML(dpy, window, 0, 0, 0) (v2)
glXSwapBuffersMscOML() with target_msc=divisor=remainder=0 gets
translated into target_msc=divisor=0 but remainder=1 by the mesa
api. This is done for server DRI2 where there needs to be a way
to tell the server-side DRI2ScheduleSwap implementation if a call
to glXSwapBuffers() or glXSwapBuffersMscOML(dpy,window,0,0,0) was
done. remainder = 1 was (ab)used as a flag to tell the server to
select proper semantic. The DRI3/Present backend ignored this
signalling, treated any target_msc=0 as glXSwapBuffers() request,
and called xcb_present_pixmap with invalid divisor=0, remainder=1
combo. The present extension responded kindly to this with a
BadValue error and dropped the request, but mesa's DRI3/Present
backend doesn't check for error codes. From there on stuff went
downhill quickly for the calling OpenGL client...

This patch fixes the problem.

v2: Change comments to be more clear, with reference to
relevant spec, as suggested by Eric Anholt.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 0d7f4c8658)
2014-12-14 15:35:15 +00:00
Mario Kleiner
d332e5046e glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)
Restores proper immediate tearing swap behaviour for
OpenGL bufferswap under DRI3/Present.

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

v2: Add Frank Binns signed off by for his original earlier
patch from April 2014, which is identical to this one, and
Chris Wilsons reviewed tag from May 2014 for that patch, ergo
also for this one.

v3: Incorporate comment about triple buffering as suggested
by Axel Davy, and reference to relevant spec provided by
Eric Anholt.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 455d3036fa)
2014-12-14 15:28:09 +00:00
Mario Kleiner
0af41beaf7 glx/dri3: Track separate (ust, msc) for PresentPixmap vs. PresentNotifyMsc (v2)
Prevent calls to glXGetSyncValuesOML() and glXWaitForMscOML()
from overwriting the (ust,msc) values of the last successfull
swapbuffers call (PresentPixmapCompleteNotify event), as
glXWaitForSbcOML() relies on those values corresponding to
the most recent completed swap, not to whatever was last
returned from the server.

Problematic call sequence without this patch would have been, e.g.,

glXSwapBuffers()
... wait ...
swap completes -> PresentPixmapComplete event -> (ust,msc)
updated to reflect swap completion time and count.
... wait for at least 1 video refresh cycle/vblank increment.

glXGetSyncValuesOML()
-> PresentNotifyMsc event overwrites (ust,msc) of swap
completion with (ust,msc) of most recent vblank

glXWaitForSbcOML()
-> Returns sbc of last completed swap but (ust,msc) of last
completed vblank, not of last completed swap.
-> Client is confused.

Do this by tracking a separate set of (ust, msc) for the
dri3_wait_for_msc() call than for the dri3_wait_for_sbc()
call.

This makes the glXWaitForSbcOML() call robust again and restores
consistent behaviour with the DRI2 implementation.

Fixes applications originally written and tested against
DRI2 which also rely on this not regressing under DRI3/Present,
e.g., Neuro-Science software like Psychtoolbox-3.

This patch fixes the problem.

v2: Rename vblank_msc/ust to notify_msc/ust as suggested by
Axel Davy for better clarity.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit ad8b0e8bf6)

Conflicts:
	src/glx/dri3_glx.c
2014-12-14 15:26:35 +00:00
Mario Kleiner
c085fcd2f2 glx/dri3: Fix glXWaitForSbcOML() to handle targetSBC==0 correctly. (v2)
targetSBC == 0 is a special case, which asks the function
to block until all pending OpenGL bufferswap requests have
completed.

Currently the function just falls through for targetSBC == 0,
returning bogus results.

This breaks applications originally written and tested against
DRI2 which also rely on this not regressing under DRI3/Present,
e.g., Neuro-Science software like Psychtoolbox-3.

This patch fixes the problem.

v2: Simplify as suggested by Axel Davy. Add comments proposed
by Eric Anholt.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 8cab54de16)
2014-12-14 15:23:29 +00:00
José Fonseca
6915d30307 util/primconvert: Avoid point arithmetic; apply offset on all cases.
Matches what u_vbuf_get_minmax_index() does.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit f9098f0972)
2014-12-11 13:40:10 +00:00
Marek Olšák
87eaad80c9 docs/relnotes: document the removal of GALLIUM_MSAA
Cc: 10.2.10.3 10.4 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ac319d94d3)

Conflicts:
	docs/relnotes/10.4.html
2014-12-11 13:17:45 +00:00
Dave Airlie
cb40b69053 r600g: only init GS_VERT_ITEMSIZE on r600
On evergreen there are 4 regs, on r600/700 there is only one.

Don't initialise regs and trash someone elses state.

Not sure this fixes anything, but hey one less stupid.

Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 7f21cf7198)
2014-12-11 13:17:45 +00:00
Tom Stellard
b7fe1ebaa9 radeonsi: Program RASTER_CONFIG for harvested GPUs v5
Harvested GPUs have some of their render backends disabled, so
in order to prevent the hardware from trying to render things
with these disabled backends we need to correctly program
the PA_SC_RASTER_CONFIG register.

v2:
  - Write RASTER_CONFIG for all SEs.

v3:
  - Set GRBM_GFX_INDEX.INSTANCE_BROADCAST_WRITES bit.
  - Set GRBM_GFX_INFEX.SH_BROADCAST_WRITES bit when done setting
    PA_SC_RASTER_CONFIG.
  - Get num_se and num_sh_per_se from kernel.

v4:
  - Get correct value for num_se
  - Remove loop for setting PA_SC_RASTER_CONFIG
  - Only compute raster config when a backend has been disabled.

v5: Michel Dänzer
  - Fix computation for chips with multiple SEs

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

CC: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 67dcbcd92c)
2014-12-11 13:17:45 +00:00
Ben Widawsky
dd5ffb2d31 i965/gs: Avoid DW * DW mul
The GS has an interesting use for mul. Because the GS can emit multiple
vertices per input vertex, and it also has a unique count at the top of the URB
payload, the GS unit needs to be able to dynamically specify URB write offsets
(relative to the global offset). The documentation in the function has a very
good explanation from Paul on the mechanics.

This fixes around 2000 piglit tests on BSW.

v2:
Reworded commit message (Ben) no mention of CHV (Matt)
Change SHRT_MAX to USHRT_MAX (Ken, and Matt)
Update comment in code to reflect the use of UW (Ben)
Add Gen7+ assertion for the relevant GS code, since it won't work on Gen6- (Ken)
Drop the bogus hunk in emit_control_data_bits() (Ken)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84777 (with many dupes)
Cc: "10.4 10.3 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit f13870db09)
2014-12-11 13:17:45 +00:00
Ilia Mirkin
103fadef9d util/primconvert: take ib offset into account
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit c3bed13604)
2014-12-11 13:17:45 +00:00
Ilia Mirkin
9014544f72 util/primconvert: support instanced rendering
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit fb434e675f)
2014-12-11 13:17:44 +00:00
Ilia Mirkin
582c58d033 util/primconvert: pass index bias through
The index_bias (aka base_vertex) applies to the downstream draw just as
much, since the actual index values are never modified.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 1dfa039168)
2014-12-11 13:17:44 +00:00
Emil Velikov
1ba2029184 docs: Add sha256 sums for the 10.3.5 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-05 18:43:47 +00:00
Emil Velikov
c90b0db1ae Add release notes for the 10.3.5 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-05 18:21:51 +00:00
Emil Velikov
dcebfa031f Update version to 10.3.5
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-12-05 18:18:24 +00:00
Brian Paul
b7c2711e40 mesa: fix height error check for 1D array textures
height=0 is legal for 1D array textures (as depth=0 is legal for
2D arrays).  Fixes new piglit ext_texture_array-errors test.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4e6244e80f)
2014-12-03 23:59:28 +00:00
Brian Paul
0810238cf2 mesa: fix arithmetic error in _mesa_compute_compressed_pixelstore()
We need parenthesis around the expression which computes the number of
blocks per row.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 991d5cf8ce)
2014-12-03 23:59:22 +00:00
Ilia Mirkin
d859a98f83 freedreno/ir3: fix UMAD
Looks like none of the mad variants do u16 * u16 + u32, so just add in
the extra value "by hand".

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit de83ef677f)
2014-12-03 23:59:16 +00:00
Ilia Mirkin
fd1610d542 freedreno/a3xx: only enable blend clamp for non-float formats
This fixes arb_color_buffer_float-render GL_RGBA16F.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3de9fa8ff4)
2014-12-03 23:59:09 +00:00
Ilia Mirkin
4739c7766d freedreno/ir3: don't pass consts to madsh.m16 in MOD logic
madsh.m16 can't handle a const in src1, make sure to unconst it

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 37fe347542)
2014-11-28 17:26:21 +00:00
Chris Forbes
f097e21228 mesa: Fix Get(GL_TRANSPOSE_CURRENT_MATRIX_ARB) to transpose
This was just returning the same value as GL_CURRENT_MATRIX_ARB.
Spotted while investigating something else in apitrace.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2b4fe85f0e)
2014-11-26 21:15:08 +00:00
Chris Forbes
abccf91e5e i965: Handle nested uniform array indexing
When converting a uniform array reference to a pull constant load, the
`reladdr` expression itself may have its own `reladdr`, arbitrarily
deeply. This arises from expressions like:

   a[b[x]]     where a, b are uniform arrays (or lowered const arrays),
               and x is not a constant.

Just iterate the lowering to pull constants until we stop seeing these
nested. For most shaders, there will be only one pass through this loop.

Fixes the piglit test:
tests/spec/glsl-1.20/linker/double-indirect-1.shader_test

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit adefccd12a)

Conflicts:
	src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
2014-11-26 21:15:08 +00:00
Rob Clark
4aafdf30ba configure.ac: bump libdrm_freedreno requirement
We need 2.4.57 for fd_bo_dmabuf() / fd_bo_from_dmabuf().

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 40aabc0e80)
Emil Velikov: Required by commit 2a90f0fb.
Nominated-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 00:41:57 +00:00
Ilia Mirkin
d9e1ba575d nv50,nvc0: buffer resources can be bound as other things down the line
res->bind is not an indicator of how the resource is currently bound.
buffers can be rebound across different binding points without changing
underlying storage.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fecae4625c)
2014-11-24 00:39:11 +00:00
Ilia Mirkin
e9518d8f30 nv50,nvc0: actually check constbufs for invalidation
The number of vertex buffers has nothing to do with the number of bound
constbufs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e80a0a7d9a)
2014-11-24 00:39:05 +00:00
Ilia Mirkin
2cf9c539c3 nv50/ir: set neg modifiers on min/max args
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86618
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7d07083cfd)
2014-11-24 00:39:00 +00:00
Emil Velikov
72c27d7a3a docs: Add sha256 sums for the 10.3.4 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-22 03:51:18 +00:00
Emil Velikov
26c8ecd85d Add release notes for the 10.3.4 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-22 03:31:01 +00:00
Emil Velikov
263c87ecdb Update version to 10.3.4
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-22 03:26:14 +00:00
Chad Versace
b43792f679 i965: Fix segfault in WebGL Conformance on Ivybridge
Fixes regression of WebGL Conformance test texture-size-limit [1] on
Ivybridge Mobile GT2 0x0166 with Google Chrome R38.

Regression introduced by

    commit 6c04423153
    Author: Kenneth Graunke <kenneth@whitecape.org>
    Date:   Sun Feb 2 02:58:42 2014 -0800

        i965: Bump GL_MAX_CUBE_MAP_TEXTURE_SIZE to 8192.

The test regressed because the pointer offset arithmetic in
intel_miptree_map_gtt() overflows for large textures. The pointer
arithmetic is not 64-bit safe.

[1] 52f0dc240f/sdk/tests/conformance/textures/texture-size-limit.html

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=78770
Fixes: Intel CHRMOS-1377
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Ian Romanic <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit b69c7c5dac)
2014-11-19 18:58:13 +00:00
Dave Airlie
8b5e53434c r600g: limit texture offset application to specific types (v2)
For 1D and 2D arrays we don't want the other coordinates being
offset and affecting where we sample. I wrote this patch 6 months
ago but lost it.

Fixes:
./bin/tex-miplevel-selection textureLodOffset 1DArray
./bin/tex-miplevel-selection textureLodOffset 2DArray
./bin/tex-miplevel-selection textureOffset 1DArray
./bin/tex-miplevel-selection textureOffset 1DArrayShadow
./bin/tex-miplevel-selection textureOffset 2DArray
./bin/tex-miplevel-selection textureOffset(bias) 1DArray
./bin/tex-miplevel-selection textureOffset(bias) 2DArray

v2: rewrite to handle more cases and be consistent with code
above.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 1830138cc0)
2014-11-19 00:50:01 +00:00
Dave Airlie
0512b9839d r600g: geom shaders: always load texture src regs from inputs
Otherwise we seem to lose the split_gs_inputs and try and
pull from an uninitialised register.

fixes 9 texelFetch geom shader tests.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d4c342f67e)
2014-11-19 00:50:01 +00:00
Ilia Mirkin
96c0d50398 st/mesa: add a fallback for clear_with_quad when no vs_layer
Not all drivers can set gl_Layer from VS. Add a fallback that passes the
instance id from VS to GS, and then uses the GS to set the layer.

Tested by adding

  quad_buffers |= clear_buffers;
  clear_buffers = 0;

to the st_Clear logic, and forcing set_vertex_shader_layered in all
cases. No piglit regressions (on piglits with 'clear' in the name).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 68db29c434)
2014-11-19 00:50:01 +00:00
Dave Airlie
410a6bae6a r600g/cayman: handle empty vertex shaders
Some of the geom shader tests produce an empty vertex shader,
on cayman we'd crash in the finaliser because last_cf was NULL.

cayman doesn't need the NOP workaround, so if the code arrives
here with no last_cf, just emit an END.

fixes crashes in a bunch of piglit geom shader tests.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 4e520101e6)
2014-11-19 00:50:01 +00:00
Dave Airlie
9bd73a81d9 r600g/cayman: fix texture gather tests
It appears on cayman the TG4 outputs were reordered.

This fixes a lot of piglit tests.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 27e1e0e710)
2014-11-19 00:50:01 +00:00
Dave Airlie
c44aa54d2c r600g/cayman: fix integer multiplication output overwrite (v2)
This fixes tests/spec/glsl-1.10/execution/fs-op-assign-mult-ivec2-ivec2-overwrite.shader_test.

hopeful fix for fd.o bug 85376

Reported-by: ghallberg
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 4a128d5a16)
2014-11-19 00:50:00 +00:00
Brian Paul
864f604bb1 st/mesa: copy sampler_array_size field when copying instructions
The sampler_array_size field was added by "mesa/st: add support for
dynamic sampler offsets".  But the field wasn't getting copied in
the get_pixel_transfer_visitor() or get_bitmap_visitor() functions.

The count_resources() function then didn't properly compute the
glsl_to_tgsi_visitor::samplers_used bitmask.  Then, we didn't declare
all the sampler registers in st_translate_program().  Finally, we
asserted when we tried to emit a tgsi ureg src register with File =
TGSI_FILE_UNDEFINED.

Add the missing assignments and some new assertions to catch the
invalid register sooner.

Cc: "10.3, 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 11abd7b2bc)
2014-11-19 00:50:00 +00:00
Michel Dänzer
f02f0559c6 radeonsi: Disable asynchronous DMA except for PIPE_BUFFER
Using the asynchronous DMA engine for multi-dimensional operations seems
to cause random GPU lockups for various people. While the root cause for
this might need to be fixed in the kernel, let's disable it for now.

Before re-enabling this, please make sure you can hit all newly enabled
paths in your testing, preferably with both piglit and real world apps,
and get in touch with people on the bug reports below for stability
testing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85647
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83500
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
(cherry picked from commit ae4536b4f7)
2014-11-19 00:49:59 +00:00
Emil Velikov
b8da681864 get-pick-list.sh: Require explicit "10.3" for nominating stable patches
A nomination unadorned with a specific version is now interpreted as
being aimed at the 10.4 branch, which was recently opened.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-18 03:06:39 +00:00
Emil Velikov
cfa85fe5e5 configure.ac: roll up a program for the sse4.1 check
So when checking/building sse code we have three possibilities:
 1 Old compiler, throws an error when using -msse*
 2 New compiler, user disables sse* (-mno-sse*)
 3 New compiler, user doesn't disable sse

The original code, added code for #1 but not #2. Later on we patched
around the lack of handling #2 by wrapping the code in __SSE4_1__.
Yet it lead to a missing/undefined symbol in case of #1 or #2, which
might cause an issue for #2 when using the i965 driver.

A bit later we "fixed" the undefined symbol by using #1, rather than
updating it to handle #2. With this commit we set things straight :)

To top it all up, conventions state that in case of conflicting
(-enable-foo -disable-foo) options, the latter one takes precedence.
Thus we need to make sure to prepend -msse4.1 to CFLAGS in our test.

v2: Clean the #includes. Suggested by Ilia, Matt & Siavash.

Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberg <david@ixit.cz>
Tested-by: Siavash Eliasi <siavashserver@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1a6ae84041)
2014-11-16 20:57:31 +00:00
Kenneth Graunke
e607d2df46 i915g: we also have more than 0 viewports!
See 546d6c8d for the corresponding fix in freedreno.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Stephane Marchesin <stephane.marchesin@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2b6e703863)
2014-11-16 20:57:05 +00:00
José Fonseca
f285c7eaaf llvmpipe: Avoid deadlock when unloading opengl32.dll
On Windows, DllMain calls and thread creation/destruction are
serialized, so when llvmpipe is destroyed from DllMain waiting for the
rasterizer threads to finish will deadlock.

So, instead of waiting for rasterizer threads to have finished, simply wait for the
rasterizer threads to notify they are just about to finish.

Verified with this very simple program:

   #include <windows.h>
   int main() {
      HMODULE hModule = LoadLibraryA("opengl32.dll");
      FreeLibrary(hModule);
   }

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

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 706ad3b649)

Squashed together with:

llvmpipe: Call pipe_thread_wait() on Linux.

To address http://lists.freedesktop.org/archives/mesa-dev/2014-November/070569.html

In short, revert 706ad3b649 for non-Windows
OSes.

(cherry picked from commit d5b1731178)
2014-11-16 20:56:16 +00:00
Emil Velikov
9cc26056ee docs: Add sha256 sums for the 10.3.3 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-08 17:07:34 +00:00
Emil Velikov
1a9cc5f50d Add release notes for the 10.3.3 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-08 16:43:13 +00:00
Emil Velikov
3be619f4b4 Update version to 10.3.3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-11-08 16:36:00 +00:00
Brian Paul
d5700dc276 mesa: fix UNCLAMPED_FLOAT_TO_UBYTE() macro for MSVC
MSVC replaces the "F" in "255.0F" with the macro argument which leads
to an error.  s/F/FLT/ to avoid that.

It turns out we weren't using this macro at all on MSVC until the
recent "mesa: Drop USE_IEEE define." change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 9608193cbc)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85918
Nominated-by: Roland Scheidegger <sroland@vmware.com>
2014-11-06 14:55:49 +00:00
Marek Olšák
d5ada3364f r300g: remove enabled/disabled hyperz and AA compression messages
It's annoying with octave. Reported by Michael Burian.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f058c6bbd1)
2014-11-06 14:51:37 +00:00
Jan Vesely
36b7043611 configure: include llvm systemlibs when using static llvm
v2: drop -WL,--exclude-libs, it's not necessary
    fix tabs/spaces

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70410
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
(cherry picked from commit af9551e68c)
2014-10-29 18:54:55 +00:00
Michel Dänzer
894ac63c34 radeon/llvm: Dynamically allocate branch/loop stack arrays
This prevents us from silently overflowing the stack arrays, and allows
arbitrary stack depths.

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

Cc: mesa-stable@lists.freedesktop.org
Reported-and-Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 402ab50bed)
2014-10-29 18:18:54 +00:00
Marek Olšák
d26258166c Revert "st/mesa: set MaxUnrollIterations = 255"
This reverts commit 20836c8185.

255 is a huge number. If you have a loop with 255 iterations, unrolling it
will exceed the SM3 instruction limit. Let's use the default again.

The comment about a SM3 limit doesn't make sense. For SM3, we generally
want 32 (default) or a lower number due to the SM3 instruction limit, which
is 512 instructions. For SM4, we can try higher numbers if needed, but
some shaders can end up being pretty huge and shader compilation can take
more time.

This fixes a shader compile failure on R500/SM3. Reported on IRC.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 6fcb5520b7)
2014-10-29 18:18:36 +00:00
Marek Olšák
e8c7affa66 radeonsi: fix incorrect index buffer max size for lowered 8-bit indices
Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit e05259b637)
2014-10-29 18:17:36 +00:00
Marek Olšák
62b2c8aca0 radeonsi: fix polygon mode for points and lines and point/line fill modes
Fixes piglit/polygon-mode-offset.

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 72424061e0)
2014-10-29 18:17:20 +00:00
Marek Olšák
e71a41852b r600g: fix polygon mode for points and lines and point/line fill modes
Fixes piglit/polygon-mode-offset.

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit dab177ea99)
2014-10-29 18:17:02 +00:00
Mauro Rossi
136ab97b46 gallium/nouveau: fully build the driver under android
Fix the trivial typo in the variable name.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 417b17378a)
2014-10-29 18:14:42 +00:00
Anuj Phogat
4956788a5f glsl: Use signed array index in update_max_array_access()
Avoids a crash in case of negative array index is used in a
shader program.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit 7a652c41b4)

Conflicts:
	src/glsl/ast_array_index.cpp
2014-10-29 18:11:04 +00:00
Anuj Phogat
bcf414c1a8 glsl: Fix crash due to negative array index
Currently Mesa crashes with a shader like this:

[fragmnet shader]
float[5] array;
int idx = -2;
void main()
{
   gl_FragColor = vec4(0.0, 1.0, 0.0, array[idx]);
}

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit 6f0089e92e)
2014-10-29 18:08:26 +00:00
Tapani Pälli
d45d00cf38 mesa: check that uniform exists in glUniform* functions
Remap table for uniforms may contain empty entries when using explicit
uniform locations. If no active/inactive variable exists with given
location, remap table contains NULL.

v2: move remap table bounds check before existence check (Ian Romanick)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Erik Faye-Lund <kusmabite@gmail.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83574
(cherry picked from commit 9bd139e451)
2014-10-29 17:59:12 +00:00
Tapani Pälli
4ed4dec642 glsl: fix uniform location count used for glsl types
Patch fixes the slot count used by vector types and adds 1 slot
to be used by image and sampler types.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82921
(cherry picked from commit 1cb81d3a9b)
2014-10-29 17:52:59 +00:00
Rob Clark
a3d5e59563 freedreno/a3xx: fix depth/stencil restore format
Also fix z16 restore format which was completely wrong.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 36310d9d56)
2014-10-29 17:46:37 +00:00
Rob Clark
69ac2043cf freedreno/a3xx: fix viewport state during clear
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 2bc2ab66d9)
2014-10-29 17:46:36 +00:00
Rob Clark
eaff221c9c freedreno: mark scissor state dirty when enable bit changes
We don't have a scissor enable bit in hw, so when a raster state change
results in scissor enable bit changing, we need to also mark scissor
state as dirty.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3eb8289aa4)
2014-10-29 17:46:36 +00:00
Rob Clark
a95a93b557 freedreno: clear vs scissor
The optimization of avoiding restore (mem2gmem) if there was a clear
falls down a bit if you don't have a fullscreen scissor.  We need to
make the decision logic a bit more clever to keep track of *what* was
cleared, so that we can (a) completely skip mem2gmem if entire buffer
was cleared, or (b) skip mem2gmem on a per-tile basis for tiles that
were completely cleared.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 01b757e2b0)
2014-10-29 17:46:36 +00:00
Rob Clark
b0d6ba5970 freedreno/ir3: add debug flag to disable cp
FD_MESA_DEBUG=nocp will disable copy propagation pass.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 4f17e026bb)

Conflicts:
	src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
2014-10-29 17:46:31 +00:00
Ilia Mirkin
b379e36e64 freedreno: positions come out as integers, not half-integers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit f0ca26725e)
2014-10-29 17:44:39 +00:00
Rob Clark
d6aab6b0c9 freedreno/a3xx: disable early-z when we have kill's
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3fcb021201)
2014-10-29 17:44:39 +00:00
Rob Clark
5b76a32132 freedreno/ir3: fix potential gpu lockup with kill
It seems like the hardware is unhappy if we execute a kill instruction
prior to last input (ei).  Probably the shader thread stops executing
and the end-input flag is never set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 8a0ffedd8d)
2014-10-29 17:44:39 +00:00
Rob Clark
708ee6f188 freedreno/ir3: comment + better fxn name
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit ab33a24089)
2014-10-29 17:44:39 +00:00
Rob Clark
971ae04fe6 freedreno/a3xx: more layer/level fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 74069e324e)
2014-10-29 17:44:39 +00:00
Rob Clark
64373f072c freedreno/ir3: large const support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 652b8fbbbb)
2014-10-29 17:44:39 +00:00
Rob Clark
9ea0efd1e2 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit e71a3f80fb)
2014-10-29 17:44:37 +00:00
Rob Clark
bc96be5662 freedreno: fix layer_stride
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit dd332fe641)
2014-10-29 17:44:23 +00:00
Rob Clark
323380b7ed freedreno: inline fd_draw_emit()
Manual LTO

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 8233b36a17)
2014-10-29 17:44:23 +00:00
Rob Clark
832cb958ff freedreno/ir3: optimize shader key comparision
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 368466b7b7)
2014-10-29 17:44:23 +00:00
Rob Clark
8a61e39531 freedreno/a3xx: refactor/optimize emit
Because we reuse various bits of emit code (for state/vertex/prog/etc)
for both regular draws and internal draws (gmem<->mem, clear, etc), the
number of parameters getting passed around has been growing.  Refactor
to group these into fd3_emit.  This simplifies fxn signatures, avoids
passing around shader key on the stack, etc.  It also gives us a nice
place to cache shader-variant lookup to avoid looking up shader variants
multiple times per draw (without having to *also* pass them around as
fxn args everywhere).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit d595987ea3)
2014-10-29 17:44:23 +00:00
Rob Clark
4b30efcf99 freedreno/a3xx: refactor vertex state emit
Get rid of fd3_vertex_buf and use fd_vertex_state directly for all
draws.  Removes a tiny bit of CPU overhead for munging around the vertex
state every time it is emitted, but more importantly it cleans things up
for later optimizations, so the emit paths don't have to special case
internal draws (gmem<->mem, clears, etc) with regular draws.

Instead of constructing fd3_vertex_buf array each time for internal
draws, and context init time pre-create solid_vbuf_state and
blit_vbuf_state.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit d5d80b3739)
2014-10-29 17:44:23 +00:00
Rob Clark
bce1e7e1c9 freedreno: query fixes
Fixes a few issues, including a potential empty-IB (which triggers gpu
hangs in piglit occlusion_query_meta_no_fragments)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 7297bdbd50)
2014-10-29 17:44:22 +00:00
Rob Clark
bce2d42ddb freedreno/a3xx: handle VS only outputting BCOLOR
Possibly we should map the front color to black (zeroes).  But not sure
there is a way to do that without generating a shader variant.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit a262c601d3)
2014-10-29 17:44:22 +00:00
Rob Clark
7e81f4a7e7 freedreno/ir3: fix lockups with lame FRAG shaders
Shaders like:

  FRAG
  PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
  DCL IN[0], GENERIC[0], PERSPECTIVE
  DCL OUT[0], COLOR
  DCL SAMP[0]
  DCL TEMP[0], LOCAL
  IMM[0] FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
    0: TEX TEMP[0], IN[0].xyyy, SAMP[0], 2D
    1: MOV OUT[0], IMM[0].xyxx
    2: END

cause unhappyness.  They have an IN[], but once this is compiled the
useless TEX instruction goes away.  Leaving a varying that is never
fetched, which makes the hw unhappy.

In the process fix a signed vs unsigned compare.  If the vertex shader
has max_reg=-1, MAX2() vs an unsigned would not give the desired result.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit af4d088395)
2014-10-29 17:44:22 +00:00
Ilia Mirkin
63b8a08c45 freedreno/ir3: add TXF support
Still failing a bunch of the fairly picky texelFetch tests, but the
1D(Array) ones are full passes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 33c9ad97bf)
2014-10-29 17:44:22 +00:00
Ilia Mirkin
4a97401abf freedreno/ir3: add TXD support and expose ARB_shader_texture_lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit e6acf3ac24)
2014-10-29 17:44:22 +00:00
Ilia Mirkin
dd79de214d freedreno/ir3: add texture offset support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit c49107c889)
2014-10-29 17:44:22 +00:00
Ilia Mirkin
1acdeab8a4 freedreno/ir3: shadow comes before array
Experimentally, this makes *ArrayShadow tex-miplevel-selection tests
pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 5bba74c64b)
2014-10-29 17:44:21 +00:00
Ilia Mirkin
64e4ac780e freedreno/ir3: make TXQ return integers, not floats
We're still doing something wrong for array textures.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 81b34e4461)
2014-10-29 17:44:21 +00:00
Ilia Mirkin
5bc1397bda freedreno/ir3: add UMAD support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit c4e2a196c3)
2014-10-29 17:44:21 +00:00
Ilia Mirkin
3b1a59259b freedreno/ir3: add ISSG support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 347bc197a6)
2014-10-29 17:44:21 +00:00
Ilia Mirkin
74a92b1f34 freedreno/ir3: add MOD support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit ad5db64e7e)
2014-10-29 17:44:21 +00:00
Ilia Mirkin
af52b00b19 freedreno/ir3: add UMOD support, based on UDIV
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit cab3cb1d71)
2014-10-29 17:44:20 +00:00
Ilia Mirkin
556d74b810 freedreno/ir3: add IDIV/UDIV support
Logic shamelessly copied from nv50 lowering pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 8f7d01c2cb)
2014-10-29 17:44:20 +00:00
Ilia Mirkin
502c295025 freedreno/ir3: avoid fan-in sources referring to same instruction
Since the RA has to be done s.t. each one gets its own (adjacent)
register, it would complicate matters if instructions were allowed to be
repeated. This enables copy-propagation use in situations where
previously that might have happened.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3dd9a0d6fd)
2014-10-29 17:44:20 +00:00
Rob Clark
c4f58245d0 freedreno/a3xx: emit all immediates in one shot
Makes the command stream a bit tighter when there are lots of
immediates.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit f5eeb8a6dc)
2014-10-29 17:44:20 +00:00
Ilia Mirkin
eb496ff68d freedreno: instanced drawing/compute not yet supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit be00852bae)
2014-10-29 17:44:20 +00:00
Rob Clark
e8820c85b4 freedreno/a3xx: handle large shader program sizes
Above a certain limit use CACHE mode instead of BUFFER mode.  This
should solve gpu hangs with large shader programs.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 7309c6126f)
2014-10-29 17:44:20 +00:00
Rob Clark
da71ef1893 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit d01ee5923d)
2014-10-29 17:44:17 +00:00
Ilia Mirkin
0a003d1dbc freedreno: dual-source render targets are not supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3dc47c5960)
2014-10-29 17:44:01 +00:00
Rob Clark
3b755280af freedreno: max-texture-lod-bias should be 15.0f
Fixes piglit lodbias test.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 204dd73c99)
2014-10-29 17:44:01 +00:00
Rob Clark
476c8c5028 freedreno: destroy transfer pool after blitter
Blitter can still have transfers hanging around which it frees in
util_blitter_destroy().  So let it clean up before we yank the
transfer_pool from under it.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit cc355f1c06)
2014-10-29 17:44:01 +00:00
Rob Clark
6d5a3daca9 freedreno/lowering: fix token calculation for lowering
Indirect registers consume an additional token.  Try to clean up the
token calculation math a bit, and fix it at the same time.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 01ff0b28b3)
2014-10-29 17:44:01 +00:00
Rob Clark
4d20bc6e8d freedreno/a3xx: re-emit shaders on variant change
We need to keep track if a state change other than frag/vert shader
state will trigger us to need a different shader variant, and if
necessary mark the appropriate shader state as dirty.  Otherwise we will
forget to re-emit the shader state.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit dce96f6da2)
2014-10-29 17:44:01 +00:00
Rob Clark
f1fd768b98 freedreno/a3xx: add support to emulate GL_CLAMP
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 7cdd467994)
2014-10-29 17:44:00 +00:00
Rob Clark
d37c083778 freedreno: add texcoord clamp support to lowering
This is for hw that needs to emulate some texture wrap modes (like
CLAMP) with some help from the shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3541705816)
2014-10-29 17:44:00 +00:00
Rob Clark
b46151f2ca freedreno: move bind_sampler_states to per-generation
Keep the existing function as a common helper.  But this lets us move an
a2xx specific hack out of common code.  And the PIPE_TEX_WRAP_CLAMP
emulation will require an a3xx specific hack.  So rather than piling on
hacks, split this out.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit a6746d1124)
2014-10-29 17:44:00 +00:00
Rob Clark
419acd3068 freedreno/a3xx: fix border color order
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 7e20c09d4a)
2014-10-29 17:44:00 +00:00
Rob Clark
64ce1bf8f6 freedreno/a3xx: add 32bit integer vtx formats
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit c61133046e)
2014-10-29 17:44:00 +00:00
Rob Clark
e67e5c6582 freedreno/a3xx: add flat interpolation mode
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit ed48f91275)
2014-10-29 17:43:59 +00:00
Rob Clark
d654082d14 freedreno/a3xx: add LOD_BIAS
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit df2f0c6d55)
2014-10-29 17:43:59 +00:00
Rob Clark
1a7fb8f04a freedreno: turn missing caps into compile warnings
Get rid of the 'default' case (as suggestied by imirkin) so compiler
warns us about missing caps.  Also add some caps that were missing until
now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit f7259949da)
2014-10-29 17:43:59 +00:00
Rob Clark
fb10a43b84 freedreno: we have more than 0 viewports!
4155d1c7 'st/mesa: drop dependence on API profile in st_init_extensions'
broke freedreno because somehow 'PIPE_CAP_MAX_VIEWPORTS' fell through
the cracks.  Resulting that we reported zero viewports.  So the state
tracker never bothered to give us any valid viewport!

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 546d6c8dc9)
2014-10-29 17:43:59 +00:00
Rob Clark
e1c2a8f2cb freedreno: update generated headers
Among other things, fixes a bug for fixed point registers/bitfields.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 24cd746e4b)
2014-10-29 17:43:56 +00:00
Rob Clark
0b339336b5 freedreno: don't advertise mirror-clamp support
At least on a3xx, we cannot do it without some emulation in shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 5c72672cdc)
2014-10-29 17:43:43 +00:00
Rob Clark
00c3ef169f freedreno: fix compiler warning
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit e4c678c164)
2014-10-29 17:43:42 +00:00
Rob Clark
f61b2185db freedreno/a3xx: initial texture border-color
Still some open questions.. and at any rate, no additional piglit passes
due to various wrap modes that we need to emulate in at least some
cases :-(

But it does fix some mystery page-faults.. So add some comments in the
code where there are things that we need to emulate or do more r/e, and
push as-is.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit a87e44da3a)
2014-10-29 17:43:42 +00:00
Ilia Mirkin
637ddce9cc freedreno/ir3: add TXB2 support
Handles texture(samplerCubeShadow, bias), part of GLES3 and GL3

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit f6ff4cd517)
2014-10-29 17:43:42 +00:00
Ilia Mirkin
737c900506 freedreno/ir3: add TXQ support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 9b7961f9a3)
2014-10-29 17:43:42 +00:00
Ilia Mirkin
336b75faca freedreno/ir3: fix TXB/TXL to actually pull the bias/lod argument
Previously we would get a potentially computed post-swizzle coord based
on the texture target info, which would not include the bias/lod in the
last argument.

The second argument does not have to be adjacent, so adjusting the order
array did not make sense.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 9a3dcf21d7)
2014-10-29 17:43:42 +00:00
Ilia Mirkin
7f6c0f4de4 freedreno/ir3: make texture instruction construction more dynamic
This will make life a lot easier as we add support for additional
instructions.

v2: shadow reference value is always .z or .w

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 53678f5e6b)
2014-10-29 17:43:42 +00:00
Rob Clark
1a755fcc3a freedreno/a3xx: more texture array fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 49b8fb937f)
2014-10-29 17:43:41 +00:00
Rob Clark
2a90f0fb85 freedreno: add DRM_CONF_SHARE_FD
And config query and DRM_CONF_SHARE_FD to both mega-driver and
traditional build configs, so that EGL_EXT_image_dma_buf_import
works.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 18291ee17a)
2014-10-29 17:43:41 +00:00
Ilia Mirkin
3a64feedb8 freedreno: add default .dir-locals.el for emacs settings
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 5b1d316c51)
2014-10-29 17:43:41 +00:00
Rob Clark
544a368626 freedreno/a3xx: 3d/array textures
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit ca29c4c3b0)
2014-10-29 17:43:41 +00:00
Rob Clark
e10a243abf freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit eea1cdf687)
2014-10-29 17:43:38 +00:00
Rob Clark
a3f6e58d6d freedreno: "fix" problems with excessive flushes
4f338c9b introduced logic to trigger a flush rather than overflowing
cmdstream buffer.  But the threshold was too low, triggering flushes
where they were not needed.  This caused problems with games like
xonotic.

Part of the problem is that we need to mark all state dirty between
cmdstream submit ioctls, because we cannot rely on state being
preserved across ioctls.  But even with that, there are still some
problems that are still being debugged.  For now:

1) correctly mark all state dirty
2) introduce FD_MESA_DEBUG flush flag to force rendering to be flushed
between each draw, to trigger problems (so that I can debug)
3) use a more reasonable threshold so for normal usecases we don't
trigger the problems

This at least corrects the regression, but there is still more debugging
to do.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 9b6281a7da)
2014-10-29 17:43:23 +00:00
Ilia Mirkin
14f6eb92f8 freedreno/ir3: implement UMUL correctly
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit d7ec3db349)
2014-10-29 17:43:23 +00:00
Ilia Mirkin
c3ee102f8e freedreno/ir3: fix UCMP handling
UCMP does not require a compare, only a select.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 436dd1e2f8)
2014-10-29 17:43:23 +00:00
Ilia Mirkin
1c160747d0 freedreno/ir3: add TXL support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 9f5bd154d7)
2014-10-29 17:43:23 +00:00
Rob Clark
c912acad17 freedreno/ir3: add missing put_dst
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 459f8f3d66)
2014-10-29 17:43:22 +00:00
Rob Clark
81bd498908 freedreno/ir3: catch incorrect usage of tmp-dst
Each get_dst() should have a matching put_dst().  Add a bit of checking
to catch mistakes.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 59ff81663a)
2014-10-29 17:43:22 +00:00
Ilia Mirkin
6244af1343 freedreno/ir3: use unsigned comparison for UIF
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit db1a94b1cc)
2014-10-29 17:43:22 +00:00
Ilia Mirkin
5af1301751 freedreno/ir3: negate result of USLT/etc
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 11d72553c5)
2014-10-29 17:43:22 +00:00
Ilia Mirkin
3f545b96e5 freedreno/ir3: add UARL support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 8edf83b377)
2014-10-29 17:43:22 +00:00
Ilia Mirkin
69c1aa728d freedreno/ir3: INEG operates on src0, not src1
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 10273f84c2)
2014-10-29 17:43:22 +00:00
Ilia Mirkin
1d1bc7f7c2 freedreno/ir3: fix FSLT/etc handling to return 0/-1 instead of 0/1.0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 572ffca050)
2014-10-29 17:43:21 +00:00
Rob Clark
34b62bd12e freedreno/a3xx: alpha render-target shenanigans
We need the .w component to end up in .x, since the hw appears to fetch
gl_FragColor starting with the .x coordinate regardless of MRT format.
As long as we are doing this, we might as well throw out the remaining
unneeded components.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 80058c0f08)
2014-10-29 17:43:21 +00:00
Rob Clark
695a4b2b4e util/u_format: add _is_alpha()
Because of render-to-alpha (000x) shenanigans, freedreno needs to do
some special handling when rendering to alpha-only formats.  And I
noticed that while we had _is_luminance(), _is_intensity(), etc, an
_is_alpha() helper was missing.  So fix that.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 3e0a82b52e)
2014-10-29 17:43:21 +00:00
Rob Clark
0e9bb8efe4 freedreno/a3xx: format fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 480fe244dd)
2014-10-29 17:43:21 +00:00
Rob Clark
1a36639b06 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 1fba490569)
2014-10-29 17:43:11 +00:00
Rob Clark
06d5717692 freedreno/a3xx: handle rendering to layer != 0
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 2ed7640eec)
2014-10-29 17:40:48 +00:00
Rob Clark
852bb5dd62 freedreno/a3xx: enable hw primitive-restart
Since software primitive-restart emulation is going to be removed (and
anyways, mostly seemed to be crash prone in combination with
u_primconvert and oddball scenarios (like PIPE_PRIM_POLYGON with only a
single vertex), might as well do it in hardware (which fortunately
didn't turn out to be too hard to figure out).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 720cfb6fe9)
2014-10-29 17:40:48 +00:00
Rob Clark
b2c855b7f9 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 564183f39c)
2014-10-29 17:40:48 +00:00
Rob Clark
91f9cbc996 freedreno/ir3: fix potential segfault in RA
Triggered by shaders like:

  FRAG
  PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
  DCL OUT[0], COLOR
  DCL CONST[0]
  DCL TEMP[0..2], LOCAL
    0: IF CONST[0].xxxx :0
    1:   MOV TEMP[0], TEMP[1]
    2: ELSE :0
    3:   MOV TEMP[0], TEMP[2]
    4: ENDIF
    5: MOV OUT[0], TEMP[0]
    6: END

not really a sane shader, although driver segfaulting is probably
not the appropriate response.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit a2c22d80d4)
2014-10-29 17:40:47 +00:00
Rob Clark
852da37330 freedreno: don't overflow cmdstream buffer so much
We currently aren't too clever about dealing with running out of
cmdstream buffer space.  Since we use a single buffer for both drawing
and tiling commands, we need to ensure there is enough space at the tail
of the cmdstream buffer to fit the tiling commands.

Until we get more clever, the easy solution is a threshold to trigger
flushing rendering even if the application does not trigger flush (swap,
changing render target, etc).  This way we at least don't crash for apps
that do several thousand draw calls (like some piglit tests do).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 4f338c9bbf)
2014-10-29 17:40:47 +00:00
Rob Clark
ea955ffd4d freedreno/ir3: add no-copy-propagate fallback step
Most of the things the new compiler still has trouble with basically
amount to cp stage removing too many copies.  But without the cp stage,
the shaders the new compiler produces are still better (perf and
correctness) than the old compiler.  So a simple thing to do until I
have more time to work on it is first trying falling back to new
compiler without cp, before finally falling back to old compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit fd4884e929)
2014-10-29 17:40:47 +00:00
Rob Clark
9995edb700 freedreno/ir3: fix constlen with relative addressing
We can't rely on the value from the assembler if relative addressing is
used.  So instead use the max of declared-consts (which does not include
compiler immediates) and what we get from the assembler (which does).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 5d8f40a53a)

Conflicts:
	src/gallium/drivers/freedreno/ir3/ir3_shader.c
2014-10-29 17:40:35 +00:00
Rob Clark
8dfb9773c4 freedreno/ir3: fix error in bail logic
all_delayed will also be true if we didn't attempt to schedule anything
due to no more instructions using current addr/pred.  We rely on coming
in to block_sched_undelayed() to detect and clean up when there are no
more uses of the current addr/pred, which isn't necessarily an error.

This fixes a regression introduced in b823abed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 73ff4c5f70)
2014-10-29 17:40:17 +00:00
Rob Clark
e90f0daaaa freedreno/ir3: bit of debug
Make it easier to figure out which compiler stage failed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 08ee0488e6)
2014-10-29 17:40:17 +00:00
Rob Clark
7fded6b548 freedreno/ir3: add DDX/DDY
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit ef858ac770)
2014-10-29 17:40:17 +00:00
Rob Clark
5e5b48b10e freedreno/ir3: add TXB
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit c99f09f4be)
2014-10-29 17:40:17 +00:00
Rob Clark
d1794194f6 freedreno/ir3: detect scheduler fail
There are some cases where the scheduler can get itself into impossible
situations, by scheduling the wrong write to pred or addr register
first.  (Ie. it could end up being unable to schedule any instruction if
some instruction which depends on the current addr/reg value also
depends on another addr/reg value.)

To solve this we'd need to be able to insert extra mov instructions
(which would also help when register assignment gets into impossible
situations).  To do that, we'd need to move the nop padding from sched
into legalize.

But to start with, just detect when we get into an impossible situation
and bail, rather than sitting forever in an infinite loop.  This way it
will at least fall back to the old compiler, which might even work if
you are lucky.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit b823abedf8)
2014-10-29 17:40:17 +00:00
Emil Velikov
9599470642 docs: Add sha256 sums for the 10.3.2 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-25 00:43:12 +00:00
Emil Velikov
3b6a4758fa Add release notes for the 10.3.2 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-25 00:33:38 +00:00
Emil Velikov
e0aaa9591b Update VERSION to 10.3.2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-25 00:27:57 +00:00
Michel Dänzer
724f71ef39 r600g: Drop references to destroyed blend state
Fixes use-after-free when the currently bound blend state is destroyed.

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

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit ae879718c4)
2014-10-22 15:39:49 +01:00
Marek Olšák
6fa07d1d48 glsl_to_tgsi: fix the value of gl_FrontFacing with native integers
We must convert it to boolean from the DX9 float encoding that Gallium
specifies.

Later, we should probably define that FACE should be 0 or ~0 if native
integers are supported.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 9ec305ead7)
2014-10-22 15:39:03 +01:00
Brian Paul
8f6f6a28fa glsl: fix several use-after-free bugs
The get_variable_being_redeclared() function can free the 'var' argument.
Thereafter, we cannot assume that 'var' is a valid  pointer.  This patch
replaces 'var->name' with 'earlier->name' in two places and calls
is_gl_identifier(var->name) before 'var' might get freed.

This fixes several piglit GLSL crashes, including:
spec/glsl-1.50/execution/geometry/clip-distance-in-param
spec/glsl-1.50/execution/geometry/clip-distance-bulk-copy
spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-before-global-redeclaration.geom

I'm not sure why these were not spotted sooner.
A similar bug was previously fixed by f9cecca7a.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
(cherry picked from commit 14379a0644)
2014-10-22 15:38:26 +01:00
Marek Olšák
10d8287074 st/mesa: use pipe_sampler_view_release for releasing sampler views
This fixes a crash when exiting Firefox. I have really no idea how Firefox
does it. It seems to involve multiple contexts and multithreading.

v2: added an XXX comment

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

Acked by Christian König.
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Tested-by: Benjamin Bellec <b.bellec@gmail.com>

(cherry picked from commit 833d698ad5)
2014-10-19 19:02:07 +01:00
Michel Dänzer
c759d1b6bf winsys/radeon: Use separate caching buffer manager for each set of flags
Otherwise the caching buffer manager may return a buffer which was created
with a different set of flags, which can cause trouble.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 3ede67a4c6)

Conflicts:
	src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
2014-10-19 19:02:07 +01:00
Ilia Mirkin
b37c1d4642 st/gbm: fix order of arguments passed to is_format_supported
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 742158b51e)
2014-10-19 18:38:39 +01:00
Ilia Mirkin
fb20a5aa98 nouveau: 3d textures are unsupported, limit 3d levels to 1
Ideally there would be a swrast fallback, but the driver isn't ready for
that. This should avoid crashes if someone tries to use 3d textures
though.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 5524af8136)
2014-10-19 18:38:33 +01:00
Daniel Manjarres
4f33ded115 glx: Fix glxUseXFont for glxWindow and glxPixmaps
The current implementation of glxUseXFont requires creating
a temporary pixmap and graphics context, which requires a real
old-school X11 Window, not a glxDrawable. This patch changes
things so that glxUseXFont will also accept a glxWindow or
glxPixmap, and lookup the underlying X11 Drawable. Without
this patch glxUseXFont generates a giant stream of Xerrors
about bad drawables and bad graphics contexts.

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 291be28476)
2014-10-19 18:38:19 +01:00
Kenneth Graunke
13a4fd2430 i965: Fix register write checks.
When mapping the buffer a second time, we need to use the new pointer,
not the one from the previous mapping.  Otherwise, we will most likely
crash.

Apparently, we've just been getting lucky and getting the same
bo->virtual pointer in both cases.  libdrm probably has a hand in that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 94841b6d5d)
2014-10-13 01:16:04 +01:00
Kenneth Graunke
5e6ee119c0 i965: Use BDW_MOCS_PTE for renderbuffers.
Write-back caching cannot be used for buffers being scanned out by the
display engine; surfaces used for scan-out must be write-through or
uncached.  I originally chose WT for render targets because it works in
all cases.  However, we really want to use write-back caching where
possible, as it is more efficient.

Most renderbuffers are not used for scanout - off-screen FBOs certainly
are fine, and non-pageflipped backbuffers should be fine as well.  So
in most cases WB will work.  However, we don't know what will be used
for scan-out, so we instead simply use the PTE value specified by the
kernel, as it knows these things.

This matches our MOCS choice on Haswell.

Fixes performance regressions since commit ee4484be3d
in a microbenchmark (spotted by Eero Tamminen).  Improves performance
in GLBenchmark 2.7/EgyptHD by 7.44362% +/- 0.496939% (n=55) on a
Broadwell GT2.  Improves performance in a bunch of other microbenchmarks
by ~15% or so.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Eero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit b7844d1248)
2014-10-13 01:15:58 +01:00
Kenneth Graunke
85d7eb730a i965: Add a BRW_MOCS_PTE #define.
Like BDW_MOCS_WB and BDW_MOCS_WT, this specifies that we want to use all
three caches (L3, LLC, and eLLC where available), but leaves the LLC
caching mode up to the kernel's page table entry.

This allows the kernel to pick WB/WT/UC based on whether it's using a
buffer for scanout.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d489a8a73d)
2014-10-13 01:15:32 +01:00
Michel Dänzer
64c2bdc334 r600g,radeonsi: Always use GTT again for PIPE_USAGE_STREAM buffers
Putting those in VRAM can cause long pauses due to buffers being moved
into / out of VRAM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84662
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7b4276d7ac)
2014-10-13 01:13:24 +01:00
Ilia Mirkin
125cd86cd4 gk110/ir: add dnz flag emission for fmul/fmad
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c74be01e80)
2014-10-13 01:13:00 +01:00
Ilia Mirkin
e3e68a36db gm107/ir: add dnz emission for fmul
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d58037ccf5)
2014-10-13 01:12:38 +01:00
Brian Paul
745a0bfd62 st/wgl: add WINAPI qualifiers on wgl function typedefs
Fixes a release build segfault when wglCreateContextAttribsARB()
calls the wglCreateContext() function.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
(cherry picked from commit 90dc71b454)
2014-10-13 01:12:01 +01:00
Brian Paul
ada5fd6e85 mesa: fix spurious wglGetProcAddress / GL_INVALID_OPERATION error
On Windows, the Piglit primitive-restart test was failing a
glGetError()==0 assertion when it was run w/out any command line
arguments.  Piglit's all.py script only runs primitive-restart
with arguments so this case isn't normally hit during a full
piglit run.

The basic problem is Microsoft's opengl32.dll calls glFlush
from wglGetProcAddress() and Piglit uses wglGetProcAddress() to
resolve glPrimitiveRestartNV() which is called inside glBegin/End.
See comments in the code for more info.

Plus, improve the comments for _mesa_alloc_dispatch_table().

Cc: <mesa-stable@lists.freedesktop.org>
Acked-by: Sinclair Yeh <syeh@vmware.com>
(cherry picked from commit c7f0755caa)
2014-10-13 01:11:23 +01:00
Michel Dänzer
ecd2d078ac radeonsi: Clear sampler view flags when binding a buffer
Fixes assertion failure while running the Unreal Engine 4 Elemental demo:

.../si_blit.c:322:si_decompress_color_textures: Assertion `tex->cmask.size || tex->fmask.size' failed.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit ed03747e6a)
2014-10-13 01:11:04 +01:00
Dave Airlie
08f7e3591d mesa: fix GetTexImage for 1D array depth textures
While running piglit in virgl, I hit an assert in intel driver.

"qemu-system-x86_64: intel_tex.c:219: intel_map_texture_image: Assertion `tex_image->TexObject->Target != 0x8C18 || h == 1' failed."

Thanks to Eric and Ken for pointing me in the right direction,

Fix the get_tex_depth to do the same fixup as get_tex_rgba does
for 1D array textures.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 8df3c02cdc)
2014-10-13 01:01:38 +01:00
Emil Velikov
fa98c74692 docs: Add sha256 sums for the 10.3.1 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-13 00:34:19 +01:00
Emil Velikov
088d350178 Add release notes for the 10.3.1 release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-13 00:16:59 +01:00
Emil Velikov
85421100fb Update VERSION to 10.3.1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-10-12 21:44:45 +01:00
Tomasz Figa
c90cd077bd st/mesa: Fix paths used in Android builds
With current makefiles the build fails because source and build paths
are generated incorrectly. With Android build system the top_srcdir and
top_builddir variables are undefined and all paths are relative to where
Android.mk is located. This ends up with path likes
external/mesa/src/mesa/src/mesa/ for both source and build paths, which
are obviously wrong.

This patch fixes this by overriding resulting SRCDIR and BUILDDIR
variables with empty string, so that paths end up being relative to
Android.mk file again. Appending correct build path to generated files
is already done in Android.gen.mk.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit b4ffd19e6c)
2014-10-03 01:28:02 +01:00
Tomasz Figa
dffbee6668 st/mesa: Generate format_info.c in Android builds
Current Android makefiles lack generation of format_info.c, which is
a dependency of main/format.c. This patch adds necessary code to
Android.gen.mk.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 98445fd25e)
2014-10-03 01:27:56 +01:00
Tomasz Figa
58ba481e8e util: Include in Android builds
This patch fixes Android build failures by including src/util directory
in compilation. Files inside of this directory are compiled into
libmesa_util static library and linked with resulting libGLES_mesa.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit d703abf735)
2014-10-03 01:27:50 +01:00
Keith Packard
ccf908e382 glx/dri3: Provide error diagnostics when DRI3 allocation fails
Instead of just segfaulting in the driver when a buffer allocation fails,
report error messages indicating what went wrong so that we can debug things.

As a simple example, chromium wraps Mesa in a sandbox which doesn't allow
access to most syscalls, including the ability to create shared memory
segments for fences. Before, you'd get a simple segfault in mesa and your 3D
acceleration would fail. Now you get:

$ chromium --disable-gpu-blacklist
[10618:10643:0930/200525:ERROR:nss_util.cc(856)] After loading Root Certs, loaded==false: NSS error code: -8018
libGL: pci id for fd 12: 8086:0a16, driver i965
libGL: OpenDriver: trying /local-miki/src/mesa/mesa/lib/i965_dri.so
libGL: Can't open configuration file /home/keithp/.drirc: Operation not permitted.
libGL: Can't open configuration file /home/keithp/.drirc: Operation not permitted.
libGL error: DRI3 Fence object allocation failure Operation not permitted
[10618:10618:0930/200525:ERROR:command_buffer_proxy_impl.cc(153)] Could not send GpuCommandBufferMsg_Initialize.
[10618:10618:0930/200525:ERROR:webgraphicscontext3d_command_buffer_impl.cc(236)] CommandBufferProxy::Initialize failed.
[10618:10618:0930/200525:ERROR:webgraphicscontext3d_command_buffer_impl.cc(256)] Failed to initialize command buffer.

This made it pretty easy to diagnose the problem in the referenced bug report.

Bugzilla: https://code.google.com/p/chromium/issues/detail?id=415681
Signed-off-by: Keith Packard <keithp@keithp.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 3202926746)
2014-10-03 01:27:42 +01:00
Thomas Hellstrom
ed440234d4 st/xa: Fix regression in xa_yuv_planar_blit()
Commit "st/xa: scissor to help tilers" broke xa_yuv_planar_blit() and vmwgfx
textured video. Fix this by implementing scissors also in the yuv draw path.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 46537f1d03)
2014-10-03 01:27:34 +01:00
Marek Olšák
d95520d297 st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables
Some users don't understand that these variables can break OpenGL.
The general is rule is that if an app supports MSAA, you mustn't use
GALLIUM_MSAA.

For example, if an app has an 8xMSAA FBO and GALLIUM_MSAA=4
is set, resolving the FBO to the back buffer will be rejected which will look
like this on all gallium drivers:

http://www.phoronix.com/scan.php?page=article&item=amd_radeonsi_msaa

The environment variables also have no effect on modern apps like TF2, but
there is still a performance hit due to wasted bandwidth and VRAM.

In a nutshell, it does more harm than good.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 8449121971)
2014-09-28 20:52:02 +01:00
Tom Stellard
3e980357c5 configure.ac: Compute LLVM_VERSION_PATCH using llvm-config
This is the only guaranteed way get the patch level for llvm,
since the define cannot always be found in config.h depending
on the version of llvm or the build system used.

CC: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
(cherry picked from commit ec566e0f16)
2014-09-27 18:56:40 +01:00
Ian Romanick
384816c6db glsl: Strip arrayness from ir_type_dereference_variable too
If the thing being dereferenced is a record or an array of records, it
should be treated as row-major.  The ir_type_derference_record path
already does this, and I think I intended to do the same for this path
in b17a4d5d.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83741
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit c3f17bb18f)
2014-09-27 18:56:39 +01:00
Ian Romanick
d556ed889d glsl: Round struct size up to at least 16 bytes
Per rule #9, the size of the structure is vec4 aligned.  The MAX2 in the
loop ensures that sizes >= 16 bytes are vec4 aligned.  The new MAX2
after the loop ensures that sizes < 16 bytes are vec4 aligned.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82932
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 2ab71e1486)
2014-09-27 18:56:39 +01:00
Ian Romanick
d9444533aa glsl: Make sure row-major array-of-structure get correct layout
Whether or not the field is row-major (because it might be a bvec2 or
something) does not affect the array itself.  We need to know whether an
array element in its entirety is row-major.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83506
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 5c75270c34)
2014-09-27 18:56:39 +01:00
Ian Romanick
9328440ef7 glsl: Make sure fields after small structs have correct padding
Previously the linker would correctly calculate the layout, but the
lower_ubo_reference pass would not apply correct alignment to fields
following small (less than 16-byte) nested structures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83533
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8e01c66da6)
2014-09-27 18:56:39 +01:00
Michel Dänzer
1ac204121b st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers
Such buffers can only be useful by reading from them with the CPU, so we
need to make sure CPU reads are fast.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 7e55c3b352)
2014-09-27 18:56:39 +01:00
Ilia Mirkin
fef6059a81 gm107/ir: take relative pfetch offset into account
There is no dedicated instruction for this, so just combine it with the
constant offset.

Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a5bbfeda97)
2014-09-27 18:56:38 +01:00
Ilia Mirkin
34809f8eef gm107/ir: add support for indirect const buffer selection
This was missed in the commit that enabled it for fermi/kepler as part
of ARB_gpu_shader5

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit cdc4de1215)
2014-09-27 18:56:38 +01:00
Ilia Mirkin
9a79018840 gm107/ir: fix texture argument order
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0532a5fd00)
2014-09-27 18:56:38 +01:00
Ilia Mirkin
5aff846a60 gm107/ir: fix manual TXD for array targets
This parallels the fixes in commit afea9bae.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d3c3bba6d0)
2014-09-27 18:56:38 +01:00
Ilia Mirkin
fb4e23626f nv50/ir: avoid deleting pseudo instructions too early
What happens is that a SPLIT operation is part of the spill node, and as
a pseudo op, the instruction gets erased after processing its first def.
However the later defs still need to refer to it, so instead delay
deleting until after that whole RA node is done processing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79462
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 0147c10c5f)
2014-09-27 18:56:38 +01:00
Kenneth Graunke
607d0b9578 mesa: Set correct array element in vbo_exec_vtx_init.
I'm not familiar with this code, but this sure appears to be a typo.
It looks like the intent is to set each array element, not arrays[0]
each time.  Notably, the loop just below uses "array", not "arrays".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit f81052dc9b)
2014-09-27 18:56:38 +01:00
Kenneth Graunke
4fce87bcee mesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).
The code in get.c that handles this uses ctx->Array.VAO->VertexAttrib,
which is a gl_vertex_attrib_array structure, not a gl_client_array.

The offsets of all fields happened to be the same in both structures, at
least on x86_64.  "Size," "Type," and "Stride" are obviously the same:
both structures start with the same fields, in the same order.

"Enabled" is dicier: there are different fields before it in both
structures, including pointer sized values which might need special
alignment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit d0ec6e8509)
2014-09-27 18:56:37 +01:00
Marek Olšák
8e2d0f59f7 radeonsi: properly destroy the GS copy shader and scratch_bo for compute
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit dc05a9e4e0)
[Emil Velikov: remove unref scratch_bo, s/si_shader/si_pipe_shader/]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-27 18:55:52 +01:00
Marek Olšák
4748d2f065 radeonsi: release GS rings at context destruction
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 711623f7c8)
[Emil Velikov: s/ring/ring.buffer/]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-27 18:55:07 +01:00
Andreas Pokorny
f74bca93b4 i915: Fix black buffers when importing prime fds
Width and Height of the imported image was never initialized from the
imported bo.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit df341320c9)
2014-09-27 18:12:57 +01:00
Andreas Pokorny
ceebec140b egl/drm: expose KHR_image_pixmap extension
This changes enables EGL_KHR_image_pixmap in the egl drm platform, which is implemented
there but has not been advertised yet.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit 53b614bfd3)
2014-09-27 18:12:51 +01:00
Roland Scheidegger
095a6a0af1 gallivm: fix idiv
ffeb77c7b0 had a typo which turned all signed
integer divisions into unsigned ones. Oops.
This gets us back the 51 little piglits
(all from glsl built-in-functions, fs/vs/gs-op-div-int-ivec2 and similar).

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 5e1fcc6258)
2014-09-27 18:12:44 +01:00
rconde
04a9d7d44a gallivm,tgsi: fix idiv by zero crash
While the result of signed integer division by zero is undefined by glsl
(and doesn't exist with d3d10), we must not crash, so need to make sure we
don't get sigfpe much like udiv already does.
Unlike udiv where we return 0xffffffff (as required by d3d10) there is
no requirement right now to return anything specific so we use zero.

(cherry picked from commit ffeb77c7b0)
Nominated-by: Roland Scheidegger <sroland@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83570
2014-09-23 00:52:51 +01:00
Tom Stellard
d4289fc37b clover: Add support to mem objects for multiple destructor callbacks v2
The spec says that mem objects should maintain a stack of callbacks
not just one.

v2:
  - Remove stray printf.

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

CC: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c6d9801409)
2014-09-23 00:46:00 +01:00
Brian Paul
9599cd6a2f mesa: fix prog_optimize.c assertions triggered by SWZ opcode
The SWZ instruction can have swizzle terms >4 (SWIZZLE_ZERO, SWIZZLE_ONE).
These swizzle terms caused a few assertions to fail.
This started happening after the commit "mesa: Actually use the Mesa IR
optimizer for ARB programs." when replaying some apitrace files.

A new piglit test (tests/asmparsertest/shaders/ARBfp1.0/swz-08.txt)
exercises this.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
(cherry picked from commit 7b2c703244)
2014-09-23 00:45:21 +01:00
Richard Sandiford
27f70a9273 swrast: Fix handling of MESA_FORMAT_L8A8_SRGB for big-endian
Luminance is the least-significant byte of the uint16, rather than the
lowest byte in memory.  Other parts of mesa already handle this correctly
for big-endian, and swrast already handles other MESA_FORMAT_x8y8 formats
correctly.  This case was just an odd-one-out.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit ecc48f83c8)
2014-09-23 00:45:01 +01:00
Richard Sandiford
0a6e33ea74 mesa: Fix alpha component in unpack_R8G8B8X8_SRGB.
The function was using the "X" component as the alpha channel,
rather than setting alpha to 1.0.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 3ff5c6a6c4)
2014-09-23 00:44:30 +01:00
Emil Velikov
18571edea8 docs: Add 10.3 sha256 sums, news item and link release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-19 20:01:04 +01:00
Emil Velikov
1b12af300d docs: Update 10.3 release notes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-19 19:43:01 +01:00
Emil Velikov
4c4846b588 Bump version to 10.3 (final)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-19 19:27:45 +01:00
Connor Abbott
e471841048 r300g: set register classes before interferences
In commit 567e2769b8 ("ra: make the p, q
test more efficient") I unknowingly introduced a new requirement to the
register allocator API: the user must set the register class of all
nodes before setting up their interferences, because
ra_add_conflict_list() now uses the classes of the two interfering
nodes. i965 already did this, but r300g was setting up register classes
interleaved with setting up the interference graph. This led to us
calculating the wrong q total, and in certain cases
e78a01d5e6 (" ra: optimistically color
only one node at a time") made it so that this bug caused a segfault. In
particular, the error occurred if the q total was decremented to 1 below
0 for the last node to be pushed onto the stack.  Since q_total is an
unsigned integer, it overflowed to 0xffffffff, which is what
lowest_q_total happens to be initialzed to. This means that we would
fail the "new_q_total < lowest_q_total" check on line 476 of
register_allocate.c, and so the node would never be pushed onto the
stack, which led to segfaults in ra_select() when we failed to ever give
it a register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82828
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Tested-by: Pavel Ondračka <pavel.ondracka@email.cz>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit afd82dcad1)
2014-09-16 22:18:34 +01:00
Gwenole Beauchesne
f86efb4285 i965: add support for RGBA dma_buf imports.
This allows for importing foreign buffers in RGB32 native endian
byte order, i.e. DRM_FORMAT_XBGR8888, and DRM_FORMAT_ABGR8888.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e1c50abf8a)
2014-09-16 22:17:58 +01:00
Kenneth Graunke
84a58f462a i965: Mark delta_x/y as BAD_FILE if remapped away completely.
Commit afe3d1556f (i965: Stop doing
remapping of "special" regs.) stopped remapping delta_x/delta_y, and
additionally stopped considering them always-live.  We later realized
delta_x was used in register allocaiton, so we actually needed to remap
it, which was fixed in commit 23d782067a
(i965/fs: Keep track of the register that hold delta_x/delta_y.).

However, that commit didn't restore the "always consider it live" part.
If all the code using delta_x was eliminated, fs_visitor::delta_x would
be left pointing at its old register number.  Later code in register
allocation would handle that register number specially...even though it
wasn't actually delta_x.

To combat this, set delta_x/y to BAD_FILE if they're eliminated, and
check for that.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83127
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 78bd126194)
2014-09-16 22:17:40 +01:00
Richard Sandiford
605734780e gallivm: Fix uses of 2^24
Fallback cases in lp_bld_arit.c used 2^24 to mean "2 to the power 24",
but in C it's "2 xor 24", i.e. 26.  Fixed by using 1<< instead.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 1a65629ccc)
2014-09-16 22:16:58 +01:00
Ilia Mirkin
efe8fc687d nouveau: change internal variables to avoid conflicts with macro args
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b13a4ca3f7)
2014-09-16 22:16:16 +01:00
Brian Paul
051543962f mesa: fix _mesa_free_pipeline_data() use-after-free bug
Unreference the ctx->_Shader object before we delete all the pipeline
objects in the hash table.  Before, ctx->_Shader could point to freed
memory when _mesa_reference_pipeline_object(ctx, &ctx->_Shader, NULL)
was called.

Fixes crash when exiting the piglit rendezvous_by_location test on
Windows.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 0d73ac6b02)
2014-09-16 22:15:29 +01:00
Andreas Boll
b92ea2a10d gallium/util: add missing u_debug include
Needed for assert.
Fixes build on BE archs with -Werror=implicit-function-declaration.

In file included from
../../../../../src/gallium/auxiliary/draw/draw_fs.c:30:0:
../../../../../src/gallium/auxiliary/util/u_math.h: In function
'util_memcpy_cpu_to_le32':
../../../../../src/gallium/auxiliary/util/u_math.h:810:4: error:
implicit declaration of function 'assert'
[-Werror=implicit-function-declaration]
    assert(n % 4 == 0);
        ^

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 2a13ff954d)
2014-09-16 22:14:03 +01:00
Ilia Mirkin
b0131d951b nouveau: only enable stencil func if the visual has stencil bits
The _Enabled property already has the relevant information.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 3c81de5851)
2014-09-16 22:13:45 +01:00
Ilia Mirkin
0c1f24b46c nouveau: only enable the depth test if there actually is a depth buffer
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 79959e5de5)
2014-09-16 22:13:00 +01:00
Maarten Lankhorst
a4d4ab929e nouveau: remove unneeded assert
No idea why it was added, but the code runs fine even on videos
where it triggers.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 8ab85bfcd5)
2014-09-16 22:08:48 +01:00
Maarten Lankhorst
2b43d48509 nouveau: rework reference frame handling
Fixes a regression from "nouveau/vdec: small fixes to h264 handling"

New picking order for frames:
 1. Vidbuf pointer matches.
 2. Take the first kicked ref.
 3. If that fails, take a ref that has a different last_used.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a41aad8431)
2014-09-16 22:08:27 +01:00
Maarten Lankhorst
62f56a08af nouveau: fix MPEG4 hw decoding
Reorder some fields to make I-frame decoding work correctly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 121ceb38f4)
2014-09-16 22:07:58 +01:00
Maarten Lankhorst
a3c52ce0b4 nouveau: re-allocate bo's on overflow
The BSP bo might be too small to contain all of the bsp data,
bump its size on overflow. Also bump inter_bo when this happens,
it might be too small otherwise.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f6afed7076)
2014-09-16 22:07:23 +01:00
Ian Romanick
6c562f3d1a i965/vec4: Only examine virtual_grf_end for GRF sources
If the source is not a GRF, it could have a register >= virtual_grf_count.
Accessing virtual_grf_end with such a register would lead to
out-of-bounds access.  Make sure the source is a GRF before accessing
virtual_grf_end.

Fixes Valgrind complaints while compiling some shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 7aeb853c90)
2014-09-16 22:06:03 +01:00
Iago Toral Quiroga
6240628e05 i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams.
So far we have been using CL_INVOCATION_COUNT to resolve this query but this
is no good with streams, as only stream 0 reaches the clipping stage.

From ARB_transform_feedback3:

"When a generated primitive query for a vertex stream is active, the
 primitives-generated count is incremented every time a primitive emitted to
 that stream reaches the Discarding Rasterization stage (see Section 3.x)
 right before rasterization. This counter is incremented whether or not
 transform feedback is active."

Unfortunately, we don't have any registers that provide the number of primitives
written to a specific stream other than the ones that track the number of
primitives written to transform feedback in the SOL stage, so we can't
implement this exactly as specified.

In the past we implemented this feature by activating the SOL unit even if
transform feeback was disabled, but making it so that all buffers were
disabled and it only recorded statistics, which gave us the right semantics
(see 3178d2474a). Unfortunately, this came with
a significant performance impact and had to be reverted.

This new take does not intend to implement the exact semantics required by
the spec, but improves what we have now, since now we return the primitive
count for stream 0 in all cases. With this patch we use
GEN7_SO_PRIM_STORAGE_NEEDED to resolve GL_PRIMITIVES_GENERATED queries
for non-zero streams. This would return the number of primitives written
to transform feedback for each stream instead. Since non-zero streams are
only useful in combination with transform feedback this should not be too
bad, and the only case that I think we would not be supporting would be
the one in which we want to use both GL_PRIMITIVES_GENERATED and
GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN on the same non-zero stream to
detect buffer overflow.

This patch also fixes the following piglit test:
arb_gpu_shader5-xfb-streams-without-invocations

This test uses both GL_PRIMITIVES_GENERATED and
GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries on non-zero streams, but it
does never hit the overflow case, so both queries are always expected to return
the same value.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f976b4c1bf)
Nominated-by: Kenneth Graunke <kenneth@whitecape.org>
2014-09-16 22:01:53 +01:00
Kenneth Graunke
0f4dc09807 glsl: Speed up constant folding for swizzles.
ir_rvalue::constant_expression_value() recursively walks down an IR
tree, attempting to reduce it to a single constant value.  This is
useful when you want to know whether a variable has a constant
expression value at all, and if so, what it is.

The constant folding optimization pass attempts to replace rvalues with
their constant expression value from the bottom up.  That way, we can
optimize subexpressions, and ideally stop as soon as we find a
non-constant subexpression.

In order to obtain the actual value of an expression, the optimization
pass calls constant_expression_value().  But it should only do so if it
knows the value can be combined into a constant.  Otherwise, at each
step of walking back up the tree, it will walk down the tree again, only
to discover what it already knew: it isn't constant.

We properly avoided this call for ir_expression nodes, but not for
ir_swizzle nodes.  This patch fixes that, drastically reducing compile
times on certain shaders where tree grafting has given us huge
expression trees.  It also fixes SuperTuxKart.

Thanks to Iago and Mike for help in tracking this down.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78468
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 84a40ce86b)
2014-09-12 16:51:52 -07:00
Kenneth Graunke
eeba3c94b1 i965/vec4: Make type_size() return 0 for samplers.
The FS backend has always used 0, and the VS backend has always used 1.
I think 1 is just working around other problems, and is incorrect.
Samplers are baked in; nothing uses the UNIFORM register we would
create, and we shouldn't upload any constant values for them.

Fixes ES3-CTS.shaders.struct.uniform.sampler_array_vertex.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7865026c04)
2014-09-12 16:51:52 -07:00
Kenneth Graunke
0eeec2871d i965: Skip allocating UNIFORM file storage for uniforms of size 0.
Samplers take up zero slots and therefore don't exist in the params
array, nor are they included in stage_prog_data->nr_params.  There's no
need to store their size in param_size, as it's only used for dealing
with arrays of "real" uniforms (ones uploaded as shader constants).

We run into all kinds of problems trying to refer to the uniform storage
for variables that don't have uniform storage.  For one, we may use some
other variable's index, or access out of bounds in arrays.  In the FS
backend, our extra 2 * MaxSamplerImageUnits params for texture rectangle
rescaling paper over a lot of problems.  In the VS backend, we claim
samplers take up a slot, which also papers over problems.

Instead, just skip allocating storage for variables that don't have any.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2408f166db)
2014-09-12 16:51:52 -07:00
Kenneth Graunke
8f1ccf3577 i965: Disable guardband clipping in the smaller-than-viewport case.
Apparently guardband clipping doesn't work like we thought: objects
entirely outside fthe guardband are trivially rejected, regardless of
their relation to the viewport.  Normally, the guardband is larger than
the viewport, so this is not a problem.  However, when the viewport is
larger than the guardband, this means that we would discard primitives
which were wholly outside of the guardband, but still visible.

We always program the guardband to 8K x 8K to enforce the restriction
that the screenspace bounding box of a single triangle must be no more
than 8K x 8K.  So, if the viewport is larger than that, we need to
disable guardband clipping.

Fixes ES3 conformance tests:
- framebuffer_blit_functionality_negative_height_blit
- framebuffer_blit_functionality_negative_width_blit
- framebuffer_blit_functionality_negative_dimensions_blit
- framebuffer_blit_functionality_magnifying_blit
- framebuffer_blit_functionality_multisampled_to_singlesampled_blit

v2: Mention the acronym expansion for TA/TR/MC in the comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit 0bac2551e4)
2014-09-12 16:51:52 -07:00
Kenneth Graunke
8e05b2bfae i965: Separate gl_InstanceID and gl_VertexID uploading.
We always uploaded them together, mostly out of laziness - both required
an additional vertex element.  However, gl_VertexID now also requires an
additional vertex buffer for storing gl_BaseVertex; for non-indirect
draws this also means uploading (a small amount of) data.  This is extra
overhead we don't need if the shader only uses gl_InstanceID.

In particular, our clear shaders currently use gl_InstanceID for doing
layered clears, but don't need gl_VertexID.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 6b6145204d)
2014-09-12 16:51:51 -07:00
Kenneth Graunke
997f634c33 i965: Fix reference counting in new basevertex upload code.
In the non-indirect draw case, we call intel_upload_data to upload
gl_BaseVertex.  It makes brw->draw.draw_params_bo point to the upload
buffer, and increments the upload BO reference count.

So, we need to unreference it when making brw->draw.draw_params_bo point
at something else, or else we'll retain a reference to stale upload
buffers and hold on to them forever.

This also means that the indirect case should increment the reference
count on the indirect draw buffer when making brw->draw.draw_params_bo
point at it.  That way, both paths increment the reference count, so
we can safely unreference it every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e980fe6071)
2014-09-12 16:51:51 -07:00
Ian Romanick
a58ae20536 i965: Request lowering gl_VertexID
Fixes the (new) piglit tests gles-3.0-drawarrays-vertexid,
gl-3.0-multidrawarrays-vertexid, and gl-3.2-basevertex-vertexid.

Fixes gles3conform failure in:

ES3-CTS.gtf.GL3Tests.transform_feedback.transform_feedback_vertex_id

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80247
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 927f5db461)
2014-09-12 16:51:51 -07:00
Kenneth Graunke
80f93d6937 i965: Expose gl_BaseVertex via a vertex attribute.
Now that we have the data available, we need to expose it to the
shaders.  We can reuse the same vertex element that we use for
gl_VertexID, but we need to back it by an actual vertex buffer.

A hardware restriction requires that vertex attributes coming from a
buffer (STORE_SRC) must come before any other types (i.e. STORE_0).
So, we have to make gl_BaseVertex be the .x component of the vertex
attribute.  This means moving gl_VertexID to a different component.

I chose to move gl_VertexID and gl_InstanceID to the .z and .w
components, respectively, to make room for gl_BaseInstance in the .y
component (which would also come from a buffer, and therefore be
STORE_SRC).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fbb353bc13)
2014-09-12 16:51:51 -07:00
Kenneth Graunke
860af662fa i965: Refactor Gen4-7 VERTEX_BUFFER_STATE emission into a helper.
We'll need to emit another VERTEX_BUFFER_STATE for gl_BaseVertex;
pulling this into a helper function will save us from having to deal
with cross-generation differences in that code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 87b10c4a71)
2014-09-12 16:51:51 -07:00
Kenneth Graunke
10aee701ae i965: Make gl_BaseVertex available in a buffer object.
This will be used for GL_ARB_shader_draw_parameters, as well as fixing
gl_VertexID, which is supposed to include gl_BaseVertex's value.

For indirect draws, we simply point at the indirect buffer; for normal
draws, we upload the value via the upload buffer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fdbabf22e1)
2014-09-12 16:51:51 -07:00
Kenneth Graunke
afe5db3293 i965: Calculate start/base_vertex_location after preparing vertices.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit c89306983c)
2014-09-12 16:51:51 -07:00
Ian Romanick
d9df31cc6e i965: Handle SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 9975792abd)
2014-09-12 16:51:51 -07:00
Kenneth Graunke
f009cb080e mesa: Fix glGetActiveAttribute for gl_VertexID when lowered.
The lower_vertex_id pass converts uses of the gl_VertexID system value
to the gl_BaseVertex and gl_VertexIDMESA system values.  Since
gl_VertexID is no longer accessed, it would not be considered active.

Of course, it should be, since the shader uses gl_VertexID.

v2: Move the var->name dereference past the var != NULL check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 26e949b26e)
2014-09-12 16:51:50 -07:00
Kenneth Graunke
09a763bea5 mesa: Replace string comparisons with SYSTEM_VALUE enum checks.
This is more efficient.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 26c9514155)
2014-09-12 16:51:50 -07:00
Ian Romanick
9c5ffa7f7a glsl: Add a lowering pass for gl_VertexID
Converts gl_VertexID to (gl_VertexIDMESA + gl_BaseVertex). gl_VertexIDMESA
is backed by SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, and gl_BaseVertex is backed
by SYSTEM_VALUE_BASE_VERTEX.

v2: Put the enum in struct gl_constants and propoerly resolve the scope
in C++ code.  Fix suggested by Marek.

v3: Reabase on Matt's foreach_in_list changes (was using foreach_list).

v4 (Ken): Use a systemvalue instead of a uniform because
STATE_BASE_VERTEX has been removed.

v5: Use a boolean to select lowering, and only allow one lowering
method.  Suggested by Ken.

v6 (Ken): Replace strcmp against literal "gl_BaseVertex"/"gl_VertexID"
with SYSTEM_VALUE enum checks, for efficiency.

v7: Rebase on context constant initialization work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ec08b5e768)
2014-09-12 16:51:50 -07:00
Ian Romanick
31414ada14 glsl/linker: Make get_main_function_signature public
The next patch will use this function in a different file.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 04d3323d4b)
2014-09-12 16:51:50 -07:00
Ian Romanick
002c284fb4 mesa: Add SYSTEM_VALUE_BASE_VERTEX
This system value represents the basevertex value passed to
glDrawElementsBaseVertex and related functions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 1e87fbd78f)
2014-09-12 16:51:50 -07:00
Ian Romanick
73192345c3 mesa: Add SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
There exists hardware, such as i965, that does not implement the OpenGL
semantic for gl_VertexID.  Instead, that hardware does not include the
value of basevertex in the gl_VertexID value.
SYSTEM_VALUE_VERTEX_ID_ZERO_BASE is the system value that represents
this semantic.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 5964a4f344)
2014-09-12 16:46:28 -07:00
Ian Romanick
6bc4331c8e mesa: Document SYSTEM_VALUE_VERTEX_ID and SYSTEM_VALUE_INSTANCE_ID
v2: Additions to the documentation for SYSTEM_VALUE_VERTEX_ID.  Quote
the GL_ARB_shader_draw_parameters spec and mention DirectX SV_VertexID.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 9afb5ae8ca)
2014-09-12 16:46:25 -07:00
Matt Turner
72d8ebb7fb i965/vec4: Reswizzle sources when necessary.
Despite the comment above the function claiming otherwise, the function
did not reswizzle sources, which would lead to bad code generation since
commit 04895f5c, which began claiming we could do such swizzling when we
could not.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82932
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 1ee1d8ab46)
2014-09-10 10:58:46 -07:00
Jonathan Gray
9f67c26d1b configure.ac: strip _GNU_SOURCE from llvm-config output
Mesa already defines _GNU_SOURCE for glibc based systems and defining
_GNU_SOURCE will break the Mesa build on other systems such as OpenBSD.

_GNU_SOURCE only seems to be included in llvm-config output when
LLVM is built via autoconf and not when it is built by cmake.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
(cherry picked from commit c68073e65f)
2014-09-09 21:39:00 +01:00
Emil Velikov
07426ad102 configure: enable the gallium loader only when needed
With the gallium megadrivers we've converted most ST to optionally
use either statically linked in or shared pipe-drivers.

The hardcoded switch forgot to conditionally enable the build of the
shared pipe-drivers which resulted in them being constantly build.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Cc: James Ausmus <james.ausmus@intel.com>
Reported-by: James Ausmus <james.ausmus@intel.com>
Tested-by: James Ausmus <james.ausmus@intel.com>
Bugzilla: https://code.google.com/p/chromium/issues/detail?id=412089
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 44ec468e80)
2014-09-09 21:38:53 +01:00
Emil Velikov
414de21449 configure: bail out if building svga without libdrm
With recent commit we removed the NEED_NONNULL_WINSYS checks when
selecting the hardware (inc svga) winsys. svga has only one winsys
that explicitly requires libdrm (via it's bundled version of
vmwgfx_drm.h) but configure.ac never really checks for it.

Add the check early to prevent people from shooting themselves when
they select the driver but lack libdrm.

$ ./autogen.sh --disable-dri --disable-egl --disable-gallium-llvm
--with-dri-drivers=swrast --with-gallium-drivers=svga,swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82539
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 40bb6f9313)
2014-09-09 21:38:47 +01:00
Ilia Mirkin
31adc40680 nv50/ir: avoid array overrun when checking for supported mods
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 874a9396c5)
2014-09-09 21:38:40 +01:00
Kenneth Graunke
a318e2f383 i965: Handle ir_binop_ubo_load in boolean expression code.
UBO loads can be boolean-valued expressions, too, so we need to handle
them in emit_bool_to_cond_code() and emit_if_gen6().

However, unlike most expressions, it doesn't make sense to evaluate
their operands, then do something with the results.  We just want to
evaluate the UBO load as a whole---which performs the read from
memory---then load the boolean result into the flag register.

Instead of adding code to handle it, we can simply bypass the
ir_expression handling, and fall through to the default code, which will
do exactly that.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83468
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit a20cc2796f)
2014-09-09 21:38:33 +01:00
Kenneth Graunke
3a49ccc134 i965: Handle ir_triop_csel in emit_if_gen6().
ir_triop_csel can return a boolean expression, so we need to handle it
here; we simply forgot when we added ir_triop_csel, and forgot again
when adding it to emit_bool_to_cond_code.

Fixes Piglit's EXT_shader_integer_mix/{vs,fs}-mix-if-bool on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 6272e60ca3)
2014-09-09 21:38:07 +01:00
Ulrich Weigand
b148cd6586 gallivm: Fix Altivec pack intrinsics for little-endian
This patch fixes use of Altivec pack intrinsics on little-endian PowerPC
systems.  Since little-endian operation only affects the load and store
instructions, the semantics of pack (and other) instructions that take
two input vectors implicitly change: the pack instructions still fill
a register placing values from the first operand into the "high" parts
of the register, and values from the second operand into the "low" parts
of the register, but since vector loads and stores perform an endian swap,
the high parts end up at high memory addresses.

To still achieve the desired effect, we have to swap the two inputs to
the pack instruction on little-endian systems.  This is done automatically
by the back-end for instructions generated by LLVM, but needs to be done
manually when emitting intrisincs (which still result in that instruction
being emitted directly).

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
(cherry picked from commit 0feb977bbf)
Nominated-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-09-08 17:14:44 +01:00
Christian König
7fb0fed989 mesa/st: don't advertise NV_vdpau_interop if it doesn't work.
As long as we don't have a workaround for frame based
decoding in VDPAU we should not advertise NV_vdpau_interop.

v2: fix commit message, check if get_video_param is present

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 12fb74fe89)
2014-09-08 17:05:44 +01:00
Kristian Høgsberg
8e551f4220 i965: Adjust fast-clear resolve rect for BDW
The scale factors for the resolve rectangle change for BDW and we have
to look at brw->gen now to figure out how big it should be.

Fixes: https://bugs.freedesktop.org/attachment.cgi?id=105777
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 2d6d3461d3)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83046
2014-09-08 17:05:26 +01:00
Christoph Bumiller
bb06f2cd93 nvc0/ir: clarify recursion fix to finding first tex uses
This is a simple shader for reproducing the case mentioned:

FRAG
DCL IN[0], GENERIC[0], PERSPECTIVE
DCL OUT[0], COLOR
DCL SAMP[0]
DCL CONST[0]
DCL TEMP[0..1], LOCAL
IMM[0] FLT32 {    0.0000,    -1.0000,     1.0000,     0.0000}
  0: MOV TEMP[0].x, CONST[0].wwww
  1: MOV TEMP[1].x, CONST[0].wwww
  2: BGNLOOP
  3:   IF TEMP[0].xxxx
  4:     BRK
  5:   ENDIF
  6:   ADD TEMP[0].x, TEMP[0], IMM[0].zzzz
  7:   IF CONST[0].xxxx
  8:     TEX TEMP[1].x, CONST[0], SAMP[0], 2D
  9:   ENDIF
 10:   IF CONST[0].zzzz
 11:     MOV TEMP[1].x, CONST[0].zzzz
 12:   ENDIF
 13: ENDLOOP
 14: MOV OUT[0], TEMP[1].xxxx
 15: END

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit ca9ab05d45)
2014-09-08 17:03:21 +01:00
Christoph Bumiller
d3745890c6 nv50/ir/util: fix BitSet issues
BitSet::allocate() is being used with the expectation that it would
leave the bitfield untouched if its size hasn't changed, however,
the function always zeroed the last word, which led to obscure bugs
with live set computation.

This also fixes BitSet::resize(), which was broken, but luckily not
being used.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit b9f9e3ce03)
2014-09-08 17:03:16 +01:00
Jason Ekstrand
7a2018b968 i965/blorp: Pass image formats seperately from the miptree
When a texture is wrapped in a texture view, we can't trust the format in
the miptree itself.  This patch allows us to pass the format seperately
through blorp so we can proprerly handled wrapped textures.

It's worth noting here that we can use the miptree format directly for
depth/stencil formats because they cannot be reinterpreted by a texture
view.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
CC: "10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit 7599886b26)
2014-09-08 17:00:54 +01:00
Emil Velikov
4e1ca4a190 Increment version to 10.3.0-rc3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-05 17:00:40 +01:00
Marek Olšák
06f1f1ea81 st/mesa: use 1.0f as boolean true on drivers without integer support
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82882

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 1a00f24751)
2014-09-05 16:32:48 +01:00
Marek Olšák
e842a02df3 mesa: set UniformBooleanTrue = 1.0f by default
because NativeIntegers is 0 by default.

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

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit d67db73458)
2014-09-05 16:31:58 +01:00
Rob Clark
96bca3617c freedreno/ir3: fix potential null ptr deref
Fix potential segfault in debug code.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit c06afcede2)
2014-09-05 16:28:51 +01:00
Rob Clark
c221e96a13 freedreno/a2xx: fix segfault
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 306e421887)
2014-09-05 16:28:20 +01:00
Rob Clark
640ddefd96 freedreno/a3xx: handle first/last level properly
Fixes some assumptions about first_level being zero.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit bd3b096467)
2014-09-05 16:28:04 +01:00
Rob Clark
7cd0fa023e freedreno: implement pipe_flush_resource()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit b40a6c2b17)
2014-09-05 16:27:55 +01:00
Rob Clark
cd94c64421 freedreno: don't ignore src/dst level
Don't ignore src/dst_level in pipe_copy_region.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 478a08ebd2)
2014-09-05 16:06:36 +01:00
Jonathan Gray
e9923b2194 automake: check if the linker supports --dynamic-list
As older versions of gnu ld did not support --dynamic-list check to see
if it is supported before using it.  Non gnu linkers such the apple one
likely lack this option as well.

Fixes the build on OpenBSD which has binutils 2.15 and 2.17.
The --dynamic-list option seems to been have introduced sometime after
binutils 2.17 was released as it is present in 2.18.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 635477dc4b)
2014-09-05 15:45:46 +01:00
Andreas Pokorny
2e56334a2a kms-swrast: Support Prime fd handling
Allows using prime fds as display target and from display target.
Test for PRIME capability after initializing kms_swrast screen.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
(cherry picked from commit 8bcd57a46c)
2014-09-05 15:45:46 +01:00
Marek Olšák
ead7f72a2c r600g,radeonsi: make sure there's enough CS space before resuming queries
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83432

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 3dbf55c1be)
2014-09-05 15:45:45 +01:00
Marek Olšák
139d176f54 mesa: invalidate draw state in glPopClientAttrib
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82538

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 374f3e9e19)
2014-09-05 15:45:45 +01:00
Thomas Hellstrom
941b2ae35f winsys/svga: Fix incorrect type usage in IOCTL v2
While similar in layout, the size of the SVGA3dSize type may be smaller than
the struct drm_vmw_size type that is part of the ioctl interface. The kernel
driver could accordingly overwrite a memory area following the size variable
on the stack. Typically that would be another local variable, causing
breakage in, for example, ubuntu 12.04.5 where the handle local variable
becomes overwritten.

v2: Fix whitespace errors

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cc: "10.1 10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2d6206140a)
2014-09-05 15:45:45 +01:00
Kenneth Graunke
4b38838ef4 i965: Handle ir_triop_csel in emit_bool_to_cond_code().
ir_triop_csel can return a boolean expression, so we need to handle it
here; we simply forgot when we added it.

Fixes Piglit's EXT_shader_integer_mix/{vs,fs}-mix-if-bool.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8270b048cf)
2014-09-05 15:43:08 +01:00
tiffany
3fdd08c9b4 glsl: fix assertion which fails for unsigned array indices.
According to the GLSL 1.40 spec, section 5.7 Structure and Array Operations:

"Array elements are accessed using an expression whose type is int or uint."

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cfc42db592)
2014-09-05 14:44:22 +01:00
Jason Ekstrand
f8ff31e528 i965/copy_image: Divide the x offsets by block width when using the blitter
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 11ee9a4d99)
2014-09-05 14:43:53 +01:00
Jason Ekstrand
ab53a29892 i965/copy_image: Use the correct block dimension
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 499acf6e4a)
2014-09-05 14:42:56 +01:00
Jason Ekstrand
4073e96a3b meta/copy_image: Use the correct texture level when creating views
Previously, we were accidentally assuming that the level of both textures
was 0.  Now we actually use the correct level in our hacked texture view.
This doesn't 100% fix the meta path because the texture type is getting
lost somewhere in the pipeline.  However, it actually copies to/from the
correct layer now.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b608cd7fbf)
2014-09-05 14:42:36 +01:00
Jason Ekstrand
4eed41b967 i965/copy_image: Use the correct texture level
Previously, we were using the source images level for both source and
destination.  Also, we weren't taking the MinLevel from a potential texture
view into account.  This commit fixes both problems.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit fcb6d5b9ef)
2014-09-05 14:41:47 +01:00
Marek Olšák
c546523b4d r600g: fix alpha-test with HyperZ enabled, fixing L4D2 tree corruption
*_update_db_shader_control depends on the alpha test state. The problem was
it was in a block which is only entered if the pixel shader is changed.

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

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Benjamin Bellec <b.bellec@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 8abdc3c4a9)
2014-09-05 14:40:45 +01:00
Kristian Høgsberg
282a3098e6 meta: Make MESA_META_DRAW_BUFFERS restore properly
A meta begin/end pair with MESA_META_DRAW_BUFFERS will change visible GL
state.  We recreate the draw buffer enums from the buffer bitfield, which
changes GL_BACK to GL_BACK_LEFT (and GL_FRONT to GL_FRONT_LEFT).

This commit modifes the save/restore logic to instead copy the buffer enums
from the gl_framebuffer and then set them on restore using
_mesa_drawbuffers().

It's not clear how this breaks the benchmark in 82796, but fixing meta to not
leak the state change fixes the regression.

No piglit regressions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82796
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8f55174fbd)
2014-09-05 14:36:43 +01:00
Emil Velikov
ec4a333c37 Revert "mesa: fix make tarballs"
This reverts commit 0fbb9a599d.

Rather than adding hacks around the issue drop the sources from the
final tarball, and re-add them back with 'make dist'. This fixes a
problem when running parallel 'make install' fails as it recreates
sources and triggers partial recompilation.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83355
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
(cherry picked from commit 5a4e0f3873)
2014-09-05 14:04:52 +01:00
Dave Airlie
35bb6b058c i965: add missing parens in vec4 visitor
coverity reported this, Matt said it look like missing parens,
not bad identing, so lets try that.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 94a909ec2d)
2014-09-05 14:04:48 +01:00
Ilia Mirkin
24e226d0f5 nv50: attach the buffer bo to the miptree structures
The current code... makes no sense. Use nouveau_bo_ref to attach the bo
to the exposed resource so as to have the proper lifetime guarantees.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2c44043313)
2014-09-05 14:04:48 +01:00
Ilia Mirkin
39ad62ce51 nv50: mt address may not be the underlying bo's start address
With VP2, nv50_miptree is faked because the underlying bo's have to be
laid out in a certain way. This is done by adjusting the address. Make
sure that blits (and everything else for consistency) use the mt address
rather than the bo address as a base.

This fixes retrieving chroma plane with VDPAU.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82255
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9d52e551a5)
2014-09-05 14:04:48 +01:00
Ilia Mirkin
f2b2309281 nv50: set the miptree address when clearing bo's in vp2 init
The mt address is about to be used more, make sure it's set
appropriately.

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2528d402b9)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
a4b3c4e3ec nv50/ir: avoid creating instructions that can't be emitted
When constant folding a MAD operation, we first fold the multiply and
generate an ADD. However we do so without making sure that the immediate
can be handled in the saturate case. If it can't, load the immediate in
a separate instruction.

Reported-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6c2b079231)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
01dda9d0bd nvc0: don't make 1d staging textures linear
Experimentally, the sampler doesn't appear to like these, neither as
buffer nor as rect textures. So remove 1D from the list of texture types
to make linear when used for staging.

This fixes the OSD in mplayer for VDPAU.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 115d9a5525)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
49cd42aab1 nv50: zero out unbound samplers
Samplers are only defined up to num_samplers, so set all samplers above
nr to NULL so that we don't try to read them again later.

Tested-by: Christian Ruppert <idl0r@qasl.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 362cd26960)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
eaa9e14ce5 nvc0/ir: avoid infinite recursion when finding first uses of tex
In certain circumstances, findFirstUses could end up doubling back on
instructions it had already processed, resulting in an infinite
recursion. Avoid this by keeping track of already-visited instructions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83079
Tested-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c4bb436f76)
2014-09-05 14:04:46 +01:00
Marek Olšák
58be4ab741 r600g: fix layered clear
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d159c5e3e0)
2014-09-05 14:04:46 +01:00
Marek Olšák
447785af9d glsl_to_tgsi: allocate and enlarge arrays for temporaries on demand
This fixes crashes if the number of temporaries is greater than 4096.

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

v2: added fail paths for realloc failures

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 482def592f)
2014-09-05 14:04:46 +01:00
Emil Velikov
390a9f6cb7 Increment version to 10.3.0-rc2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 00:23:50 +01:00
Emil Velikov
0fbb9a599d mesa: fix make tarballs
Current method of generating distribution tar-balls involves manually
invoking make + target name in the appropriate places. This temporary
solution is used until we get 'make dist' working.

Currently it does not work, as in order to have the target (which is
also a filename) available in the final Makefile we need to add a PHONY
target + use the correct target name.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 88cbe3908f)
2014-09-01 00:23:45 +01:00
Matt Turner
2310a4b4cf i965/vec4: Update register coalescing test.
In commit 04895f5c I added support for reswizzling writemasks. This test
was checking that we didn't support this.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82881
(cherry picked from commit 8b5ac1df17)
2014-08-31 19:12:42 +01:00
Kenneth Graunke
8ef3d4fe03 i965: Add 2x MSAA support to Broadwell fast clear code.
According to the cited documentation section (but in the newer docs),
x_scaledown is the same for 2x and 4x MSAA.

+47 piglits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83081
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e34a363a78)
2014-08-31 19:07:04 +01:00
Christian König
0c67167370 radeon/uvd: fix field handling on R6XX style UVD
The first UVD generation can only do frame based output.

Signed-off-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 80771e47b6)
Nominated-by: Alex Deucher <alexdeucher@gmail.com>
2014-08-28 23:01:44 +01:00
Christian König
60f136eed9 vl/compositor: set the scissor before clearing the render target
Otherwise we clear areas that shouldn't be cleared.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 03a99ba9e4)
2014-08-26 21:04:00 +01:00
Christian König
d2fb1da46d st/vdpau: fix vlVdpOutputSurfaceRender(Output|Bitmap)Surface
Correctly handle that the source_surface is only optional.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit b73c20759f)
2014-08-26 21:03:47 +01:00
Carl Worth
627d31dc36 glcpp: Don't use alternation in the lookahead for empty pragmas.
We've found that there's a buffer overrun bug in flex that's triggered by
using alternation in a lookahead pattern.

Fortunately, we don't need to match the exact {NEWLINE} expression to
detect an empty pragma. It suffices to verify that there are no non-space
characters before any newline character. So we can use a simple [\r\n] to
get the desired behavior while avoiding the flex bug.

Fixes the regression of piglit's 17000-consecutive-chars-identifier test,
(which has been crashing since commit
04e40fd337 ).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82472
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

CC: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 23163df24c)
2014-08-25 22:32:10 +01:00
Carl Worth
e4f54d8b47 Makefile: Switch from md5sums to sha256sums
We switched to these several stable releases ago, (since the MD5 algorithm has
been broken for some time), but only now did I get around to fixing this in
the Makefile rather than just performing this step manually.

CC: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 46d03d37bf)
2014-08-25 22:31:44 +01:00
Alex Deucher
2edc941e75 radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 153df68834)
2014-08-25 22:31:19 +01:00
Alex Deucher
eb96819386 radeonsi: add new CIK pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit f50b6b4895)
2014-08-25 22:31:04 +01:00
Kenneth Graunke
f2a1b7d508 i965: Disable try_emit_b2f_of_compare on Gen4-6.
The optimization relies on CMP setting the destination to 0, which is
equivalent to 0.0f.  However, early platforms only set the least
significant byte, leaving the other bits undefined.  So, we must disable
the optimization on those platforms.

Oddly, Sandybridge wasn't reported as broken.  The PRM states that it
only sets the LSB, but the internal documentation says that it follows
the IVB behavior.  Since it wasn't reported as broken, we believe it
really does follow the IVB behavior.

v2: Allow the optimization on Sandybridge (requested by Matt).

+32 piglits on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?=79963
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 97d03b9366)
2014-08-22 11:43:25 -07:00
Matt Turner
53728f60aa i965: Fix JIP/UIP calculations.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82846
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82929
(cherry picked from commit d77f5603a5)
2014-08-22 09:31:22 -07:00
Carl Worth
04c3c03682 Increment version to 10.3.0-rc1 2014-08-21 08:36:46 -07:00
Glenn Kennard
0fb221065e r600g: Fix flat/smooth shade state toggle
If only the flat/smooth shade state changed between
two render calls the prior code would miss updating the
hardware state.

Also add check for sprite coord, potentially same type
of issue otherwise for it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81967
Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-21 16:20:38 +02:00
Tom Stellard
bf7a60f41d r600g/compute: Don't initialize vertex_buffer_state masks to 0x2
cs_vertex_buffer_state.enabled_mask and
cs_vertex_buffer_state.dirty_mask are both updated when
r600_set_constant_buffer() is called, so we don't need to manually
update these values.

This fixes a crash with OpenCL programs that have a kernel with no
arguments.

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

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-21 06:12:12 -07:00
Tom Stellard
a9f0b08bac r600g/compute: Use the first parameter in evergreen_set_global_binding() 2014-08-21 06:12:12 -07:00
Tom Stellard
43d954342e pipe-loader: Fix memory leak v2
v2:
  - Change driver_name to char*

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-21 06:12:12 -07:00
Tom Stellard
8109664ded radeon: Add work-around for missing Hainan support in clang < 3.6 v2
v2:
  - Add missing break.

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

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-21 06:12:11 -07:00
Michel Dänzer
3ba225c1ab st/clover: Fix build against LLVM SVN >= r215967 v2
v2: Tom Stellard
  - Properly destroy the Module

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-21 07:55:23 -04:00
Kenneth Graunke
d682ebec0b i965,meta: Stop unlocking the texture to try and prevent deadlocks.
Unlocking the texture is not safe: another thread could come in and grab
it.  Now that we use a recursive mutex, this should work.  This also fixes
texture lock deadlocks in the new meta fast clear path.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-20 17:31:19 -07:00
Kenneth Graunke
0871028188 mesa: Use a recursive mutex for the texture lock.
This avoids problems with things like meta operations calling functions
that want to take the lock while the lock is already held.  Basically,
the point is to guard against API reentrancy across threads...not to
guard against ourselves.

Dave Airlie opposed this change, but it makes master usable again and no
one proposed a better solution.  We can revert this if/when someone
does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-20 17:31:19 -07:00
Carl Worth
f90b7e0f2b glcpp: Fix glcpp-test-cr-lf "make check" test for Mac OS X
There were two problems with the way this script used sed on OS X:

  1. The OS X sed doesn't interpret "\r" in a replacement list as a
     carriage-return character, (instead it was inserting a literal
     'r' character).

     We fix this by putting an actual ^M character into the source of
     the script, (rather than a two-character escape sequence hoping
     for sed to do the right thing).

  2. When generating the test files with LF-CR ("\n\r") newlines, the
     OS X sed was adding an undesired final newline ("\n") at the end
     of the file. We avoid this by first using sed to add the ^M
     before the newlines, then using tr to swap the \r and \n
     characters. This way, sed never sees any lines ending with
     anything but \n, so it doesn't get confused and doesn't add any
     bogus extra newlines.

Tested-by: Vinson Lee <vlee@freedesktop.org>

Vinson's testing confirmed that this patch fixes FreeBSD as well.
2014-08-20 16:42:46 -07:00
Carl Worth
c09a8b0e3b glcpp: Use printf instead of "echo -n" in glcpp-test
I noticed that with /bin/sh on Mac OS X, "echo -n" does not work as
desired, (it actually prints "-n" rather than suppressing the final
newline). There is a /bin/echo that could be used (it actually works)
instead of the builtin echo.

But I decided it's more robust to just use printf rather than
hardcoding /bin/echo into the script.
2014-08-20 16:41:38 -07:00
Matt Turner
04895f5c60 i965/vec4: Allow reswizzling writemasks when swizzle is single-valued.
total instructions in shared programs: 4288033 -> 4266151 (-0.51%)
instructions in affected programs:     930915 -> 909033 (-2.35%)
2014-08-20 13:01:18 -07:00
Jon TURNEY
bde2a62af7 Teach os_get_total_physical_memory about Cygwin
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-20 17:18:39 +01:00
Michel Dänzer
cd765cf7ee r300g: Fix path to test programs for out-of-tree builds
Fixes make check in that case.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-08-20 16:12:51 +09:00
Vinson Lee
c04a6d5c29 gallivm: Fix build with LLVM >= 3.6 r215967.
This LLVM 3.6 commit changed EngineBuilder constructor.

commit 3f4ed32b4398eaf4fe0080d8001ba01e6c2f43c8
Author: Rafael Espindola <rafael.espindola@gmail.com>
Date:   Tue Aug 19 04:04:25 2014 +0000

    Make it explicit that ExecutionEngine takes ownership of the modules.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-20 15:24:44 +09:00
Timothy Arceri
a1853eaea7 glsl: Use the without_array predicate in some more places
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-08-19 17:44:06 -07:00
Kristian Høgsberg
e6a53533b7 i965: Flush the RC and TC before doing a fast clear resolve
The docs say "When performing a render target resolve, PIPE_CONTROL with end
of pipe sync must be delivered.", which doesn't actually tell us whether we
need to do it before or after.  Blorp did it before and after, and doing it
before certainly makes sense.  The resolve operation needs to read from the
MCS and if we don't flush the render cache it won't get up-to-date data.

On the other hand, doing it after should not be necessary, since we call
brw_render_cache_set_check_flush() after the resolve.

Fixes rendering corruption in kwin's cover switch effect and various steam
games.

Missing flush spotted by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-19 17:21:39 -07:00
Carl Worth
8791cfedde docs: Import 10.2.6 release notes, add news item. 2014-08-19 15:21:09 -07:00
Chris Forbes
1c4f141a54 docs: Mark off ARB_conditional_render_inverted for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-20 07:49:17 +12:00
Chris Forbes
06ca96daad i965: Enable ARB_conditional_render_inverted on Gen6+.
The extension requires GL 3.0, so enable on just the generations
exposing that.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-20 07:49:17 +12:00
Chris Forbes
3f8ad32627 mesa: Add support for inverted s/w conditional rendering
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-20 07:49:17 +12:00
Matt Turner
9a071e3339 i965/vec4: Add a pass to reduce swizzles.
total instructions in shared programs: 4344280 -> 4288033 (-1.29%)
instructions in affected programs:     397468 -> 341221 (-14.15%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-19 12:37:11 -07:00
Eric Anholt
5833680e7a vc4: Plumb the texture index from TGSI through to the sampler uniforms.
This commit and the last one fix ARB_fragment_program/sparse-samplers and
6 other tests.
2014-08-19 08:47:13 -07:00
Eric Anholt
c8097afe29 vc4: Avoid a null-deref if a sampler index isn't used.
Part of fixing ARB_fragment_program/sparse-samplers
2014-08-19 08:47:13 -07:00
Brian Paul
31ce84a81f mesa: fix NULL pointer deref bug in _mesa_drawbuffers()
This is a follow-on fix to commit 39b40ad144.  Fixes a crash if the
user calls glDrawBuffers(0, NULL).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82814
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 09:29:16 -06:00
Glenn Kennard
dfa10ed264 r600g: Fix missing SET_TEXTURE_OFFSETS
SB needs a bit of special handling to handle
instructions without obvious side effects, to
avoid it deleting them.

Fixes failing non-const ARB_gpu_shader5
textureOffsets piglits with sb enabled.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-19 16:30:13 +02:00
Alexander von Gluck IV
ef1cf69cd3 gallium/target: Add needed mesautil lib to haiku-softpipe
Acked-by: Brian Paul <brianp@vmware.com>
2014-08-19 10:03:05 -04:00
Alexander von Gluck IV
8cbf01f12a gallium/aux: Fill in Haiku get process name code
Acked-by: Brian Paul <brianp@vmware.com>
2014-08-19 10:03:05 -04:00
Alexander von Gluck IV
82c23dd962 haiku/swrast: Add missing src include search path for missing util/macros.h
Acked-by: Brian Paul <brianp@vmware.com>
2014-08-19 10:03:05 -04:00
Tobias Klausmann
eed8b19aac docs: Update status of ARB_conditional_render_inverted
Done for: nvc0, softpipe and llvmpipe

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
544c54114a llvmpipe/softpipe: enable ARB_conditional_render_inverted
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
a2fc85f5d0 nvc0: Handle ARB_conditional_render_inverted and enable it
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
7a48858fcb mesa/st: Support ARB_conditional_render_inverted modes
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 09:02:29 -04:00
Tobias Klausmann
fd5edee700 gallium: Add and handle PIPE_CAP_CONDITIONAL_RENDER_INVERTED
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 08:54:35 -04:00
Tobias Klausmann
64cc1876fa mesa: add ARB_conditional_render_inverted flags
Also add an extension bit so we can safely enable

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 08:54:35 -04:00
Tobias Klausmann
1a51751e93 glapi: add GL_ARB_conditional_render_inverted
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-19 08:54:35 -04:00
Chia-I Wu
58511b62c4 ilo: fix PIPE_CAP_VIDEO_MEMORY
I changed Emil's patch in f921131a5c to report
raw values in the winsys, but forgot to convert the values to megabytes in the
pipe driver.
2014-08-19 19:56:07 +08:00
Chia-I Wu
17401896dd ilo: enable HiZ in more cases on GEN6
With layer offsetting killed, we no longer need to restrict HiZ to
non-mipmapped and non-arary depth buffers.
2014-08-19 19:53:37 +08:00
Chia-I Wu
5b4fc5f156 ilo: remove layer offsetting
Follow i965 to kill layer offsetting for GEN6.
2014-08-19 19:53:37 +08:00
Chia-I Wu
fb3d506431 ilo: migrate to ilo_layout
Embed an ilo_layout in ilo_texture, and remove now duplicated members.
2014-08-19 19:53:37 +08:00
Chia-I Wu
925359bc78 ilo: add new resource layout code
Based on the old code, the new layout code describes the layout with the new,
well-documented, ilo_layout.  It also gains new features such as MCS support
and extended ARYSPC_LOD0 that i965 comes up with (see
6345a94a9b).
2014-08-19 19:53:37 +08:00
Niels Ole Salscheider
5ae9bdafd4 gallium/radeon: Do not use u_upload_mgr for buffer downloads
Instead create a staging texture with pipe_buffer_create and
PIPE_USAGE_STAGING.

u_upload_mgr sets the usage of its staging buffer to PIPE_USAGE_STREAM.
But since 150ac07b85 CPU -> GPU streaming buffers
are created in VRAM. Therefore the staging texture (in VRAM) does not offer any
performance improvements for buffer downloads.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-19 12:56:04 +02:00
Marek Olšák
498dc676ea r600g: copy IA_MULTI_VGT_PARAM programming from radeonsi for Cayman
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
f62f88274a radeonsi: bump PRIMGROUP_SIZE for some cases
Recommended by hw people.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
4be7ff5567 radeonsi: set PARTIAL_VS_WAVE(0) when appropriate
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
94e474f3c3 radeonsi: set IA_MULTI_VGT_PARAM on SI the same as on CIK (v2)
Nothing's changed for CIK here.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
a333309979 radeonsi: simplify si_num_banks function
This makes it easier to use.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
db51ab6d6a radeonsi: use r600_draw_rectangle from r600g
Rectangles are easier than triangles for the rasterizer.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
7792f9858b radeonsi: save scissor state and sample mask for u_blitter
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
25633c85e1 radeonsi: don't set CB_SHADER_MASK=1 if there are no color outputs
This hack isn't needed anymore because of the previous u_blitter commit.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
a6fcdbf560 gallium/u_blitter: don't use an empty fragment shader if there's a colorbuffer
This is custom code used by some drivers.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
406ab1662c gallium/util: handle PIPE_BUFFER in util_pipe_tex_to_tgsi_tex
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
8db7dacf29 rbug: only add textures to the list
rbug-gui cannot display buffers, so it's pointless to add them.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
ddcbe9c526 rbug: fix a crash in sampler_view_destroy caused by incorrect context
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
ba81a3784b rbug: send the actual number of layers to the client
This sends the correct value for array textures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
90d10f467f rbug: implement streamout context functions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:18 +02:00
Marek Olšák
b7b1ad9c6c rbug: fix crash in set_vertex_buffers
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:17 +02:00
Marek Olšák
4a3f156dd1 rbug: remove contexts from the list properly
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-19 12:20:17 +02:00
Emil Velikov
f921131a5c ilo: fold drm_intel_get_aperture_sizes() within probe_winsys()
... and store the value in intel_winsys_info/ilo_dev_info.

Suggested-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

olv: check for errors and report raw values
2014-08-19 17:45:00 +08:00
Matt Turner
a4359bcaa5 i965/cfg: Add a foreach_block_and_inst_safe macro.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:08:53 -07:00
Matt Turner
26624b85e7 i965/cfg: Add a foreach_inst_in_block_safe macro.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:05:59 -07:00
Matt Turner
c51b0861e4 i965/cfg: Add a foreach_block_safe macro.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:05:59 -07:00
Matt Turner
a3d0ccb037 i965: Pass a cfg pointer to generate_{code,assembly}.
The loop over all instructions is now two-fold, over all of the blocks
and all of the instructions in each block.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 19:05:59 -07:00
Matt Turner
596990d91e i965: Add and use foreach_block macro.
Use this as an opportunity to rename 'block_num' to 'num'. block->num is
clear, and block->block_num has always been redundant.
2014-08-18 18:56:30 -07:00
Matt Turner
d688667c7f i965/cfg: Embed link in bblock_t for main block list.
The next patch adds a foreach_block (block, cfg) macro, which works
better if it provides a direct bblock_t pointer, rather than a
bblock_link pointer that you have to use to find the actual block.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-18 18:56:30 -07:00
Matt Turner
19c6617adf i965/fs: Optimize gl_FrontFacing calculation on Gen4/5.
Doesn't use fewer instructions, but it does avoid writing the flag
register and if we want to switch the representation of true for Gen4/5
in the future, we can just delete the AND instruction.
2014-08-18 18:35:56 -07:00
Matt Turner
d1c43ed487 i965/fs: Optimize gl_FrontFacing calculation on Gen6+.
total instructions in shared programs: 4288650 -> 4282838 (-0.14%)
instructions in affected programs:     595018 -> 589206 (-0.98%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:54 -07:00
Matt Turner
2e51dc838b i965: Use ~0 to represent true on Gen >= 6.
total instructions in shared programs: 4292303 -> 4288650 (-0.09%)
instructions in affected programs:     299670 -> 296017 (-1.22%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:53 -07:00
Matt Turner
cc60a487d1 i965/fs: Optimize emit_bool_to_cond_code for logical exprs.
AND, OR, and XOR can generate the conditional code directly.

total instructions in shared programs: 4293335 -> 4292303 (-0.02%)
instructions in affected programs:     121408 -> 120376 (-0.85%)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:53 -07:00
Matt Turner
2a6b6621d8 i965: Use UniformBooleanTrue value for boolean literal true.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:49 -07:00
Matt Turner
9e2e7c7dc0 glsl: Use UniformBooleanTrue value for uniform initializers.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:48 -07:00
Matt Turner
6df0fd8fe9 mesa: Upload boolean uniforms using UniformBooleanTrue.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:47 -07:00
Matt Turner
e0f955abd3 i965: Remove dead call to _mesa_associate_uniform_storage().
Dead since the call to _mesa_generate_parameters_list_for_uniforms
was removed in commit 12751ef2. So this was why all of that code that
was supposed to fix up the value of a uniform bool to wasn't happening.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-18 18:35:41 -07:00
Matt Turner
e87106d153 mapi: Inline shared-glapi/tests/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:27:20 -07:00
Matt Turner
7172f02d7c mapi: Inline glapi/tests/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:27:16 -07:00
Matt Turner
9dbb0f49b6 mapi: Inline glapi/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:25:52 -07:00
Matt Turner
dff5a219d0 mapi: Inline es2api/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:25:29 -07:00
Matt Turner
18ef5136b6 mapi: Inline es1api/Makefile.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-18 18:25:02 -07:00
Matt Turner
c3ce1a942f mapi: Inline shared-glapi/Makefile. 2014-08-18 18:24:09 -07:00
Matt Turner
4ccd2a9f9b build: Let install-lib-links.mk handle .la files in subdirectories.
The next patches are going to combine some of the mapi subdirectories'
Makefiles into a single Makefile, giving better build parallelism.

lib_LTLIBRARIES will be set to something like

   lib_LTLIBRARIES = shared-glapi/libglapi.la es2api/libGLESv2.la

and the current code in install-lib-links.mk simply prepends .libs/ and
replaces the .la in order to create the filenames that it needs to ln/cp
into the LIBDIR. This doesn't work when the .la file is actually in a
subdirectory.

This patch fixes this and puts .libs/ in the right place.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-18 18:22:40 -07:00
Matt Turner
45eb065668 i965: Enable instruction compaction on Gen8+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
31eed95b22 i965: Add support for compacting 3-src instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
fb1db6753f i965: Add support for compacting 1- and 2-src instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
3904d404a3 i965/gen8: Add 3-src instruction compaction tables.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
190ce6b093 i965/gen8: Add instruction compaction tables.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
2faa1a414c i965: Update JIP/UIP compaction code to operate on bytes.
JIP/UIP were previously in units of compacted instructions. On Gen8
they're in units of bytes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
23ab55cb6c i965: Reverse condition ordering to let us support other gens.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-18 18:18:50 -07:00
Matt Turner
6cc6c3b647 i965/disasm: Add CSEL. 2014-08-18 18:18:50 -07:00
Timothy Arceri
39a920c0cb mesa: fix copy and paste errors in glBindVertexBuffers
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-08-19 10:19:18 +10:00
Tobias Klausmann
9100c359ac nv50/ir: (trivial) initialize pointer to silence warning
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
2014-08-18 19:41:26 -04:00
Eric Anholt
76f687d5a5 vc4: Add support for swizzling of texture colors.
Fixes swapped colors on the copypix demo and some piglit tests like
pbo-teximage-tiling .
2014-08-18 15:27:43 -07:00
Eric Anholt
489350e570 vc4: Fix handling of non-XYZW swizzles in color outputs.
The SWIZZLE_1 of the winsys destination was dereffing off the end of the
array, which surprisingly often worked out (since nobody reads the
rendered value anyway, so whatever junk was referenced in the QIR didn't
matter), but shader dumping would sometimes segfault.
2014-08-18 15:27:43 -07:00
Eric Anholt
37992a4e39 vc4: Extract the swizzle handling from vertex fetch.
I want to reuse this elsewhere, and NONE debug output hasn't been useful
so I don't miss it being as detailed as it was before.
2014-08-18 15:27:43 -07:00
Eric Anholt
c1db622215 vc4: Add support for color masking.
This gets fbo-colormask-formats working for core formats, which increases
my confidence in some of the swizzle and blend handling.
2014-08-18 15:27:43 -07:00
Eric Anholt
50b4293eb3 vc4: Add a helper for QOP_R4_UNPACK_[ABCD]. 2014-08-18 15:27:43 -07:00
Eric Anholt
8795341e2c vc4: Don't forget to set up the offset for render targets.
This almost fixes fbo-generatemipmap rendering, except that the 1x1 level
isn't getting rendered.
2014-08-18 15:27:43 -07:00
Eric Anholt
63fe494877 vc4: Fix multi-level texture setup.
We weren't accounting for the level 0 offset in the texture setup (so it
only worked if it happened to be a single-level texture), and doing so
required that we get the level 0 offset page aligned so that the offset
bits don't get interpreted as the texture format and such.
2014-08-18 15:27:43 -07:00
Eric Anholt
a538bab065 vc4: Fix viewport handling in the uniforms upload.
I had the right viewports in vc4_emit.c, but grabbed the wrong values in
the uniform setup, so primitives would claim to be in the wrong parts of
the screen.  (The vc4_emit.c state looks like it just decides how big the
clipping guardband is).

This gets fbo-viewport closer to working (which still has the problem that
the HW is always guard-band clipping), and fixes inverted FBO rendering in
general.
2014-08-18 15:27:43 -07:00
Marek Olšák
082d8c54c1 docs/relnotes: document GLX_MESA_query_renderer 2014-08-19 00:26:41 +02:00
Francisco Jerez
e9a4e74926 clover: Refuse to build a program if there are kernel objects attached to it.
Fixes piglit cl-api-build-program.

Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-18 09:32:24 +03:00
Francisco Jerez
c6817f19f6 clover/util: Pass initial count value to ref_counter constructor.
And mark the ref_count() method as const.

Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-18 09:32:24 +03:00
Francisco Jerez
37e4d22e95 clover/util: Implement minimalist reference to clover::ref_counter object.
Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-18 09:32:24 +03:00
EdB
ce4d3f3104 clover: clGetProgramInfo support for OpenCL 1.2.
[ Francisco Jerez: Rework using fold() for conciseness. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: EdB <edb+mesa@sigluy.net>
2014-08-17 23:34:11 +03:00
Ilia Mirkin
ef130b6050 nouveau: don't keep stale pointer to free'd data
If ->sys is non-null, we might decide that it's where the data is
stored.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-08-16 17:52:54 -04:00
Ilia Mirkin
1f4bc0c95e egl: don't exit process on initialization failure
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-16 17:52:54 -04:00
Brian Paul
9d9879abed mesa: fix compressed_subtexture_error_check() return value
The function should return GLboolean, not GLenum.
If we detect invalid compressed pixel storage parameters, we should
return GL_TRUE, not GL_FALSE so that the function is no-op'd.
An update to the piglit s3tc-errors test will check this.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-16 06:48:45 -06:00
Brian Paul
cf8b680f40 mesa: move _mesa_compressed_texture_pixel_storage_error_check()
to pixelstore.c, add const qualifier to the 'packing' parameter.
Add comments.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-16 06:48:44 -06:00
Brian Paul
9b4c6da7f0 mesa: minor improvements to _mesa_compute_compressed_pixelstore()
Replace the gl_texture_image parameter with mesa_format since we only
used the image's format.

Add some comments.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-16 06:48:44 -06:00
Brian Paul
1e594d4f5c util: whitespace and formatting fixes in u_math.h
Trivial.
2014-08-16 06:48:44 -06:00
Ilia Mirkin
8867ffbf95 nouveau: make sure to invalidate any vbo state as well
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-08-16 02:33:12 -04:00
Jordan Justen
a1dca7069b i965/gen6: Force ALL_SLICES_AT_EACH_LOD for separate stencil/hiz
For gen6 we will use the ALL_SLICES_AT_EACH_LOD miptree layout for
separate stencil/hiz. This is needed because gen6 hiz and separate
stencil only support a single miplevel. When accessing the other LODs,
we will program a tile aligned offset for the bo.

PRM Volume 1, Part 1, 7.18.3.7.2 For separate stencil buffer [DevILK]
to [DevSNB]:
 "The separate stencil buffer does not support mip mapping, thus the
  storage for LODs other than LOD 0 is not needed."

We still allocate storage for the other stencil mip-levels within a
single texture, but each mip-level will use non-mip-array spacing.

PRM Volume 2, Part 1, 7.5.3 Hierarchical Depth Buffer
 "[DevSNB]: The hierarchical depth buffer does not support the LOD
  field, it is assumed by hardware to be zero. A separate
  hierarachical depth buffer is required for each LOD used, and the
  corresponding buffer’s state delivered to hardware each time a new
  depth buffer state with modified LOD is delivered."

We allocate storage for the other hiz mip-levels within a single
texture, but each mip-level will use non-mip-array spacing.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:42 -07:00
Jordan Justen
31e1beec89 i965/gen6: Stencil/hiz needs an offset for LOD > 0
Since gen6 separate stencil & hiz only supports LOD0, we need to
program an offset to the LOD when emitting the separate stencil/hiz.

v3:
 * Use new array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:42 -07:00
Jordan Justen
b3d68d5a30 i965/gen6: Force tile alignment for each stencil/hiz LOD
Gen6 doesn't support multiple miplevels for hiz and stencil.

Therefore, we must point to the LOD directly during rendering.

But, we also have removed the tile offsets from normal depth surfaces,
so we need to align each LOD to a tile boundary for hiz and stencil.

v3:
 * Use new array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:42 -07:00
Jordan Justen
6345a94a9b i965: Support array_layout == ALL_SLICES_AT_EACH_LOD for multiple LODs
Previously array_layout ALL_SLICES_AT_EACH_LOD was only used for array
spacing lod0 on gen7+ and therefore was only used with a single mip
level.

gen6 separate stencil & hiz only support LOD0, so we need to allocate
the miptree similar to gen7+ array spacing lod0, except we also need
space for multiple mip levels. (Since OpenGL stencil and depth support
multiple LODs.)

The miptree is allocated with tightly packed array slice spacing, but
we still also pack the miplevels into the region similar to a normal
multi mip level packing.

A 2D Array texture with 2 slices and multiple LODs would look somewhat
like this:

+----------+
|          |
|          |
+----------+
|          |
|          |
+----------+
+---+ +-+
|   | +-+
+---+ +-+
|   | :
+---+

v3:
 * Use new array_layout enum
 * ASCII art!

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
27f5fa7a37 i965: Allow forcing miptree->array_layout = ALL_SLICES_AT_EACH_LOD
gen6 does not support multiple miplevels with separate
stencil/hiz. Therefore we need to layout its miptree with no mipmap
spacing between the slices of each miplevel.

v3:
 * Use new array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
7e856d0b18 i965: Change mipmap array_spacing_lod0 to array_layout (enum)
We will want to setup gen6 separate stencil and hiz miptrees in a
layout that is similar to array_spacing_lod0. This is needed because
gen6 hiz and stencil only support a single mip-level.

In both use cases (gen7+ LOD0 spacing & gen6 separate stencil/hiz),
the array slices will be packed at each LOD without reserving extra
space for LODs within each array slice.

So, we generalize the name of this field and add comments to indicate
the old and new uses.

Motivation for the gen6 change comes from the PRM:

PRM Volume 1, Part 1, 7.18.3.7.2 For separate stencil buffer [DevILK]
to [DevSNB]:
 "The separate stencil buffer does not support mip mapping, thus the
  storage for LODs other than LOD 0 is not needed."

PRM Volume 2, Part 1, 7.5.3 Hierarchical Depth Buffer
 "[DevSNB]: The hierarchical depth buffer does not support the LOD
  field, it is assumed by hardware to be zero. A separate
  hierarachical depth buffer is required for each LOD used, and the
  corresponding buffer’s state delivered to hardware each time a new
  depth buffer state with modified LOD is delivered."

v2:
 * Rename array_spacing_lod0 to non_mip_arrays
v3:
 * Instead, replace array_spacing_lod0 with array_layout enum

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
56cdb55e38 i965/gen6 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surface
(bf25ee2 for gen6)

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.

We also must disable brw_workaround_depthstencil_alignment for
gen >= 6. Now the hardware will handle alignment when rendering
to additional slices/LODs.

v3:
 * Set depth_mt bo RELOC offset to 0, as was done in bf25ee2

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56127
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
3da13aef01 i965/gen6 fbo: make unmatched depth/stencil configs return unsupported
(f3c886b for gen6)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
96306a6cbb i965/gen6 blorp depth: calculate base surface width/height
(e3a49e1 for gen6)

This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
039eb81abf i965/gen6 depth surface: calculate minimum array element being rendered
(a23cfb8 for gen6)

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: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
cfa19af966 i965/gen6 depth surface: calculate LOD being rendered to
(08ef1dd for gen6)

This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
51b38106d7 i965/gen6 depth surface: calculate depth (array size) for depth surface
(bc1acaa for gen6)

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: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
48acf19d23 i965/gen6 depth surface: calculate more specific surface type
(171e633 for gen6)

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: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
11663050eb i965/gen6_depth_state.c: Remove (gen != 6) code paths
Since this code was branched from brw_misc_state.c, it had support for
gen != 6. We can now remove this.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:41 -07:00
Jordan Justen
39a5b69985 i965: Split gen6 depth hiz state out from brw
We will program the gen6 hiz depth state differently to enable layered
rendering on gen6.

v2:
 * Remove unneeded gen6_emit_depthbuffer as suggested by Topi

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:40 -07:00
Jordan Justen
341995e4b5 i965/gen6: Adjust render height in errata case for MSAA
In the gen6 PRM Volume 1 Part 1: Graphics Core, Section
7.18.3.7.1 (Surface Arrays For all surfaces other than separate
stencil buffer):

 "[DevSNB] Errata: Sampler MSAA Qpitch will be 4 greater than the
  value calculated in the equation above , for every other odd Surface
  Height starting from 1 i.e. 1,5,9,13"

Since this Qpitch errata only impacts the sampler, we have to adjust
the input for the rendering surface to achieve the same qpitch. For
the affected heights, we increment the height by 1 for the rendering
surface.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:40 -07:00
Jordan Justen
f063712373 i965/gen6: Add support for layered renderbuffers
Rather than pointing the surface_state directly at a single
sub-image of the texture for rendering, we now point the
surface_state at the top level of the texture, and configure
the surface_state as needed based on this.

v2:
 * Use SET_FIELD as suggested by Topi
 * Simplify min_array_element assignment as suggested by Topi
v3:
 * Use irb->layer_count for depth instead of rb->Depth
 * Make gl_target const
 * depth - 1, not depth
v4:
 * Merge in dd43900b & b875f39e fixes to prevent 3D texture piglit
   regressions

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 20:11:04 -07:00
Jordan Justen
89b1f5d6ac i965/gen6_surface_state.c: Remove (gen < 6) code path
Since this code was branched from brw_wm_surface_state.c, it had
support for gen < 6. We can now remove this.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 17:19:20 -07:00
Jordan Justen
1f8e0fbd38 i965: Split gen6 renderbuffer surface state from gen5 and older
We will program the gen6 renderbuffer surface state differently to
enable layered rendering on gen6.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 17:19:20 -07:00
Kenneth Graunke
2d1735187d meta: Use instanced rendering for layered clears.
Layered rendering is part of OpenGL 3.2; GL_ARB_draw_instanced is part
of OpenGL 3.1.  As such, all drivers supporting layered rendering
already support gl_InstanceID.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-15 16:53:48 -07:00
Kenneth Graunke
ed6a4d6a7d mesa: Expose vbo_exec_DrawArraysInstanced as _mesa_DrawArraysInstanced.
So we can use it in meta.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-08-15 16:53:48 -07:00
Dave Airlie
e2594ee882 Revert "hud: don't overrun malloced arrays"
This reverts commit 1cfcd0164e.

This seems to cause r600g lockups,
https://bugs.freedesktop.org/show_bug.cgi?id=82628

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-16 09:15:19 +10:00
Kristian Høgsberg
14c1a2a94c i965: Guard access to gl_Layer by extension #ifdef
Only assign gl_Layer if we have GL_AMD_vertex_shader_layer.  Gen6 doesn't
(currently) have that extension, but it also doesn't support layered
rendering.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
2014-08-15 16:09:11 -07:00
Emil Velikov
1e1d285701 gallium/vc4: PIPE_CAP_VIDEO_MEMORY return the amount of system ram
Suggested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-15 23:42:10 +01:00
Eric Anholt
7c65b714ed vc4: Add support for blending.
Passes blendminmax and blendsquare.  glean's more serious blendFunc fails
in simulation due to binner memory overflow (I really need to work around
that), and fbo-blending-formats fails due to Mesa refusing one of the
getter requests, even before it could fail due to the driver not actually
supporting different formats yet.
2014-08-15 12:01:32 -07:00
Eric Anholt
f663102585 vc4: Drop incorrect attempt to incorrectly invert the primconvert hw_mask.
The hw_mask is the set of primitives you actually support, so this attempt
to provide the set of formats that's unsupported was wrong in two ways (it
was intended to be '~' not '!').  However, we only call this code when
prim isn't one of the actually supported hw_mask bits, so missing out on
the memcpy didn't matter anyway.
2014-08-15 12:01:32 -07:00
Eric Anholt
a8f16054ca vc4: Use cl_f() instead of cl_u32(fui()) 2014-08-15 12:01:32 -07:00
Eric Anholt
e6fe6d0694 vc4: Consistently use qir_uniform_f(). 2014-08-15 12:01:32 -07:00
Eric Anholt
ba875b3a0d vc4: Consume the implicit varyings for points and lines.
We were triggering simulator assertion failures for not consuming these,
and presumably we want to actually make use of them some day (for things
like point/line antialiasing)

Note that this has the qreg index as 0, which is the same index as the
first GL varyings read.  This doesn't matter currently, since that number
isn't used for anything except dumping.
2014-08-15 12:00:32 -07:00
Eric Anholt
64ad96a9f4 vc4: Move the deref of the color buffer for simulator into the simulator.
At some point I'm going to want to move the information necessary for the
host buffer upload/download into the BO so that it's independent of the
current vc4->framebuffer, but for now this fixes pointless derefs on
non-simulator in vc4_context.c since the dump_fbo() removal
2014-08-15 11:52:18 -07:00
Kristian Høgsberg
2f28a0dc23 i965: Implement fast color clears using meta operations
This patch uses the infrastructure put in place by previous patches
to implement fast color clears and replicated color clears in terms of
meta operations.

This works all the way back to gen7 where fast clear was introduced and
adds support for fast clear on gen8.  It replaces the blorp path
completely and improves on a few cases.  Layered clears are now done
using instanced rendering and multiple render-target clears use a
MRT shader with rep16 writes.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 11:25:47 -07:00
Kristian Høgsberg
f9dc7aabb3 i965: Add optimization pass to let us use the replicate data message
The data port has a SIMD16 'replicate data' message, which lets us write
the same color for all 16 pixels by sending the four floats in the
lower half of a register instead of sending 4 times 16 identical
component values in 8 registers.

The message comes with a lot of restrictions and could be made generally
useful by recognizing when those restriction are satisfied.  For now,
this lets us enable the optimization when we know it's safe, but we don't
enable it by default.  The optimization works for simple color clear shaders
only, but does recognized and support multiple render targets.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 11:25:47 -07:00
Kristian Høgsberg
ba4507576c meta: Export _mesa_meta_drawbuffers_from_bitfield()
We'll use this in the i965 fast clear implementation.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-08-15 11:25:47 -07:00
Kristian Høgsberg
5fad83bdf8 mesa: Use _mesa_lock_context_textures in _mesa_GetTexParameterfv()
GetTexParamterfv() doesnt change texture state, so instead of
_mesa_lock_texture() we can use _mesa_lock_context_textures(),
which doesn't increase the texture stamp.  With this change,
_mesa_update_state_locked() is now only called from under
_mesa_lock_context_textures(), which is right thing to do.  Right now
it's the same mutex, but if we made texture locking more fine grained
locking one day, just locking one texture here would be wrong.

This all ignores the fact that texture locking seem a bit
flaky and broken, but we're trying to not blatantly make it worse.

This change allows us to reliably unlock the context textures in the
dd::UpdateState callback as is necessary for meta color resolves.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 11:25:25 -07:00
Kristian Høgsberg
388f02729b i965: Move pre-draw resolve buffers to dd::UpdateState
No functional change except for glBegin/glEnd style rendering, where we now
do the resolves at glBegin time instead of FLUSH_VERTICES time.  This is also
the reason for this change, so that when we later switch fast clear resolve to
use meta, we won't be doing meta operations in the middle of a begin/end
sequence.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
cf89b29d2f i965: Provide a context flag to let us enable fast clear
GEN7+ has the fast clear functionality, which lets us clear the color
buffers using the MCS and a scaled down rectangle.  To enable this
we have to set the appropriate bits in the 3DSTATE_PS package.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
1a05dcb349 i965: Disable clipping when rendering 3DPRIM_RECTLIST primitives
The clipper doesn't support clipping 3DPRIM_RECTLIST primitives and must
be turned off when we use them.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
3f0f2c7f7d i965: Add a mechanism for sending native primitives into the driver
The brw_draw_prims() function is the draw entry point into the driver,
and takes struct _mesa_prim for input.  We want to be able to feed
native primitives into the driver, and to that end we introduce
BRW_PRIM_OFFSET, which lets use describe geometry using the native
GEN primitive types.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
ff7a2fc322 i965: Add context flag to disable the viewport transform
This lets us disable the viewport transform, which will be useful for
emitting 3DPRIM_RECTLIST.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Kristian Høgsberg
1effbf6898 i965: Add an option to not generate the SIMD8 fragment shader
For now, this can only be triggered with a new 'no8' INTEL_DEBUG option
and a new context flag.  We'll use the context flag later, but introducing
it now lets us bisect to this commit if it breaks something.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 10:33:41 -07:00
Emil Velikov
0267c6d7ee docs/autoconf: explicitly mention PKG_CONFIG_PATH for cross/multilib builds
... and squash a couple of typos.

Suggested-by: Eero Tamminen <eero.t.tamminen@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 18:00:37 +01:00
Emil Velikov
5fe400d82a st/dri: Add __DRI2rendererQueryExtension support
The final step to get GLX_MESA_query_renderer working with gallium
drivers.

v2: Remove __DRI2_RENDERER_PREFERRED_PROFILE handling. It's already
handled in dri/common. Spotted by Marek.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
89f80c2185 gallium/softpipe/llvmpipe: handle query_renderer caps
Both report 0xffffffff as both vendor and device id, and the maximum
amount of system memory as video memory.

v2: Use aux helper os_get_total_physical_memory().

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
3a6b68b113 gallium/svga: handle query_rendered caps
All the values are are currently hardcoded. One could use
some heuristics to determine the amount of video memory if
a callback to the host is not available.

Do we what to advertise the driver as hardwar accelerated ?

Cc: Brian Paul <brianp@vmware.com>
Cc: José Fonseca <jose.r.fonseca@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
2b5f3956be gallium/nouveau: handle query_renderer caps
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
0b67d5d4ce gallium/vc4: handle query_renderer caps
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
de01443753 gallium/r300/r600/radeonsi: handle query_renderer caps
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
cc313b3ffe gallium/ilo: handle query_renderer caps
Implementation based on the classic driver with the following
changes:
 - Use auxiliarry function os_get_total_physical_memory to get the
total amount of memory.
 - Move the libdrm_intel specific get_aperture_size to the winsys.

Cc: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:47 +01:00
Emil Velikov
5b9cb13295 gallium/i915: handle query_renderer caps
Implementation based on the classic driver with the following
changes:
 - Use auxiliarry function os_get_total_physical_memory to get the
total amount of memory.
 - Move the libdrm_intel specific get_aperture_size to the winsys.

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:42:46 +01:00
Emil Velikov
e9c43b1f01 gallium/freedreno: handle query_renderer caps
Provide the real vendor and and hardcode the device id as
0xffffffff as the devices currently using freedreno are non-pci.
The device features UMA.

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-08-15 17:42:43 +01:00
Emil Velikov
8d2745703c auxiliary/os: introduce os_get_total_physical_memory helper function
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:41:57 +01:00
Emil Velikov
139751403c gallium: add GLX_MESA_query_renderer caps
Namely vendor/device id, accelerated and UMA, which will be used to describe
the underlying renderer.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 17:41:34 +01:00
Emil Velikov
64b1dc4449 dri/swrast: add GLX_MESA_query_renderer support
v2:
 - Drop __DRI2_RENDERER_PREFERRED_PROFILE case.
 - Cleanup return statements.

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:38 +01:00
Emil Velikov
9c65361457 dri/radeon: add GLX_MESA_query_renderer support
- Create radeon{Vendor,GetRenderer}String helpers.
 - Drop __DRI2_RENDERER_PREFERRED_PROFILE case.
 - Cleanup return statements.

To be used by the upcomming GLX_MESA_query_renderer implementation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:38 +01:00
Emil Velikov
55d1251d41 dri/radeon: don't print TCL status on glGetString(GL_RENDERER)
Printing the TCL involves that context is available at the time of
query. The GLX_MESA_query_renderer states that glGetString(GL_RENDERER)
and glXQueryRendererStringMESA(GLX_RENDERER_DEVICE_ID_MESA) will have
the same format, thus removing the context dependenicy will help us
achieve that.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
76f07362ea dri/nouveau: add GLX_MESA_query_renderer support
- Create nouveau_{vendor,get_renderer}_string helpers.
 - Set correct max_gl*version.
 - Query the device PCIID via libdrm_nouveau/nouveau_getparam.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
87d3ae0b45 dri/common: Move __DRI2_RENDERER_PREFFERED_PROFILE handling to driQueryRendererIntegerCommon
Essentially all drivers would like to use to opengl core profile if
available, so avoid duplication by moving the code to a common fallback
within driQueryRendererIntegerCommon.

If a driver uses different approach they can handle it separately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
679c2ef8a0 glx/drisw: add support for DRI2rendererQueryExtension
The extension is used by GLX_MESA_query_renderer, which
can be provided for by hardware and software drivers.

v2: Use designated initializers.
v3: Move drisw_query_renderer_*() to dri2_query_renderer.c

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
1bccf99c30 glx/dri2: use mapping table for dri2_convert_glx_query_renderer_attribs()
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:37 +01:00
Emil Velikov
d10ba8b7c0 glx/drisw: Move private structure declarations to a header file
v2: Reff the correct file wrt copyright, spotted by Chia-I

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-15 17:35:36 +01:00
Brian Paul
ffb8e884f7 mesa: check if GL_ARB_copy_image is enabled in _mesa_CopyImageSubData()
Generate a GL error and return rather than crashing on a null
ctx->Driver.CopyImageSubData pointer (gallium).  This allows apitraces
with glCopyImageSubData() calls to continue rather than crash.

Plus, fix a comment typo.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-15 08:35:17 -06:00
Neil Roberts
aa9d4f9d1a i965/blorp_clear: Use memcpy instead of assignment to copy clear value
Similar to the problem described in 2c50212b14, if we copy the clear
value through a regular assignment via a floating point value, then if an
integer clear value is being used that happens to contain a signalling NaN
value then it would get converted to a quiet NaN when stored via the x87
floating-point registers. This would corrupt the integer value. Instead we
should use a memcpy to ensure the exact bit representation is preserved.

This bug can be triggered on 32-bit builds with optimisations by using an
integer clear color with a value like 0x7f817f81.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 12:35:40 +01:00
Glenn Kennard
afa7df9b78 r600g: Implement ARB_derivative_control
Requires Evergreen/Cayman

marek: update release notes

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 12:23:06 +02:00
Chris Forbes
f1370fed2c docs: Update relnotes for ARB_gpu_shader5
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 19:25:10 +12:00
Chris Forbes
139f127aac docs: Mark off ARB_gpu_shader5 for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 19:25:07 +12:00
Chris Forbes
4a3667993e i965: Enable ARB_gpu_shader5 on Gen7
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 19:24:56 +12:00
Chris Forbes
abedd05bcd i965/fs: Add support for nonconst sampler indexing in FS visitor
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:33 +12:00
Chris Forbes
fbfcd671a1 i965/fs: Add support for non-const sampler indices in generator
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:32 +12:00
Chris Forbes
4ba5171f30 i965/fs: Refactor generate_tex in prep for nonconst sampler indexing
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:32 +12:00
Chris Forbes
2b1204aa96 i965/fs: Use brw_adjust_sampler_state_pointer in fs generator too
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:13:32 +12:00
Chris Forbes
2cd6169e92 i965/vec4: Add support for nonconst sampler indexing in VS visitor
V2: Set force_writemask_all on ADD; this *is* necessary in the VS case
too.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:12:45 +12:00
Chris Forbes
301b71557b i965/vec4: Add support for non-const sampler indices in generator
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:32 +12:00
Chris Forbes
86dc34a0b0 i965: Generalize sampler state pointer mangling for non-const
For now, assume that the addressed sampler can be in any of the
16-sampler banks. If we preserved range information this far, we
could avoid emitting these instructions if the sampler were known
to be contained within one bank.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:29 +12:00
Chris Forbes
f7146d1a94 i965/vec4: Refactor generate_tex in prep for non-const samplers
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:28 +12:00
Chris Forbes
8ce3fa8e91 i965: Extract helper function for surface state pointer adjustment
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-15 19:10:19 +12:00
Chris Forbes
ceaf823e23 docs: Mark off ARB_gpu_shader5 UBO array indexing for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
70354ca668 i965/vec4: Add visitor support for nonconst ubo block indexing
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
a55eae9b6d i965/vec4: Generate indirect sends for nonconstant UBO array access
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
ad9fce6811 i965/fs: Add visitor support for nonconstant UBO indices
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:48 +12:00
Chris Forbes
3fd359b10d i965/fs: Generate indirect sends for nonconstant UBO array accesses
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:47 +12:00
Chris Forbes
17e0fa9a06 i965: Adjust set_message_descriptor to handle non-sends
We're about to be using this infrastructure to build descriptors in
src1 of non-send instructions, when preparing to do an indirect send.

Don't accidentally clobber the conditionalmod field of those
instructions with SFID bits, which aren't part of the descriptor.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:47 +12:00
Chris Forbes
3512c79789 i965: Add low-level support for indirect sends
This provides a reasonable place to enforce the hardware restriction
that indirect descriptors must be in a0.0

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-15 18:53:47 +12:00
Kenneth Graunke
35ca288165 i965/fs: Add pass to rename registers to break live ranges.
The pass breaks live ranges of virtual registers by allocating new
registers when it sees an assignment to a virtual GRF it's already seen
written.

total instructions in shared programs: 4337879 -> 4335014 (-0.07%)
instructions in affected programs:     343865 -> 341000 (-0.83%)
GAINED:                                46
LOST:                                  1

[mattst88]: Make pass not break in presence of control flow.
            invalidate_live_intervals() only if progress.
            Fix up delta_x/delta_y.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-08-14 23:50:12 -07:00
Kenneth Graunke
650c331378 i965: Fix INTDIV math assertions on Broadwell.
Commit c66d928f2c ("i965: Enable INTDIV
in SIMD16 mode.") began using generate_math_gen6 to break SIMD16 INTDIV
into two SIMD8 operations.

generate_math_gen6 takes two registers - for unary operations, we pass
ARF null for the second operand.  Prior to Broadwell, real operands were
always GRF.  But now they can be IMM as well.

So, check for != ARF instead of == GRF.

+12 piglits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 23:21:34 -07:00
Kenneth Graunke
e84e074248 Revert "i965/vec4: Use MOV, not OR, to set URB write channel mask bits."
This reverts commit af13cf609f, which
appears to cause huge performance problems on Ivybridge.  I'd missed
that the FFTID bits are in the low byte.  The documentation doesn't
indicate that the URB write message header actually wants FFTID - it
just labels those bits as "Reserved."  But it appears necessary.

This does slightly more than revert the original change: originally,
Broadwell had separate code generation, which used MOV, and this patch
only changed it for Gen4-7.  Now that both are unified, reverting this
also makes Broadwell use OR.  Which should be fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-14 23:21:28 -07:00
Chris Forbes
417cc8b2c8 docs: Mark off ARB_derivative_control for i965.
Also update 10.3 relnotes to match.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:09 +12:00
Chris Forbes
654b7788eb i965: Enable ARB_derivative_control on Gen7+.
The extension says GL 4.0 is required. We'll meet the spirit
of that restriction by enabling on just those generations which will
soon support GL 4.0 (Gen7+), although it's technically supportable on
all generations.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:06 +12:00
Chris Forbes
a396224520 i965/fs: Support fine/coarse derivative opcodes
The quality level (fine/coarse/dont-care) is plumbed through to the
generator as a constant in src1.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:04 +12:00
Chris Forbes
587e6e7898 i965/vec4: Assert that fine/coarse derivative ops don't appear
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:04:03 +12:00
Chris Forbes
eba0c54f62 glsl: Mark program as using dFdy if coarse/fine variant is used
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-15 18:03:53 +12:00
Ilia Mirkin
f08d7b8fe1 nv50,nvc0: add support for fine derivatives
The quadop-based method we currently use on all chipsets already
provides the fine version of the derivatives.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-14 20:25:33 -04:00
Ilia Mirkin
88b0c6403f mesa/st: add support for emitting fine derivative opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
8ee74ce50f gallium: add opcodes/cap for fine derivative support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v1)
v2: Reuse opcode gaps as suggested by Marek
2014-08-14 20:25:32 -04:00
Ilia Mirkin
3fa384db0c mesa/program: add new derivative unops to the unexpected list
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
f80c6847e9 glsl: add ARB_derivative control support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
4a9c36c985 mesa: add ARB_derivative_control extension bit
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 20:25:32 -04:00
Ilia Mirkin
e474cb4027 mesa: add ARB_texture_barrier support
This extension is identical to NV_texture_barrier. Alias
glTextureBarrier to the existing glTextureBarrierNV and use the existing
NV_texture_barrier extension bit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-14 20:25:32 -04:00
Marek Olšák
c3bd130784 docs: document radeonsi BPTC support, sort extensions in 10.3 release notes 2014-08-15 02:05:05 +02:00
Glenn Kennard
f23ee74791 r600g: Implement BPTC texture support
Requires Evergreen/Cayman

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-15 01:55:13 +02:00
Kristian Høgsberg
221d9c3e9c i965: Rename intelValidateState to intel_update_state
This matches the name of the dd hook.  Also convert a couple of nearby
dd implementations to lowercase + underscore as is now the standard.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-14 13:57:26 -07:00
Kristian Høgsberg
416dd873e8 i965: Assign PS kernel start pointers when we decide which kernels to use
Right now we decide which kernels to use and the GRF start offsets in
one place and emit the kernel pointers later.  The logic of how to map
8, 16 and 32 kernels to kernel start pointers follows the same logic as which
GRF start offsets to use, so lets figure out these two things in one place.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-08-14 13:57:26 -07:00
Grigori Goronzy
d7d8260f70 radeonsi: implement BPTC texture support
Passes all piglit tests.

v2: rebased

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
87a8ed9389 radeonsi: fix buffer invalidation of unbound texture buffer objects
This maintains a list of all TBOs in a pipe_context.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
79f28cdb98 r600g: implement invalidation of texture buffer objects
This fixes piglit spec/ARB_texture_buffer_object/data-sync.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
da9c3ed304 r600g: fix constant buffer fetches
Somebody forgot to do this. It was uncovered by recent st/mesa changes.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82139

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2014-08-14 20:45:03 +02:00
Marek Olšák
d52202141e r600g: clear constant buffer sizes at the beginning of CS
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-14 20:45:03 +02:00
Pekka Paalanen
08264e5dad egl_dri2: fix EXT_image_dma_buf_import fds
The EGL_EXT_image_dma_buf_import specification was revised (according to
its revision history) on Dec 5th, 2013, for EGL to not take ownership of
the file descriptors.

Do not close the file descriptors passed in to eglCreateImageKHR with
EGL_LINUX_DMA_BUF_EXT target.

It is assumed, that the drivers, which ultimately process the file
descriptors, do not close or modify them in any way either. This avoids
the need to dup(), as it seems we would only need to just close the
dup'd file descriptors right after.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76188
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-14 21:30:57 +03:00
Pekka Paalanen
972e87ca30 i965: fix compiler error in union initiliazer
gcc 4.6.3 chokes with the following error:

brw_vec4.cpp: In member function 'int brw::vec4_visitor::setup_uniforms(int)':
brw_vec4.cpp:1496:37: error: expected primary-expression before '.' token

Apparently C++ does not do named initializers for unions, except maybe
as a gcc extension, which is not present here.

As .f is the first element of the union, just drop it. Fixes the build
error.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 21:30:57 +03:00
Anuj Phogat
9b9dd22f44 i965: Bail on FS copy propagation for scratch writes with source modifiers
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 11:03:00 -07:00
Anuj Phogat
7c1ea00eaf i965: Bail on vec4 copy propagation for scratch writes with source modifiers
Fixes Khronos GLES3 CTS test:
dynamic_expression_array_access_vertex

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 11:03:00 -07:00
Aras Pranckevicius
2b837576eb glsl: Fixed vectorize pass vs. texture lookups.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82574
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 09:40:33 -07:00
Brian Paul
088106fa79 ra: move declarations before code to fix MSVC build
Trivial.
2014-08-14 08:53:45 -06:00
Brian Paul
bfb6b76665 svga: remove some unneeded INLINE qualifiers
Trivial.
2014-08-14 08:53:45 -06:00
Emil Velikov
478f82737c docs/autoconf: update to better reflect reality
* --enable-{32,64}-bit is done. Use --build and --host instead.
 * Configure does not add "-g -O2" to C{,XX}FLAGS.
 * Pkg-config has been mandatory for a while now.
 * Avoid using LDFLAGS, refer to pkg-config.
 * --with-expat is deprecated. Use pkg-config.

v2:
 * Note that CC/CXX will need to be set for multilib builds.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2014-08-14 15:45:23 +01:00
Jose Fonseca
d4a1f3fd27 scons: do not include headers from the sources lists
The SCons documentation is not explicit on the topic yet building mesa
with SCons and MSVC is known to have problems when headers are listed.
So be safe just drop them for now.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82534
Tested-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-14 15:38:04 +01:00
Emil Velikov
395ce0b0fa configure.ac: remove enable 32/64 bit hacks
These two were added ages ago, with an explicit comment "Hacks ..."
They have been insufficient for years and maintainers needed to
explicitly handle the build themselves.

Rather than lying and pretending that it works, just kill this hack and
let maintainers build things the way it should be done for their
distribution.

Document the removal in the release notes.

Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 15:37:33 +01:00
Emil Velikov
957a28e63c Revert "configure: Fix --enable-XX-bit flags by moving LT_INIT where it should"
This reverts commit 2af28040d6.

The commit was resolving an issue where libtool will not setup the
environment correctly when one explicitly provides --enable-{32,64}-bit
at configure time. It was caused due to the "-m32,64" C{,XX}FLAGS being
set too late relative to LT_INIT.

At the same time this cases the enable_static to be incorrectly set,
amongst others leading to build issues. Rather than being smart and
trying to handle 32/64 bit build ourselves it may be better to delegate
it to the builder/maintainer. The latter should now know better which is
the correct(most appropriate) method.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82536
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82546
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
2014-08-14 15:36:49 +01:00
Neil Roberts
2c50212b14 i965: Store uniform constant values in a gl_constant_value instead of float
The brw_stage_prog_data struct previously contained an array of float pointers
to the values of parameters. These were then copied into a batch buffer to
upload the values using a regular assignment. However the float values were
also being overloaded to store integer values for integer uniforms. This can
break if x87 floating-point registers are used to do the assignment because
the fst instruction tries to fix up invalid float values. If an integer
constant happened to look like an invalid float value then it would get
altered when it was copied into the batch buffer.

This patch changes the pointers to be gl_constant_value instead so that the
assignment should end up copying without any alteration. This also makes it
more obvious that the values being stored here are overloaded for multiple
types.

There are some static asserts where the values are uploaded to ensure that the
size of gl_constant_value is the same as a float.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81150
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-14 11:54:48 +01:00
Christian König
6fb42ee7a6 st/vdpau: add device reference counting
This fixes an issue with flash where it tries to destroy a decoder
after already destroying the device associated with the decoder.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-14 11:57:07 +02:00
Chris Forbes
c1df492d03 mesa: Make ARB_gpu_shader5 core-profile-only
Requires GLSL 1.50 or higher, which we only support in the core profile.

V2: Fix broken alignment

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-14 21:32:33 +12:00
Ilia Mirkin
a89353381a nouveau: force luminance clear colors to have the same g/b values as r
Fixes the LUMINANCE_ALPHA formats of fbo-clear-formats piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-14 02:05:06 -04:00
Kenneth Graunke
c66d928f2c i965: Enable INTDIV in SIMD16 mode.
All we need to do is decompose this to two SIMD8 instructions, like we
do in many other cases.  We even already have code for that.

I apparently just botched this last time I tried, and it was easy.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 21:19:07 -07:00
Kenneth Graunke
24878f31c4 i965/fs: Drop "do dual source blending" generator parameter.
When dual source blending, the visitor already stores a flag in
brw_wm_prog_data (dual_src_blend) for the state upload code to use.
The generator also receives this, so there's no need to pass an
additional flag.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 21:19:07 -07:00
Jason Ekstrand
a8379a405a mesa/texstore: Don't use the _mesa_swizzle_and_convert if we need transfer ops
The _mesa_swizzle_and_convert path can't do transfer ops, so we should bail
if they're needed.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-13 19:43:33 -07:00
Dave Airlie
f1ef4be4be docs: update ARB_vertex_attrib_64bit status
I started this as well on top of my fp64 stuff.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-14 10:49:55 +10:00
Dave Airlie
c63233424b docs/GL3.txt: add GLES 3.1 section
This just cherry-pick the extensions into a list for GLES 3.1

I'm not actually sure if this list if complete or correct, maybe someone
else can tell me what I missed, and I'm not 100% sure on multi_draw_indirect.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-14 10:49:15 +10:00
Dave Airlie
1cfcd0164e hud: don't overrun malloced arrays
==17630== Invalid read of size 4
==17630==    at 0x400AE10: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17630==    by 0x49024A2: u_upload_data (u_upload_mgr.c:253)
==17630==    by 0x49050E1: u_vbuf_draw_vbo (u_vbuf.c:980)
==17630==    by 0x487DE29: cso_draw_vbo (cso_context.c:1425)
==17630==    by 0x487DEA0: cso_draw_arrays (cso_context.c:1445)
==17630==    by 0x48A3B0E: hud_draw_colored_prims.constprop.6 (hud_context.c:123)
==17630==    by 0x48A4810: hud_draw (hud_context.c:266)
==17630==    by 0x48763F7: dri_flush (dri_drawable.c:483)
==17630==    by 0x4057510: dri2Flush.constprop.4 (dri2_glx.c:559)
==17630==    by 0x405789E: dri2SwapBuffers (dri2_glx.c:851)
==17630==    by 0x402C531: glXSwapBuffers (glxcmds.c:842)
==17630==    by 0x8049716: ??? (in /usr/bin/glxgears)
==17630==  Address 0x4426b2c is 4 bytes after a block of size 1,008 alloc'd
==17630==    at 0x4006B11: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17630==    by 0x48A4CE7: hud_pane_add_graph (hud_context.c:625)
==17630==    by 0x48A68F0: hud_pipe_query_install (hud_driver_query.c:175)
==17630==    by 0x48A6A30: hud_driver_query_install (hud_driver_query.c:207)
==17630==    by 0x48A5835: hud_create (hud_context.c:791)
==17630==    by 0x48756CB: dri_create_context (dri_context.c:165)
==17630==    by 0x4871CD4: driCreateContextAttribs (dri_util.c:435)
==17630==    by 0x4871E06: driCreateNewContext (dri_util.c:464)
==17630==    by 0x4056A22: dri2_create_context (dri2_glx.c:223)
==17630==    by 0x402CF68: CreateContext (glxcmds.c:299)
==17630==    by 0x402D265: glXCreateContext (glxcmds.c:430)
==17630==    by 0x804B136: ??? (in /usr/bin/glxgears)

This is due to second vertex element being specified, and the upload
tries to fetch over the end. However the pane rendering only requires
a single vertex element, so specify only one.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-08-14 10:46:32 +10:00
Roland Scheidegger
b6d29de2c4 mesa: fix texstore with GL_COLOR_INDEX data
This got broken by 3dbf5bf657.
GL_COLOR_INDEX data is still supported (in legacy contexts), but the new
texstore_swizzle path cannot handle it (and didn't detect this).
Unfortunately there's no piglit test trying to specify textures with a
GL_COLOR_INDEX source format, and I don't really understand how all the color
map stuff which is used by this works, but this caused conform failures
(with a reported mesa implementation error when trying to figure out the color
mapping).

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-14 02:16:23 +02:00
Andreas Boll
64c379a3a8 winsys/radeon: fix hawaii accel_working2 comment
accel_working2 returns 3 if the new firmware is used.

The comment wasn't updated in v3 of commit:
36771dc winsys/radeon: fix nop packet padding for hawaii

Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-13 23:28:23 +02:00
Tom Stellard
866dae85c8 r300g: Fix bug in build_loop_info()/compiler v2
Fixes piglit glean "do-loop with continue and break" on RS690

It's based on Tom Stellard patch and improved to handle CMP instruction.

[v2] handle CMP instruction

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
2014-08-13 14:37:03 -04:00
Tom Stellard
ed3f7eadad clover: Flush the command queue in clReleaseCommandQueue()
This is required by the spec.

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

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:20:22 -04:00
Tom Stellard
a15088338e radeonsi/compute: Stop leaking the input buffer
We were leaking the input buffer used for kernel arguments and since
we were allocating it using si_upload_const_buffer() we were leaking
1 MB per kernel invocation.

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:18:35 -04:00
Tom Stellard
38fccc37c1 radeonsi/compute: Whitespace fixes
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:17:02 -04:00
Tom Stellard
1e2e550671 radeonsi/compute: Call si_pm4_free_state() after emitting compute state
This will decrement the reference count for buffers referenced in the
command stream will prevent us from leaking them.

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:17:02 -04:00
Tom Stellard
05e9681d55 radeonsi/compute: Update reference counts for buffers in si_set_global_binding()
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:17:02 -04:00
Tom Stellard
72969e0efb radeon/compute: Report a value for PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:11:44 -04:00
Tom Stellard
77ea58ca81 radeon/compute: Fix reported values for MAX_GLOBAL_SIZE and MAX_MEM_ALLOC_SIZE
There is a hard limit in older kernels of 256 MB for buffer allocations,
so report this value as MAX_MEM_ALLOC_SIZE and adjust MAX_GLOBAL_SIZE
to statisfy requirements of OpenCL.

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-13 14:11:43 -04:00
Connor Abbott
e78a01d5e6 ra: optimistically color only one node at a time
Before, when we encountered a situation where we had to optimistically
color a node, we would immediately give up and push all the remaining
nodes on the stack in the order of their index - which is a random, and
potentially not optimal, order. Instead, choose one node to
optimistically color in ra_select(), and then once we've optimistically
colored it, keep on going as normal in the hopes that we've opened up
more avenues for the normal select phase to make progress. In cases with
high register pressure, this helps make the order we push things on the
stack much better, and therefore increase the chance that we can allocate
successfully.

total instructions in shared programs: 4545447 -> 4545401 (-0.00%)
instructions in affected programs:     1353 -> 1307 (-3.40%)
GAINED:                                124
LOST:                                  6

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-13 11:43:37 -07:00
Connor Abbott
03f4084d28 ra: don't consider nodes for spilling we don't need to
Previously, we would consider any optimistically colored nodes for
spilling. However, spilling any optimistically colored nodes below the
node that we failed to color on the stack wouldn't help us make
progress, since it wouldn't help with allowing us to find a color for
the node currently failing to get colored. Only consider nodes
which were above the failing node on the stack for spilling, which
simplifies the logic, and comment the code better so people know what's
going on here.

No shader-db changes with BRW_MAX_GRF reduced to 90 (or with the normal
number of GRF's).

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-13 11:43:30 -07:00
Connor Abbott
567e2769b8 ra: make the p, q test more efficient
We can store the q total that pq_test() would've calculated in the node
itself, updating it when we add a node to the stack. This way, we only
have to walk the adjacency list when we push a node on the stack (i.e.
when the p, q test succeeds) instead of every time we do the p, q test.

No difference in shader-db run times, but I'm keeping this in because
the q total that it calculates will also be used in the next few commits.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-13 11:43:22 -07:00
Connor Abbott
9a0b52e7c1 ra: cleanup the public API
Previously, there were 3 entrypoints into parts of the actual allocator,
and an API called ra_allocate_no_spills() that called all 3. Nobody
would ever want to call any of the 3 entrypoints by themselves, so
everybody just used ra_allocate_no_spills(). So just make them static
functions, and while we're at it rename ra_allocate_no_spills() to
ra_allocate() since there's no equivalent "with spills," because the
backend is supposed to handle spilling.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-13 11:43:05 -07:00
Ilia Mirkin
d72d67832b nouveau: only try to get new storage if there are any levels
This would try to allocate 0-sized bo's when the max level was below the
base level.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-13 10:09:01 -04:00
Ilia Mirkin
ddcbea91f1 nouveau: add emacs dir-locals file for tabs/8-space indents
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-13 09:59:04 -04:00
Ilia Mirkin
8049e5a1f6 nvc0: increase GLSL level to 400 to enable ARB_gpu_shader5
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-13 09:59:04 -04:00
Ilia Mirkin
6f1edf3cbf mesa/st: enable ARB_gpu_shader5 if the reported GLSL version >= 400
The ARB_gpu_shader5 extension is made up of a lot of small sub-parts.
Instead of adding PIPE_CAP's for each of these, just rely on the GLSL
version reported by the pipe driver. The remaining extensions lend
themselves naturally to being checked through a single CAP.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-13 09:59:04 -04:00
Emil Velikov
52901ec261 android: add CleanSpec.mk
The file contains rules that are executed on incremental builds. This
way one can avoid doing a full clean and ensure that the new object
(library) is correctly build.

Inspired by the work of Chih-Wei Huang, from the Android-x86 project.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
38df9f8a06 android: megadriver_stub: prefix static libraries with libmesa_
Will make it easier on us as CleanSpec.mk comes along and improves
consistency across the Android build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
73121a34d4 android: loader: prefix static libraries with libmesa_*
Will make it easier on us as CleanSpec.mk comes along and improves
consistency across the Android build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
db4d7229bc android: dri/i9*5: remove used _INCLUDES variable
No longer needed as of last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:57 +01:00
Emil Velikov
725373275c android: drivers/dri: add $(mesa_top)/src to the includes list
Will allow us to nuke an include or two from the drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
48307eb813 android: dri: use the installed libdrm headers
Saves us a few lines and brings us closer to the automake build.
Drop DRM_TOP as it's not longer used.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
c1cc3f2f19 android: gallium: use the installed libdrm headers
Saves us a few lines and brings us closer to the automake build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
5f3022e97f android: loader: use the installed libdrm headers
One step closer to the way we handle automake builds.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
db064b7054 android: egl/dri2: use the installed libdrm headers
Trying to get rid of the hardcoded dependency of DRM_TOP which
expects that mesa is localted in /external/drm. Will

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
5facd003a0 android: dri/i915: do not build an 'empty' driver
The variable i915_C_FILES changed to i915_FILES with commit
34d4216e64 back in mesa 9.1/9.2. Yet we've missed to update the
the android build, essentially creating an dummy/empty driver that
can never work.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
fa4aeb3c65 automake: mesa: whitespace fixes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:56 +01:00
Emil Velikov
b3121bfd41 mesa: guard better when building with sse4.1 optimisations
When the compiler is not capable/does not accept -msse4.1 while the target
has the instruction set we'll blow up as _mesa_streaming_load_memcpy is
going to be undefined.

To make sure that never happens, wrap the runtime cpu check+caller in an
ifdef thus do not compile that hunk of the code.

Fix the android build by enabling the optimisation and adding the define
where applicable.

v2: autoconf conditionals end with "fi" rather than endif.
v3: Wrap the definition and call to intel_miptree_{un,}map_movntdqa in
if defined(USE_SSE41). Spotted by Matt.

Cc: Matt Turner <mattst88@gmail.com>
Cc: Adrian Negreanu <adrian.m.negreanu@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:55 +01:00
Emil Velikov
07f583186d android: glsl: the stlport over the limited Android STL
The latter lacks various functionality used by mesa/glsl.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:55 +01:00
Emil Velikov
dfa6dc5eb8 android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}
Upstream Android (system/core) has dropped these formats with commit
6bac41f1bf9(get rid of HAL pixelformats 5551 and 4444) yet does not
mention why.

These formats never really worked so we're safe to drop them as well.

Identical commit is available in the android-x86 external/mesa repo

    commit 06a2d36edc
    Author: Chih-Wei Huang <cwhuang@linux.org.tw>
    Date:   Wed Sep 25 01:16:57 2013 +0800

        android: get rid of HAL pixelformats 5551 and 4444

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:55 +01:00
Emil Velikov
51a9a09ba8 android: gallium/auxiliary: drop log2/log2f redefitions
Recent versions of bionic has picked up support for these functions,
leading to build issues due to the redefition of the symbols.

Note: wrapping things in #ifdef does not cut it :\

Identical patch is available in chromium, android-x86 and perhaps other
projects.

    commit 66c1c789ce3407472de9ed620c9f815639058835
    Author: rmcilroy@chromium.org
    Date:   Wed Apr 02 10:59:34 2014 +0000

        Porting to x64 Android. Remove redefinitions of log2 and log2f.

        BUG=
        R=kbr@chromium.org

        Review URL: https://codereview.chromium.org/216773005

    commit 9cc0a0d2b0
    Author: Chih-Wei Huang <cwhuang@linux.org.tw>
    Date:   Sun Jul 21 23:04:19 2013 +0800

        android: remove log2, log2f

        The functions are already defined in the latest bionic.

Cc: Chia-I Wu <olvaffe@gmail.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
2014-08-13 00:46:55 +01:00
Emil Velikov
2e74818374 android: targets/egl-static: add correct include for DRM headers
Android build never really installs the headers, as such we need to
explicitly add their location in the source tree otherwise it will
fail to find them.

v2: Android now installs the headers, so let's use that ;)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
b72b826ef8 scons: group state-trackers' and targets' scons
Both share the identical dependencies, as such we can simplify
the scons script.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
ec668cbf8b android: reorder gallium SUBDIRS
To be closer to its automake counterpart.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
b75e0d7e25 automake: handle gallium SUBDIRs in gallium/Makefile
Considering the way we've been consolidating things it makes
sense to add the final two (aux and tests) in here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
7af25d17a5 automake: compact gallium/target/Makefile into gallium/Makefile
Yet another makefile less to worry about.

v2: Add state_trackers and targets on a single SUBDIRS line.
Requested by Matt.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:54 +01:00
Emil Velikov
eeb56b6b43 automake: merge gallium/state_trackers/Makefile into gallium/Makefile
One makefile less, with the potential of further compacting the
automake build.

v2: Rebase on top of vc4 changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:53 +01:00
Emil Velikov
fd7da27a43 automake: compact gallium/drivers and gallium/winsys makefiles
Rather than having two separate almost empty and identical makefiles,
compact them thus improving the configure and build time.
Additionally this makes the automake build symmetrical to the scons
and android one.

v2: Rebase on top of vc4, compact drivers + winsys on a single line.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:53 +01:00
Emil Velikov
792041ebe5 android: egl/main: add/enable freedreno
For all everyone willing to give the freedreno driver
a go they can now build it under Android.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:53 +01:00
Emil Velikov
bf05e06757 android: gallium/freedreno: add preliminary build
For all the people interested in testing the freedreno driver on
their Android devices. The next commit will hook these up within
the libEGL driver (via the gallium-egl backend).

There may be some rough edges but those can be sorted when a
willing builder/tester comes along.

v2:
 - s/freefreno/freedreno/. Spotted by Matt Turner.
 - Use the installed libdrm headers.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:52 +01:00
Emil Velikov
458d03a4a4 automake: gallium/freedreno: drop spurious include dirs
Rather than including two extra folders only for two headers,
just prefix the headers and be done with it.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-08-13 00:46:52 +01:00
Paulo Sergio Travaglia
aae453afe8 android: egl/main: resolve radeon linking issues
- link against libdrm_radeon
 - link the r600 driver against libstlport
 - linkin the newly added libmesa_pipe_radeon library
required by r600 and radeonsi drivers

v2: Include pipe_radeon after pipe_r600/radeonsi.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Split up and add commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:52 +01:00
Paulo Sergio Travaglia
5bbfa308c9 android: gallium/radeon: attempt to fix the android build
- include the correct folders
 - add a new buildscript for the common radeon folder

v2: Use the installed libdrm headers over the DRM_TOP ones.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Split up and add commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:52 +01:00
Emil Velikov
825fa2873f android: egl/main: fixup the nouveau build
For a while the nouveau pipe driver has been a static library
and it has been using STL for even longer.
Correct add the link and cleanup the gallium_DRIVERS.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:52 +01:00
Emil Velikov
6b510c6338 android: gallium/nouveau: fix include folders, link against libstlport
nouveau uses STL for a while now thus we need to include
external/stlport/libstlport.mk in order to get the build
at least partially working.

v2: Use the installed libdrm headers over the DRM_TOP ones.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-13 00:46:52 +01:00
Emil Velikov
b26017fad8 egl/main: Bring in the Makefile.sources
Rather than having the sources list duplicated across all three
build systems, define it once and use it whenever needed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-13 00:46:52 +01:00
Ilia Mirkin
2787bff8dd nvc0: add BPTC format support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
ffd706dac0 mesa/st: add BPTC formats, expose ARB_texture_compression_bptc
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
19563f0880 softpipe,llvmpipe: mark BPTC formats as unsupported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
43c038f4a6 gallium: add basic support for BPTC formats
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 19:21:04 -04:00
Ilia Mirkin
82903acf5e docs: add GL4.5 section
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-12 18:56:22 -04:00
Emil Velikov
5e5f754f5b configure.ac: drop enable_dri check in gallium_gbm
A while back we've mandated that gbm requires enable_dri,
thus this check is no longer required.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Emil Velikov
1d1ec76bdf configure.ac: bail out if building gallium_gbm without gallium_egl
The former is the only user of the latter. As such building gbm
without egl makes little to no sense.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Emil Velikov
16873a6e62 st/dri: define GALLIUM_SOFTPIPE when building kms_swrast
To avoid unresolved symbols in the DRI modules with earlier commit we
wrapped the innards of dri_kms_init_screen() in a
DRI_TARGET/GALLIUM_SOFTPIPE ifdef.

At the same time we forgot to adds the defines to the st/dri build
systems, breaking kms_swrast and gnome-continuous.

Drop the DRI_TARGET define, we're already in st/DRI.

Reported-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reported-by: Vadim Rutkovsky <vrutkovs@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Alexandre Demers
2af28040d6 configure: Fix --enable-XX-bit flags by moving LT_INIT where it should
Moving LT_INIT after setting completely (AM_)C(XX)FLAGS and LDFLAGS.
LT_INIT needs them as they are expected to be used all along
the compilation when the macro runs its tests to determine among other
things the host type.

For info, see http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50754
Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Tested-by: Tapani Palli <lemody@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-12 23:36:06 +01:00
Emil Velikov
469416f988 c11/threads: correct assertion
We should assert when either the function or the flag pointer
is null or we'll end up with a null reference a few lines later.

Currently unused by mesa thus it has gone unnoticed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 23:36:05 +01:00
Brian Paul
07109cfd99 docs: now distributing the GL/glcorearb.h header
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 15:55:41 -06:00
Brian Paul
25774859f8 mesa: pull Khronos glcorearb.h header into include/GL/
Apps that only want to use core functionality should #include this
header.  This version covers everything up to OpenGL 4.5.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 15:55:41 -06:00
Eric Anholt
c8e0dd2a2c vc4: Drop the dump_fbo() routine.
Now that eglkms is working, and some tests are working under
PIGLIT_PLATFORM=gbm, I don't think I need this any more.
2014-08-12 14:21:56 -07:00
Eric Anholt
8106722bbc vc4: Claim the GL 2.1 minimum for 3D textures.
We don't actually do them (or even fake them) currently, but it does get
us a bunch of unrelated glean glsl1 tests passing, which previously would
error out due to glean assuming the minimums on a 3D texture that 2 of the
subtests use.
2014-08-12 14:19:49 -07:00
Eric Anholt
e1ce610899 vc4: Declare what vertex formats we actually support.
We will support more than this eventually, but for now this makes u_vbuf
format-convert a few things (32-bit snorm and scaled, doubles) for us.
2014-08-12 14:19:49 -07:00
Eric Anholt
8e504ce420 vc4: Stash some debug code for format support checks.
This can be useful for looking at context init setup and texture format
choices, and there's no reason for the silly retval computation we do if
you're not going to have this code (mostly from freedreno) around.
2014-08-12 14:03:35 -07:00
Eric Anholt
af35afed06 vc4: Texture format support has nothing to do with VBO format support.
This was inherited from freedreno, but doesn't apply to us.
2014-08-12 14:03:35 -07:00
Eric Anholt
3e9a09415e vc4: Fix off-by-one in texture maximum levels.
It's 2048x2048 that's the max, not 1024x1024.
2014-08-12 14:03:34 -07:00
Eric Anholt
b9eb3d4bee vc4: Add support for the FLR opcode. 2014-08-12 14:03:34 -07:00
Kenneth Graunke
8c229d306b i965: Delete the Gen8 code generators.
We now use the brw_eu_emit.c code instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
f17bfc9ba9 i965: Never use the Gen8 code generators.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
074d472398 i965: Switch to the EU emit layer for code generation on Broadwell.
Everything should be in place to unify code generation between Gen4-7
and Gen8+.  We should be able to drop the Gen8 generators at this point.

However, leave them hooked up for a brief moment, for testing and
comparison purposes.  Set GEN8=1 to use the old Gen8+ code generator
paths.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
db6ffa29c8 i965: Retype atomics to UD in Gen8 code generation.
Kind of a moot point since we're deleting Gen8 code generation, but
this at least helps make it match the Gen4-7 code.  It's probably more
reasonable than using float.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
04f5b2f4e4 i965/vp: Use the sampler for pull constant loads on Gen7/7.5.
This improves performance in Trine 2 at 1280x720 (windowed) on "Very
High" settings by 30% (in the interactive menu) to 45% (in the forest
by the giant frog) on Haswell GT3e.

It also now generates the same assembly on Gen7 as it does on Gen8,
which always used the sampler for both types.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
f7e9756201 i965/vec4: Drop gen <= 7 assertion in pull constant load handling.
I don't see any reason for this to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
ce90fd9676 i965/eu: Set src0 file to IMM on Gen8+ flow control instructions.
According to the documentation, we need to set the source 0 register
type to IMM for flow control instructinos that have both JIP and UIP.
Out of paranoia, just make all flow control instructions use IMM;
there's no benefit to using ARF anyway, and it could trouble that's
difficult to diagnose.

See commit 9584959123, which did the
analogous change in the gen8_generator code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
d8ef0eab5a i965/eu: Refactor brw_WHILE to share a bit more code on Gen6+.
We're going to add a Gen8+ case shortly, which would need to duplicate
this code again.  Instead, share it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
aafdf9eef4 i965/eu: Emulate F32TO16 and F16TO32 on Broadwell.
When we combine the Gen4-7 and Gen8+ generators, we'll need to handle
half float packing/unpacking functions somehow.  The Gen8+ generator
code today just emulates the behavior of the Gen7 F32TO16/F16TO32
instructions, including the align16 mode bugs.

Rather than messing with fs_generator/vec4_generator, I decided to just
emulate the instructions at the brw_eu_emit.c layer.

v2: Change gen >= 7 asserts to gen == 7 (suggested by Chris Forbes).
    Fix regressions on Haswell in VS tests due to type assertions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
849046b842 i965/vec4: Port Gen8 SET_VERTEX_COUNT handling to vec4_generator.
Broadwell requires the number of vertices written by the geometry shader
to be specified in a separate register, as part of the terminating
message's payload.

This also means GS_OPCODE_THREAD_END needs to increment mlen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
17c17b87f9 i965/vec4: Switch to MOV, not OR, for GS_OPCODE_THREAD_END on Gen8.
Either should work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
af13cf609f i965/vec4: Use MOV, not OR, to set URB write channel mask bits.
g0.5 has nothing of value to contribute to m0.5.  In both the VS and GS
payload, g0.5 contains the scratch space pointer - which is definitely
not of any use.  The GS payload also contains FFTID, but the URB write
message header doesn't want FFTID.

The only reason I used OR was because Eric originally requested it.
On Broadwell, I used MOV, and that's worked out fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
efc818e3a4 i965/fs: Don't set flag_subreg_nr = 1 on predicated FB write setup.
On Haswell, we implement "discard" via predicated SEND messages, using
f0.1 instead of f0.0.  To accomplish this, we set inst->flag_subreg to 1
on the FS_OPCODE_FB_WRITE.

Most instructions using fs_inst::flag_subreg expand to a single assembly
instruction.  However, FS_OPCODE_FB_WRITE can generate several MOVs for
setting up header information.  We don't want to set flag_subreg on
those, so override the default state back to 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
2e180e4c09 i965/vec4: Respect ir->force_writemask_all in Gen8 code generation.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-12 13:39:25 -07:00
Kenneth Graunke
7b6b61ba83 i965/vec4: Set NoMask for GS_OPCODE_SET_VERTEX_COUNT on Gen8+.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-12 13:39:24 -07:00
Jason Ekstrand
97d57f1142 gallium/r300: Fix a link error in the tests
The link error occurs because the static libraries are linked in the wrong
order.  This fixes it.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82483
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-08-12 11:35:07 -07:00
Matt Turner
e005c1148d i965: Return NONE from brw_swap_cmod on unknown input.
Comparing ~0u with a packed enum (i.e., 1 byte) always evaluates to
false. Shouldn't gcc warn about this?

Reported-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-12 11:09:45 -07:00
Neil Roberts
ab66b19669 docs: Update release notes and GL3.txt for GL_ARB_texture_compression_bptc
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
a018a3f3f5 mesa/meta: Support decompressing floating-point formats
Previously the Meta implementation of glGetTexImage would fall back to
_mesa_get_teximage if the texturing is not using an unsigned normalised
format. However in order to support the half-float formats of BPTC textures we
can make it render to a floating-point renderbuffer instead. This patch makes
decompression_state have two FBOs, one for the GL_RGBA format and one for
GL_RGBA32F. If a floating-point texture is encountered it will try setting up
a floating-point FBO. It will now also check the status of the FBO and fall
back to _mesa_get_teximage if the FBO is not complete.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
817051ab5b swrast: Enable GL_ARB_texture_compression_bptc
Enables BPTC texture compression on the software rasterizer.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
9782b8a80c i965: Enable the GL_ARB_texture_compression_bptc extension
Enables the BPTC extension on Gen>=7 and adds the necessary format mappings to
get the right surface type value.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
88a8830390 mesa/main: Modify generate_mipmap_compressed to cope with float textures
Once we add BPTC texture support we will need to generate mipmaps for
compressed floating point textures too. Most of the code seems to already be
there but it just needs a few extra lines to get it to use GL_FLOAT instead of
GL_UNSIGNED_BYTE as the type for the temporary buffers.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
17cde55c53 mesa: Add texstore functions for BPTC-compressed textures
This adds compressors for all four of the BPTC compressed-texture formats. The
compressor is written from scratch and takes a very simple approach. It always
uses a single mode of the BPTC format (4 for unorm and 3 for half-floats) and
picks the two endpoints by dividing the texels into those which have more or
less than the average luminance of the block and then calculating an average
color of the texels within each division.

It's probably not really sensible to try to use BPTC compression at runtime
because for example with the Nvidia offline compression tool it can take in
the order of an hour to compress a full-screen image. With that in mind I
don't think it's worth having a proper compressor in Mesa and this approach
gives reasonable results for a usage that is basically a corner case.

v2: Always use the custom compressor, even for the unorm formats. Fix the
    quantization step for the half-float format compressor. Fixed a typo which
    was breaking the right-hand edge of half-float textures with a width that
    isn't a multiple of four.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
442bcd7fd3 mesa: Add texel fetch functions for BPTC-compressed textures
Adds functions to fetch from any of the four BPTC-compressed formats.

v2: Set the alpha component to 1.0 when fetching from the half-float formats
    instead of leaving it uninitialised. Don't linearize the alpha component
    when fetching from sRGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
7e78033c11 mesa: Add the format enums for BPTC-compressed images
This adds the following four Mesa image format enums which correspond to the
four BPTC compressed texture formats:

 MESA_FORMAT_BPTC_RGBA_UNORM
 MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM
 MESA_FORMAT_BPTC_RGB_SIGNED_FLOAT
 MESA_FORMAT_BPTC_RGB_UNSIGNED_FLOAT

It also updates the format information functions to handle these and the
corresponding GL enums.

v2: Also modify _mesa_get_format_color_encoding, _mesa_get_srgb_format_linear
    and _mesa_get_uncompressed_format

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:23:50 +01:00
Neil Roberts
cc9c30b8a7 mesa/format_info: Add support for the BPTC layout
Adds the ‘bptc’ layout to get_channel_bits. The channel bits for BPTC depend
on the mode but as it only has to be an approximation this sets it to 8 for
the two UNORM formats and 16 for the two half-float formats. These represent
the minimum number of bits of variation that can be generated by the
interpolation of the two formats.

This doesn't quite match what we do for S3TC which only returns 4 even though
it can similarly generate 8 bits from the interpolation. However it does match
what we return for ETC2. For reference, NVidia seems to return 8 bits for the
UNORM formats and 32 bits for the half-float formats.

v2: Change the number of bits to 8/8/8/8 for the UNORM formats and 16/16/16
    for the half-float formats.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-12 18:23:38 +01:00
Neil Roberts
84218b598f mesa/format_info: Add support for compressed floating-point formats
If the name of a compressed texture format has ‘FLOAT’ in it it will now set
the data type of the format to GL_FLOAT. This will be needed for the BPTC
half-float formats.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:00:26 +01:00
Neil Roberts
0c6e230eb1 mesa: Fix the base format for GL_COMPRESSED_RGB_BPTC_*_FLOAT_ARB
The signed and unsigned half-float BPTC-compressed formats were being reported
as having a base format of GL_RGBA but they don't store an alpha channel so it
should be GL_RGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:00:26 +01:00
Neil Roberts
5ceb4bff33 mesa: Add the GL_ARB_texture_compression_bptc extension
This adds a boolean in the gl_extensions struct for
GL_ARB_texture_compression_bptc as well as an entry in extension_table.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-12 18:00:26 +01:00
Andreas Boll
36771dc60f winsys/radeon: fix nop packet padding for hawaii
The initial firmware for hawaii does not support type3 nop packet.
Detect the new hawaii firmware with query RADEON_INFO_ACCEL_WORKING2.
If the returned value is 3, then the new firmware is used.

This patch uses type2 for the old firmware and type3 for the new firmware.

It fixes the cases when the old firmware is used and the user wants to
manually enable acceleration.
The two possible scenarios are:
 - the kernel has no support for the new firmware.
 - the kernel has support for the new firmware but only the old firmware
   is available.

Additionaly this patch disables GPU acceleration on hawaii if the kernel
returns a value < 2. In this case the kernel hasn't the required fixes
for proper acceleration.

v2:
 - Fix indentation
 - Use private struct radeon_drm_winsys instead of public struct radeon_info
 - Rename r600_accel_working2 to accel_working2

v3:
 - Use type2 nop packet for returned value < 3

v4:
 - Fail to initialize winsys for returned value < 2

Cc: mesa-stable@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-12 12:16:06 -04:00
Brian Paul
fa5b76e3a2 mesa: regenerate gl_mangle.h
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:45 -06:00
Brian Paul
0a96e7adaa mesa: update wglext.h to version 20140810
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:45 -06:00
Brian Paul
eeb7fc8b7d mesa: update glxext.h to version 20140810
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:45 -06:00
Brian Paul
b7d36efe93 mesa: update glext.h to version 20140810
This brings in the new OpenGL 4.5 features.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 08:09:44 -06:00
Charmaine Lee
0c065270c0 svga: Add a limit to the maximum surface size
This patch adds a limit to the maximum surface size which is
based on the maximum size of a single mob. If this value is not
available, the maximum surface size is by default set to 128 MB.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-12 08:03:24 -06:00
José Fonseca
d839be24b3 mesa/st: Move declaration to top of block.
To fix MSVC build failure.

Trivial.
2014-08-12 14:25:37 +01:00
Ilia Mirkin
6174f49170 mesa/st: add support for dynamic sampler offsets
Replace the plain sampler index with a register reference to a sampler.
We also need to keep track of the sampler array size when there is a
relative reference so that we can mark the whole array used.

To facilitate implementation, we add a separate ADDR register that
exclusively handles the sampler relative address. Other approaches would
be more invasive.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-12 08:52:14 -04:00
Christian König
83012b5085 radeon/uvd: fix gpu_address for video surfaces
We need to get the new gpu_address as well when
reallocating the cs buffer.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2014-08-12 11:53:52 +02:00
Chris Forbes
3b48f6a4c0 mesa: Add a new function for getting the nonconst sampler array index
If the array index is not a constant expression, the existing support
will assume a zero offset (giving us the sampler index of the base of
the array).

For dynamically uniform indexing of sampler arrays, we need both that
and the indexing expression.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 19:18:55 +12:00
Chris Forbes
1b4761bc27 glsl: Allow dynamically uniform sampler array indexing with 4.0/gs5
V2: Expand comment to explain what dynamically uniform expressions are
about.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-12 19:17:56 +12:00
Ilia Mirkin
f525bd01d1 nvc0/ir: describe the tex arguments for fermi/kepler
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 19:07:34 -04:00
Ilia Mirkin
b3cbd86224 nvc0/ir: add kepler+ support for indirect texture references
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 19:07:34 -04:00
Ilia Mirkin
af3619e880 nvc0/ir: add base tex offset for fermi indirect tex case
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 19:07:34 -04:00
Kenneth Graunke
f73594778b i965: Revert part of f5cc3fdcf1.
Fixes non-termination in various Piglit tests.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-11 15:07:17 -07:00
Eric Anholt
602a3f92d4 vc4: Flip which primitives are considered front-facing.
This mostly fixes glxgears rendering.
2014-08-11 14:47:54 -07:00
Eric Anholt
f097516505 vc4: Don't forget to set the depth clear value in the packet.
This gets glxgears partially rendering again.
2014-08-11 14:47:54 -07:00
Eric Anholt
e63598aecb vc4: Add support for gl_FragCoord.
This isn't passing all tests (glsl-fs-fragcoord-zw-ortho, for example),
but it does get a bunch more tests passing.

v2: Rebase on helpers change.
2014-08-11 14:47:54 -07:00
Eric Anholt
d34fbdda12 vc4: Refactor shader input setup again.
This makes some space for handling special inputs like fragcoords.
2014-08-11 14:47:54 -07:00
Eric Anholt
a7faca5d27 vc4: Clean up the tile alloc buffer size.
This prevents some simulator assertion failures, but it does mean (since
I've dropped the "* 16" padding) that on real hardware you need a kernel
that does overflow memory management (currently, "drm/vc4: Add support for
binner overflow memory allocation." in my kernel tree).
2014-08-11 14:47:51 -07:00
Eric Anholt
7050ab510d vc4: Clarify some values implicitly chosen for binning config.
These #defines are 0, but it should help make math above make more sense.
2014-08-11 14:45:32 -07:00
Eric Anholt
ed5cb5d7d5 vc4: Improve simulator memory allocation.
This should reduce a bunch of spurious failures in sim.
2014-08-11 14:45:32 -07:00
Eric Anholt
f5f8dd29c3 vc4: Handle stride==0 in VBO validation 2014-08-11 14:45:32 -07:00
Eric Anholt
0f034055f9 vc4: Stash some debug code for looking at what BOs are at what hindex.
When you're debugging validation, it's nice to know what the BOs are for.
2014-08-11 14:45:32 -07:00
Eric Anholt
8ebfa8fdb2 vc4: Use GEM under simulation even for non-winsys BOs.
In addition to reducing sim-specific code, it also avoids our local handle
allocation conflicting with the host GEM's handle numbering, which was
causing vc4_gem_hindex() to not distinguish between winsys BOs and the
same-numbered non-winsys bo.
2014-08-11 14:45:32 -07:00
Eric Anholt
cdc208bdaf vc4: Don't forget to unmap the GEM BO when freeing.
Otherwise it'll stick around forever.
2014-08-11 14:45:32 -07:00
Eric Anholt
d2cc7f97df vc4: Add validation of raster-format textures.
... and reject everything else, for now.

v2: Rebase on v2 of the rendering config validation change.
2014-08-11 14:45:32 -07:00
Eric Anholt
b384d16733 vc4: Drop VC4_PACKET_PRIMITIVE_LIST_FORMAT.
It's not relevant to our command streams any more.

v2: Fix indentation and a typo in the comment.
2014-08-11 14:45:32 -07:00
Eric Anholt
3aba1b124f vc4: Add validation that vertex indices don't overflow VBO bounds. 2014-08-11 14:45:32 -07:00
Eric Anholt
5692122147 vc4: Fix the shader record size for extended strides.
It turns out they aren't packed when attributes are missing, according to
both docs and simulation.
2014-08-11 14:45:32 -07:00
Eric Anholt
aaff32ded0 vc4: Fix the shader record size for extended strides.
It turns out they aren't packed when attributes are missing, according to
both docs and simulation.

v2: Drop unused variable.
2014-08-11 14:45:31 -07:00
Eric Anholt
9f24e4e6ed vc4: Add a bunch of validation of render mode configuration.
v2: Fix a build break after some previous rebase.
2014-08-11 14:45:31 -07:00
Eric Anholt
ff4748491b vc4: Store the (currently always linear) tiling format in the resource. 2014-08-11 14:45:31 -07:00
Eric Anholt
0bc2aed90f vc4: Add a bunch of validation of the binning mode config. 2014-08-11 14:45:31 -07:00
Eric Anholt
b6caa9556c vc4: Validate that the same BO doesn't get reused for different purposes.
We don't care if things like vertex data get smashed by render target
data, but we do need to make sure that shader code doesn't get rendered
to.

v2: Fix overflowing read of gl_relocs[] that incorrect flagged of some
    VBOs as shader code.
2014-08-11 14:45:31 -07:00
Eric Anholt
fa26d334cb vc4: Use the packet #defines in the kernel validation code. 2014-08-11 14:45:31 -07:00
Eric Anholt
5969f9b79c vc4: Rename GEM_HANDLES to be in a namespace.
It's not a real VC4 hardware packet, but I've put in a comment to explain
it.
2014-08-11 14:45:31 -07:00
Eric Anholt
27b8a0a025 vc4: Clean up TMU write validation.
The comment conflicted with the support in the code, so I moved the TMU
write validation to where the comment was, and dropped some dead arguments
from the functions while changing their signatures.
2014-08-11 14:45:31 -07:00
Eric Anholt
7969a15325 vc4: Update a comment about shader validation 2014-08-11 14:45:31 -07:00
Eric Anholt
99070c6daa vc4: Add proper translation from Zc to Zs for vertex output.
This fixes the remaining failure in depthfunc.
2014-08-11 14:45:31 -07:00
Eric Anholt
4160ac5ee4 vc4: Add support for depth clears and tests within a tile.
This doesn't load/store the Z contents across submits yet.  It also
disables early Z, since it's going to require tracking of Z functions
across multiple state updates to track the early Z direction and whether
it can be used.

v2: Move the key setup to before the search for the key.
2014-08-11 14:45:31 -07:00
Eric Anholt
2259cc5aeb vc4: Avoid flushing when mapping buffers that aren't in the batch.
This should prevent a bunch of unnecessary flushes for things like
updating immediate vertex data.
2014-08-11 14:45:31 -07:00
Eric Anholt
6b2583412f vc4: Drop the flush at the end of the draw
Now we actally get multiple draw calls per submit.
2014-08-11 14:45:31 -07:00
Eric Anholt
c047f13603 vc4: Align following shader recs to 16 bytes.
Otherwise, the low address bits will end up being interpreted as attribute
counts.
2014-08-11 14:45:31 -07:00
Eric Anholt
766ca5c7a5 vc4: Fix a potential src buffer overflow in shader rec validation. 2014-08-11 14:45:31 -07:00
Eric Anholt
027d730aff vc4: Keep a reference to BOs queued for rendering.
Otherwise, once we're not flushing at the end of every draw, we'll free
things like gallium resources, and free the backing GEM object, before
we've flushed the rendering using it to the kernel.
2014-08-11 14:45:30 -07:00
Eric Anholt
771d86abd6 vc4: Compute the proper end address of the relocated command lists.
render_cl_size/bin_cl_size includes relocations, while the hardware buffer
doesn't.  If you don't emit a HALT packet, the command parser continues
until the end register's value.  We can't allow executing unvalidated
buffer contents (and it's actually harmful in the render lists Mesa is
emitting, since VC4_PACKET_STORE_MS_TILE_BUFFER_AND_EOF doesn't trigger a
halt).
2014-08-11 14:45:30 -07:00
Eric Anholt
c58f35393e vc4: Walk tiles horizontally, then vertically.
I was confused looking at my addresses in dumps because I was seeing the
tile branch offsets jumping all over.
2014-08-11 14:45:30 -07:00
Eric Anholt
165ca6b5ad vc4: Track clears veresus uncleared draws, and the clear color.
This is a step toward queueing more than one draw per frame.

Fixes piglit attribute0 test, since we get a working clear color now.
2014-08-11 14:45:30 -07:00
Eric Anholt
9c631f30c9 vc4: Move the rest of RCL setup to flush time.
We only want to set up render target config and clear colors once per
frame.
2014-08-11 14:45:30 -07:00
Eric Anholt
100e5679c7 vc4: Move render command list calls to vc4_flush() 2014-08-11 14:45:30 -07:00
Eric Anholt
fbaac8407a vc4: Move bin command list ending commands to vc4_flush() 2014-08-11 14:45:29 -07:00
Eric Anholt
5e062cb2b4 vc4: Rename fields in the kernel interface.
I decided I didn't like "len" compared to "size", and I keep typing
shader_rec instead of shader_record[s] elsewhere, so make it consistent.
2014-08-11 14:45:28 -07:00
Eric Anholt
2b16b3d75f vc4: Fix things to validate more than one shader state in a submit. 2014-08-11 14:45:28 -07:00
Eric Anholt
a8f2bf0f51 vc4: Rewrite the kernel ABI to support texture uniform relocation.
This required building a shader parser that would walk the program to find
where the texturing-related uniforms are in the uniforms stream.

Note that as of this commit, a new kernel is required for rendering on
actual VC4 hardware (currently that commit is named "drm/vc4: Introduce
shader validation and better command stream validation.", but is likely to
be squashed as part of an eventual merge of the kernel driver).
2014-08-11 14:45:28 -07:00
Eric Anholt
6a5ece12aa vc4: Add docs for the drm interface 2014-08-11 14:45:28 -07:00
Eric Anholt
11fbee3201 vc4: Add load/store to the validator 2014-08-11 14:40:45 -07:00
Eric Anholt
a3cd3c0d19 vc4: Switch simulator to using kernel validator
This ensures that when I'm using the simulator, I get a closer match to
what behavior on real hardware will be.  It lets me rapidly iterate on the
kernel validation code (which otherwise has a several-minute turnaround
time), and helps catch buffer overflow bugs in the userspace driver
faster.
2014-08-11 14:40:45 -07:00
Eric Anholt
a02c658908 vc4: Drop pointless shader state struct 2014-08-11 14:40:45 -07:00
Eric Anholt
857dcc09fa vc4: Add support for texture rectangles
v2: Rebase on helpers change.
2014-08-11 14:40:45 -07:00
Eric Anholt
66c6c40127 vc4: Add support for texturing (under simulation)
Only rgba8888 works, and only a single texture unit, and it's only under
simulation because I haven't built the kernel interface yet.

v2: Rebase on helpers.
v3: Fold in the don't-break-the-arm-build fix.
2014-08-11 14:40:45 -07:00
Eric Anholt
d5a6e3dd9b vc4: Drop PIPE_SHADER_CAP_MAX_ADDRS
Fixes the build since c10332bbb8
2014-08-11 14:40:42 -07:00
Marek Olšák
c10332bbb8 gallium: remove PIPE_SHADER_CAP_MAX_ADDRS
This limit is fixed in Mesa core and cannot be changed.
It only affects ARB_vertex_program and ARB_fragment_program.

The minimum value for ARB_vertex_program is 1 according to the spec.
The maximum value for ARB_vertex_program is limited to 1 by Mesa core.

The value should be zero for ARB_fragment_program, because it doesn't
support ARL.

Finally, drivers shouldn't mess with these values arbitrarily.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
718d4b97ef st/mesa: compute supported GL versions at DRIscreen creation
This computes all GL versions before any context is created.
It's a requirement for GLX_MESA_query_renderer.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
fceadfe7ef gallium: pass st_config_options to query_versions
So move it from dri_context to dri_screen.
This will be needed for version computations.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
f1f5366629 mesa: return version 0 if the computed core profile version is too low
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
7207830047 mesa: add _mesa_get_version, a ctx-independent variant of _mesa_compute_version
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
537cbb7e1a mesa: add a context-independent variant of _mesa_override_gl_version
v2: changed GLboolean -> bool

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
ee9a2b1ae9 mesa: make _mesa_init_constants context-independent and public
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
858452e542 mesa: make _mesa_init_extensions context-independent
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
35e755faa7 st/mesa: make st_init_limits context-independent
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
002211f9ee mesa: move ShaderCompilerOptions into gl_constants
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
5c69173907 st/mesa: make st_init_extensions context-independent
Setting Const.MaxSamples needed a rework, so that it doesn't call
st_choose_format, which depends on st_context.

Other than that, there is no change in functionality.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
d9a6f4360a mesa: make _mesa_override_glsl_version context-independent
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
c6cbde5008 gallium/stapi: move setting GL versions to the state tracker
All flags are set for st/mesa, so the state tracker doesn't have to check
them.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-11 21:53:57 +02:00
Marek Olšák
0127d26e6c st/mesa: convert the ETC1 format to an uncompressed one if unsupported
I don't know of any hardware which supports it.
With this, GL_OES_compressed_ETC1_RGB8_texture is supported if RGBA8
is supported.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-08-11 21:53:57 +02:00
Marek Olšák
547e2880bc st/mesa: add st_context parameter to st_mesa_format_to_pipe_format
This will be used by the next commit.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
2014-08-11 21:53:57 +02:00
Marek Olšák
3d56732c1f st/mesa: advertise ARB_ES3_compatibility if GLSL 3.30 and ETC2 are supported 2014-08-11 21:53:57 +02:00
Marek Olšák
463b0ea1f6 st/mesa: add support for ETC2 formats
The formats are emulated by translating them into plain uncompressed
formats, because I don't know of any hardware which supports them.

This is required for GLES 3.0 and ARB_ES3_compatibility (GL 4.3).
2014-08-11 21:53:57 +02:00
Marek Olšák
ddc8003c61 mesa: add helper _mesa_is_format_etc2
v2: renamed GLboolean -> bool

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-11 21:53:57 +02:00
Brian Paul
f24be73401 mesa: add missing GLAPIENTRY in copyimage.c
Fixes MinGW build.  Trivial.
2014-08-11 12:59:47 -06:00
Jason Ekstrand
f5cc3fdcf1 i965/cse: Don't eliminate instructions with side-effects
This casues problems when converting atomics to use the GRF.  Sometimes the atomic operation would get eaten by CSE when it shouldn't.

v2: Roll the has_side_effects check into is_expression

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-11 11:40:32 -07:00
Jason Ekstrand
34ee3f5a34 docs/GL3: Mark ARB_copy_image as implemented on i965 2014-08-11 11:26:14 -07:00
Jason Ekstrand
410fea8dd9 i965: Add support for ARB_copy_image
This, together with the meta path, provides a complete implemetation of
ARB_copy_image.

v2: Add a fallback memcpy path for when the texture is too big for the
    blitter
v3: Properly support copying between two places on the same texture in the
    memcpy fallback
v4: Properly handle blit between the same two images in the fallback path
v5: Properly handle blit between the same two compressed images in the
    fallback path
v6: Fix a typo in a comment

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-08-11 11:26:14 -07:00
Jason Ekstrand
8ad7c1903d mesa/meta: Add a partial implementation of CopyImageSubData
This provides an implementation of CopyImageSubData that works if both
textures are uncompressed.  This implementation works by using a
combination of texture views and BlitFramebuffer.  If one of the textures
is compressed, it returns false and the driver is expected to provide a
fallback.

v2: Don't leak fbo's

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>

v3: Change glGen/DeleteTextures to _mesa_Gen/DeleteTextures
2014-08-11 11:26:00 -07:00
Jason Ekstrand
80a8b020c0 mesa/meta: Make _mesa_meta_bind_fbo_image also take a framebuffer target
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-08-11 11:20:23 -07:00
Jason Ekstrand
41b6460e08 mesa: Add GL API support for ARB_copy_image
This adds the API entrypoint, error checking logic, and a driver hook for
the ARB_copy_image extension.

v2: Fix a typo in ARB_copy_image.xml and add it to the makefile
v3: Put ARB_copy_image.xml in the right place alphebetically in the
    makefile and properly prefix the commit message
v4: Fixed some line wrapping and added a check for null
v5: Check for incomplete renderbuffers

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>

v6: Update dispatch_sanity for the addition of CopyImageSubData
2014-08-11 11:20:23 -07:00
Matt Turner
23d782067a i965/fs: Keep track of the register that hold delta_x/delta_y.
They're needed in register allocation. Fixes a regression since
afe3d155.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78875
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-11 10:40:01 -07:00
Matt Turner
41bdad59ab i965: Mark branch unreachable in sampler state code.
Silences some uninitialized variable warnings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-11 10:40:01 -07:00
Brian Paul
904ed3b315 mesa: simplify _mesa_update_draw_buffers()
There's no need to copy the array of DrawBuffer enums to a temp array.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:51 -06:00
Brian Paul
39b40ad144 mesa: fix assertion in _mesa_drawbuffers()
Fixes failed assertion when _mesa_update_draw_buffers() was called
with GL_DRAW_BUFFER == GL_FRONT_AND_BACK.  The piglit gl30basic hit
this.

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-11 09:44:51 -06:00
Brian Paul
dd8f15a553 mesa: whitespace, 80-column wrapping in program.c
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:50 -06:00
Brian Paul
d8f7577d5f mesa: simplify/rename _mesa_init_program_struct()
No need to return a value.  Remove unused ctx parameter.  Remove
_mesa_ prefix since it's static.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:50 -06:00
Brian Paul
53b13b2ead st/mesa: use PRId64 for printing 64-bit ints
v2: use signed types/formats

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:50 -06:00
Brian Paul
80fa7fd23e mesa: use PRId64 for printing 64-bit ints
Silences MinGW warnings:
 warning: unknown conversion type character ‘l’ in format [-Wformat]
 warning: too many arguments for format [-Wformat-extra-args]

v2: use signed types/formats

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:44:44 -06:00
Brian Paul
a5743fdf7d mesa: define and use ALL_TYPE_BITS in varray.c code
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:37:50 -06:00
Brian Paul
288f887622 mesa: add comment that GL_CLIP_DISTANCE0 == GL_CLIP_PLANE0 in enable.c
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-11 09:37:50 -06:00
Maarten Lankhorst
4c16e6a8e0 configure.ac: Do not require llvm on x32
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
2014-08-11 13:16:11 +02:00
Neil Roberts
1b417ea784 i965: Don't check for format differences when using the blorp blitter
Previously the blorp blitter wouldn't be used if the source and destination
buffer had a different format other than swizzling between RGB and BGR and
adding or removing a dummy alpha channel. However there's no reason why the
blorp code path can't be used to do almost all format conversions so this
patch just removes the checks. However it does explicitly disable converting
to/from MESA_FORMAT_Z24_UNORM_X8_UINT because there is a similar check
brw_blorp_copytexsubimage.

This doesn't cause any Piglit test regressions at least on Ivybridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-11 11:24:46 +01:00
Kenneth Graunke
9276ef6f41 i965/eu: Allow math on immediates on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
db64c2eee2 i965/eu: Update jump distance scaling for Broadwell.
Broadwell measures jump distances in bytes, so we need to scale by 16.

v2: Update the function in brw_eu.h, not in brw_eu_emit.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
82ddd517af i965/eu: Refactor jump distance scaling to use a helper function.
Different generations of hardware measure jump distances in different
units.  Previously, every function that needed to set a jump target open
coded this scaling, or made a hardcoded assumption (i.e. just used 2).

Most functions start with the number of instructions to jump, and scale
up to the hardware-specific value.  So, I made the function match that.

Others start with a byte offset, and divide by a constant (8) to obtain
the jump distance.  This is actually 16 / 2 (the jump scale for Gen5-7).

v2: Make the helper a static inline defined in brw_eu.h, instead of
    an actual function in brw_eu_emit.c (as suggested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
a1c899c718 i965/eu: Set UIP on ELSE instructions on Broadwell.
Broadwell adds UIP on ELSE instructions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
7d41170b62 i965/eu: Make it clear that brw_patch_break_count only runs on Gen4-5.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
0457464c33 i965/eu: Make it clear that brw_find_loop_end only runs on Gen6+.
It has Gen6+ knowledge baked in, and indeed is only called for Gen6+,
but it wasn't immediately obvious that this was the case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
0d6adce469 i965/eu: Port Broadwell CMP destination type hack to brw_eu_emit.c.
See gen8_generator::CMP().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:34 -07:00
Kenneth Graunke
49519a1b63 i965/eu: Explicitly disable instruction compaction on Broadwell for now.
Until now, it's been off implicitly: we never call the compactor
function.  When we merge the generators, we'll start calling it, so we
should make it do nothing.

Matt will enable instruction compaction properly later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:32:33 -07:00
Kenneth Graunke
8609df97a0 i965/eu: Use Haswell atomic messages on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:03:45 -07:00
Kenneth Graunke
e1bd2ca28a i965/eu: Change gen == 7 to gen >= 7 in a couple brw_eu_emit.c cases.
Broadwell is going to use the brw_eu_emit.c code soon.  We want to get
the fake MRF handling and URB HWord channel mask handling.

We don't need the CMP thread switch workaround, though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-10 19:01:52 -07:00
Ben Widawsky
38e181bad2 i965/clip: Removing scissor atom
Now that we no longer use ctx->DrawBuffer->_Xmin and related fields to
program the screen-space viewport extents, we don't depend on any
scissoring state.  So we can drop the +_NEW_SCISSOR dependency.

On GEN8, a change in scissor state does not effect anything for the
clipper/sf hardware state. The hardware will always do the right thing
once the viewport extents are programmed. We can therefore remove the
unecessary state emission.

Ken originally spotted this.

v2: Reword the commit message. Remove spurious hunk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-10 17:13:36 -07:00
Ben Widawsky
f6725d627c i965/guardband: Enable for all viewport dimensions (GEN8+)
The goal of guardband clipping is to try to avoid 3d clipping because it
is an expensive operation. When guardband clipping is disabled, all
geometry that intersects the viewport is sent to the FF 3d clipper.
Objects which are entirely enclosed within the viewport are said to be
"trivially accepted" while those entirely outside of the viewport are,
"trivially rejected".

When guardband clipping is turned on the above behavior is changed such
that if the geometry is within the guardband, and intersects the
viewport, it skips the 3d clipper. Prior to GEN8, this was problematic
if the viewport was smaller than the screen as it could allow for
rendering to occur outside of the viewport. That could be mitigated if
the programmer specified a scissor region which was less than or equal
to the viewport - but this is not required for correctness in OpenGL. In
theory you could be clever with the guardband so as not to invoke this
problem. We do not do this, and have no data that suggests we should
bother (nor the converse data).

With viewport extents in place on GEN8, it should be safe to turn on
guardband clipping for all cases

While here, add a comment to the code which confused me thoroughly.

v2: Update grammar in commit message. Reword comments based on Ken's
suggestion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-10 17:13:36 -07:00
Ben Widawsky
1a20e38ccf i965: Simplify viewport extents programming on GEN8
Viewport extents are a 3rd rectangle that defines which pixels get
discarded as part of the rasterization process. The actual pixels drawn
to the screen are an intersection of the drawing rectangle, the viewport
extents, and the scissor rectangle. It permits the use of guardband
clipping in all cases (see later patch). The actual pixels drawn to the
screen are an intersection of the drawing rectangle, the viewport
extents, and the scissor rectangle.

Scissor rectangle is not super important for this discussion as it should
always help do the right thing provided the programmer uses it.

switch (viewport dimensions, drawrect dimension) {
   case viewport > drawing rectangle: no effects; break;
   case viewport == drawing rectangle: no effects; break;
   case viewport < drawing rectangle:
      Pixels (after the viewport transformation but before expensive
      rastersizing and shading operations) which are outside of the
      viewport are discarded.
}

I am unable to find a test case where this improves performance, but in
all my testing it doesn't hurt performance, and intuitively, it should
not ever hurt performance. It also permits us to use the guardband more
freely (see upcoming patch).

v2: Updating commit message.

v3: Commit message updates requested by Ken

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-10 17:13:36 -07:00
Ben Widawsky
109d420f42 i965/guardband: Improve comments for guardband clipping
While working in this part of the code I had a great deal of trouble
understanding what it was trying to do, and matching it with the spec.
(mostly due bad wording in the PRM). To help future people, I've cleaned
up the wording and provided some ascii art.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-10 17:13:36 -07:00
Kenneth Graunke
31f1cbc24d i965: Support the allow_glsl_extension_directive_midshader option.
This adds support for Marek's new driconf parameter, which avoids
totally white rendering in Unigine Valley (which attempts to enable
the GL_ARB_sample_shading extension in an illegal place).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75664
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-10 16:22:31 -07:00
Connor Abbott
b6df68ba56 i965/fs: set virtual_grf_count in assign_regs()
This lets us call dump_instructions() after register allocation without
failing an assertion.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-08-10 15:00:53 -07:00
Connor Abbott
58007aec41 i965/fs: don't read from uninitialized memory while assigning registers
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-08-10 15:00:52 -07:00
Matt Turner
59a26a0554 i965/fs: Fix bad whitespace. 2014-08-10 15:00:52 -07:00
Niels Ole Salscheider
3d5e247de6 gallium/radeon: Set gpu_address to 0 if r600_virtual_address is false
Without this patch I get the following during DMA transfers:
[drm:radeon_cs_ib_chunk] *ERROR* Invalid command stream !
radeon 0000:01:00.0: CP DMA dst buffer too small (21475829792 4096)

This is a fixup for e878e154cd.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-10 12:54:34 +02:00
Marek Olšák
a65611f70a radeonsi: simplify constant buffer upload for big endian
Point util_memcpy_cpu_to_le32 to a buffer storage directly.

v2: simplify more

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-10 12:52:13 +02:00
Marek Olšák
b1843a2d2a winsys/radeon: fix compile warnings 2014-08-09 23:48:41 +02:00
Marek Olšák
b5f877ef7e r600g/compute: fix compile warnings
Trivial.
2014-08-09 23:41:16 +02:00
Marek Olšák
3d06952d9e r300g: handle new shader caps
Trivial.
2014-08-09 23:41:16 +02:00
Marek Olšák
955505f6ff radeonsi: fix CMASK and HTILE allocation on Tahiti
Tahiti has 12 tile pipes, but P8 pipe config.

It looks like there is no way to get the pipe config except for reading
GB_TILE_MODE. The TILING_CONFIG ioctl doesn't return more than 8 pipes,
so we can't use that for Hawaii.

This fixes a regression caused by 9b046474c9
on Tahiti.

v2: add an assertion and print an error on failure

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-09 23:41:16 +02:00
Marek Olšák
00ddf7a016 gallium/radeon: remove r600_resource_va
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:16 +02:00
Marek Olšák
8c235465cd gallium/radeon: use gpu_address from r600_resource
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:16 +02:00
Marek Olšák
f6c392a270 r600g: use gpu_address from r600_resource
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
1c03a690bf radeonsi: use gpu_address from r600_resource
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
e878e154cd gallium/radeon: store VM address in r600_resource
This will help to get rid of the buffer_get_virtual_address calls.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
43b5c34cc3 r600g: remove useless r600_resource_va calls
R600-R700 don't support virtual memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
0e229b8c5a radeonsi: always prefer SWITCH_ON_EOP(0) on CIK
The code is rewritten to take known constraints into account, while always
using 0 by default.

This should improve performance for multi-SE parts in theory.

A debug option is also added for easier debugging. (If there are hangs,
use the option. If the hangs go away, you have found the problem.)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

v2: fix a typo, set max_se for evergreen GPUs according to the kernel driver
2014-08-09 23:41:15 +02:00
Marek Olšák
515269b3a7 radeonsi: fix a hang with instancing in Unigine Heaven/Valley on Hawaii
This isn't documented anywhere, but it's the only thing that works
for this case.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
085a861545 radeon,r200: fix buffer validation after CS flush
This validates all bound buffers (CB, ZB, textures, DMA) at the beginning
of CS. This fixes "bo->space_accouned" assertion failures.

Tested by: Jochen Rollwagen <joro-2013@t-online.de>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
0b5d88a518 st/mesa: fix blit-based partial TexSubImage for 1D arrays
This fixes piglit spec/EXT_texture_array/render-1darray.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
56286834b8 st/mesa: fix DrawPixels(GL_STENCIL_INDEX)
This is a bug which was probably uncovered recently by Jason's commits
and broke this.

The problem is _mesa_base_tex_format(GL_STENCIL_INDEX) returns -1.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-09 23:41:15 +02:00
Marek Olšák
88e0a2f88b st/mesa: dump TGSI before calling into the driver
If the driver crashes in create_xx_shader, you want to see the shader.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-08-09 23:41:15 +02:00
Jon TURNEY
a2e1dc0cce configure.ac: Use LIBS rather than LDFLAGS to add -ldl to dladdr check
ec8ebff "Check for dladdr()" erroneously uses LDFLAGS rather than LIBS to add
-ldl to the dladdr check.

Replace the workaround in 39a4cc4 of explicitly checking in libdl, with a more
correct approach of using LIBS.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-09 11:18:31 +01:00
Eric Anholt
7b4b60b7e5 vc4: Add support for the COS instruction. 2014-08-08 18:59:47 -07:00
Eric Anholt
663ffff0e7 vc4: Add support for the SIN instruction.
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
d815b2490b vc4: Fix register aliasing for packing of scaled coordinates.
Fixes glean fragProg1's "ADD test" and likely many others.
2014-08-08 18:59:47 -07:00
Eric Anholt
9492eb588d vc4: Add some debug code for forcing fragment shader output color. 2014-08-08 18:59:47 -07:00
Eric Anholt
961715eab2 u_primconvert: Copy min/max_index from the original primitive.
These values are supposed to be the minimum/maximum index values used to
read from the vertex buffers.  This code either copies index values out of
the old IB (so, same min/max as the original draw call), or generates a
new IB (using index values between the start and the start + count of the
old array draw info, which just happens to be what min/max_index are set
to by st_draw.c).

We were incorrectly setting the max_index in the
converting-from-glDrawArrays case to the start vertex plus the number of
vertices generated in the new IB, which broke QUADS primitive conversion
on VC4 (where max_index really has to be correct, or the kernel might
reject your draw call due to buffer overflow).

Reviewed-by: Rob Clark <robclark@freedesktop.org> (from verbal description
             of the patch)
2014-08-08 18:59:47 -07:00
Eric Anholt
1d03692f78 vc4: Fix using and emitting the 1/W from the vertex/coord shaders.
v2: Rebase on helpers change.
2014-08-08 18:59:47 -07:00
Eric Anholt
88bc5baa00 vc4: Add support for swizzles of 32 bit float vertex attributes.
Some tests start working (useprogram-flushverts, for example) due to
getitng the right vertices now.  Some that used to pass start failing with
memory overflow during binning, which is weird (glsl-fs-texture2drect).
And a couple stop rendering correctly (glsl-fs-bug25902).

v2: Move the attribute format setup in the key from after search time to
    before the search.
v3: Fix reading of attributes other than position (I forgot to respect
    attr and stored everything in inputs 0-3, i.e. position).
2014-08-08 18:59:47 -07:00
Eric Anholt
f069367f39 vc4: Add support for the TGSI FRC opcode.
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
bf542cd372 vc4: Add support for the TGSI TRUNC opcode.
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
399285403a vc4: Crank up the tile allocation BO size
This avoids a simulator assertion failure with glamor.  I need to actually
support resize, though.
2014-08-08 18:59:47 -07:00
Eric Anholt
75afa64ef8 vc4: Add support for multiple attributes 2014-08-08 18:59:47 -07:00
Eric Anholt
32948ca768 vc4: Add more useful debug for the undefined-source case
We could get undefined sources in real programs from the wild, so we'll
need to turn off this debug eventually.  But for now, using undefined
sources is typically me just mistyping something.
2014-08-08 18:59:47 -07:00
Eric Anholt
6ff2129d58 vc4: Add support for the lit opcode.
v2: Fix how it was using the X channel for the real work of the opcode,
    instead of Y.  Fixes glean's LIT test.
v3: Rebase on the helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
63e49da0a5 vc4: Add support for the POW opcode
v2: Rebase on helpers.
2014-08-08 18:59:47 -07:00
Eric Anholt
0e182e7d8f vc4: Refactor uniform handling.
I wanted an easy way to set up new uniforms every time, so I could handle
texture-sampler-related uniforms.

v2: Rebase on helpers change.
2014-08-08 18:59:47 -07:00
Eric Anholt
6c185bd263 vc4: Add support for the LRP opcode.
v2: Rebase on helpers, cutting out most of the code in this change.
2014-08-08 18:59:47 -07:00
Eric Anholt
ec9da314ba vc4: Add copy propagation between temps.
We put in a bunch of extra MOVs for program outputs, and this can clean
those up.  We should do uniforms, too, though.

v2: Fix missing flagging of progress when we actually optimize.  Caught by
    Aaron Watry.
2014-08-08 18:59:47 -07:00
Eric Anholt
d9d1c14430 vc4: Add dead code elimination.
This cleans up a bunch of noise in the compiled coordinate shaders (since
we don't need the varying outputs), and also from writemasked instructions
with negated src operands.
2014-08-08 18:59:47 -07:00
Eric Anholt
1d23d55ae9 vc4: Add an initial pass of algebraic optimization.
There was a lot of extra noise in my piglit shader dumps because of silly
CMPs.
2014-08-08 18:59:47 -07:00
Eric Anholt
4c53087c67 vc4: Add support for CMP.
This took a couple of tries, and this is the squash of those attempts.

v2: Fix register file conflicts on the args in the
    destination-is-accumulator case.
v3: Rebase on helper change and qir_inst4 change.
2014-08-08 18:59:47 -07:00
Eric Anholt
eea1d36915 vc4: Make scheduling of NOPs a separate step from QIR -> QPU translation.
This should also be used as a way to pair QIR instructions into QPU
instructions later.
2014-08-08 18:59:46 -07:00
Eric Anholt
c293927511 vc4: Add WIP support for varyings.
It doesn't do all the interpolation yet, but more tests can run now.

v2: Rebase on helpers.
2014-08-08 18:59:46 -07:00
Eric Anholt
db9f41ea88 vc4: Use r3 instead of r5 for temps, since r5 only has 32 bits of storage
Reserving a whole accumulator for temps is awful in the first place, but
I'll fix that later.
2014-08-08 18:59:46 -07:00
Eric Anholt
23b2bad991 vc4: Fix emit of ABS
v2: Rebase on qir helpers.
2014-08-08 18:59:46 -07:00
Eric Anholt
cf2d777fbe vc4: Add shader variant caching to handle FS output swizzle. 2014-08-08 18:59:46 -07:00
Eric Anholt
6cf86dd487 vc4: Load the tile buffer before incrementally drawing.
We will want to occasionally disable this again when we do clear support.

v2: Squash with the previous commit (I accidentally committed at two
    stages of writing the change)
2014-08-08 18:59:46 -07:00
Eric Anholt
c3f96060a8 vc4: Don't reallocate the tile alloc/state bos every frame.
This was a problem for the simulator since we don't free memory back to
it, and it would soon just run out.
2014-08-08 18:59:46 -07:00
Eric Anholt
21db430210 vc4: Add VC4_DEBUG env option
v2: Fix an accidental deletion of some characters from the copyright
    message (caught by Ilia Mirkin)
2014-08-08 18:59:46 -07:00
Eric Anholt
2e35981d4d vc4: Add support for SNE/SEQ/SGE/SLT. 2014-08-08 18:59:46 -07:00
Eric Anholt
7108c24fd0 vc4: Use the user's actual first vertex attribute.
This is hardcoded to read it as RGBA32F so far, but starts to get more
tests working.
2014-08-08 18:59:46 -07:00
Eric Anholt
427f934f9e vc4: Fix UBO allocation when no uniforms are used.
We do rely on a real BO getting allocated, so make sure we ask for a non-zero size.
2014-08-08 18:59:46 -07:00
Eric Anholt
db8712bcbc vc4: Add initial support for math opcodes 2014-08-08 18:59:46 -07:00
Eric Anholt
792d1c92df vc4: Switch to actually generating vertex and fragment shader code from TGSI.
This introduces an IR (QIR, for QPU IR) to do optimization on.  It's a
scalar, SSA IR in general.  It looks like optimization is pretty easy this
way, though I haven't figured out if it's going to be good for our weird
register allocation or not (or if I want to reduce to basically QPU
instructions first), and I've got some problems with it having some
multi-QPU-instruction opcodes (SEQ and CMP, for example) which I probably
want to break down.

Of course, this commit mostly doesn't work, since many other things are
still hardwired, like the VBO data.

v2: Rewrite to use a bunch of helpers (qir_OPCODE) for emitting QIR
    instructions into temporary values, and make qir_inst4 take the 4 args
    separately instead of an array (all later callers wanted individual
    args).
2014-08-08 18:59:46 -07:00
Eric Anholt
e59890aebb vc4: Start converting the driver to use vertex shaders.
Note: This is the cutoff point where I switched from developing primarily
on the Pi to developing o the simulator.  As a result, from this point on
the code is untested on the Pi (the kernel code I have currently wasn't
rendering anything at this commit, though the simulator renders
successfully, suggesting kernel bugs).
2014-08-08 18:59:46 -07:00
Eric Anholt
1850d0a1cb vc4: Initial skeleton driver import.
This mostly just takes every draw call and turns it into a sequence of
commands that clear the FBO and draw a single shaded triangle to it,
regardless of the actual input vertices or shaders.  I copied the initial
driver skeleton mostly from freedreno, and I've preserved Rob Clark's
copyright for those.  I also based my initial hardcoded shaders and
command lists on Scott Mansell (phire)'s "hackdriver" project, though the
bit patterns of the shaders emitted end up being different.

v2: Rebase on gallium megadrivers changes.
v3: Rebase on PIPE_SHADER_CAP_MAX_CONSTS change.
v4: Rely on simpenrose actually being installed when building for
    simulation.
v5: Add more header duplicate-include guards.
v6: Apply Emil's review (protection against vc4 sim and ilo at the same
    time, and dropping the dricommon drm bits) and fix a copyright header
    (thanks, Roland)
2014-08-08 18:59:46 -07:00
Roland Scheidegger
f017e32c0a draw: (trivial) use information about gs being present from variant key
This is a purely cosmetic change.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-09 03:52:58 +02:00
Roland Scheidegger
6d2ecdb4a6 draw: don't use clipvertex output if user plane clipping is disabled
The non-llvm path made sure that both clip and pre_clip_pos point to the data
output by position, not clipvertex, if user based clipping is disabled.
However, the llvm path did not, which apparently led to failures if
gl_ClipVertex was written but user plane clipping not enabled (bug 80183).
Why I have no idea really, but just make it match the non-llvm behavior...

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-09 03:52:58 +02:00
Chris Forbes
0f4c5a70c6 i965: Get rid of backend_instruction::sampler
The generators no longer use this.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:35 +12:00
Chris Forbes
298da9fa2a i965/vec4/Gen8: Use src1 for sampler_index instead of ->sampler field
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:33 +12:00
Chris Forbes
6be68767b9 i965/vec4/Gen4-7: Use src1 for sampler_index instead of ->sampler field
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:31 +12:00
Chris Forbes
1a3fd11aef i965/vec4: Pass sampler index in src1 for texture ops
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:29 +12:00
Chris Forbes
2f4e12a835 i965/vec4: Collect all emits of texture ops into one place
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:27 +12:00
Chris Forbes
db09fd5957 i965/fs/Gen8: Pass sampler_index to generate_tex
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:25 +12:00
Chris Forbes
ba5f7a361a i965/fs/Gen4-7: Pass sampler_index to generate_tex
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:23 +12:00
Chris Forbes
191bc64f82 i965/blorp: Put sampler index in src1 of texture ops
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:21 +12:00
Chris Forbes
a578592fd2 i965/fs: pass sampler as src1 of texture op
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:17 +12:00
Chris Forbes
f6a0192f7d i965/fs: Collect all emits of texture ops for Gen5/6 into one place
Reduces duplication, and will do so even more when we change the sampler
plumbing.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:12:13 +12:00
Chris Forbes
d1b136fdd0 i965/fs: Collect all emits of texture ops for Gen4 into one place
Reduces duplication, and will do so even more when we change the sampler
plumbing.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-09 13:11:33 +12:00
Pali Rohár
39a4cc45a4 configure: check for dladdr via AC_CHECK_FUNC/AC_CHECK_LIB
Use both macros as in some cases using AC_CHECK_FUNCS alone may fail.
Thus HAVE_DLADDR will not be defined, and as a result most of the code
in megadriver_stub.c will not be compiled. Breaking the backwards
compatibility between older libGL/xserver(s) and DRI megadrivers.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
[Emil Velikov] Commit message.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 19:26:39 +01:00
Emil Velikov
16826a36ef util: remove ralloc_test
The tests in an empty stub, which we're currently building twice.
If anyone is interested in expanding it (adding actual tests) they
can always bring it back.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-08 19:23:25 +01:00
Darius Goad
5492296318 gallivm: Handle MSAA textures in emit_fetch_texels
This support is preliminary due to the fact that MSAA is not
actually implemented.

However, this patch does fix the piglit test:
spec/!OpenGL 3.2/glsl-resource-not-bound 2DMS (bug #79740).

(v2 RS: don't emit 4th coord as explicit lod)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-08 18:54:08 +02:00
Roland Scheidegger
394ea139c7 draw: hack around weird primitive id input in gs
The distinction between system values and ordinary inputs is not very
obvious in gallium - further fueled by the fact that they use the same
semantic names.
Still, if there's any value which imho really is a system value, it's the
primitive id input into the gs (while earlier (tessleation) stages could read
it, it is _always_ generated by the system). For some odd reason though (which
I'd classify as a bug but seems too complicated to fix) the glsl compiler in
mesa treats this as an ordinary varying, and everything else after that
(including the state tracker and other drivers) just go along with that.
But input fetching in gs for llvm based draw was definitely limited to the
ordinary (2-dimensional) inputs so only worked with other state trackers,
the code was also additionally relying on tgsi_scan_shader filling
uses_primid correctly which did not happen neither (would set it only for
all stages if it was a system value, but only set it for the fragment shader
if it was an input value).
This fixes piglit glsl-1.50-geometry-primitive-id-restart and primitive-id-in
in llvmpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-08 18:54:08 +02:00
Roland Scheidegger
92a059d294 draw: fix prim id float cast for non-llvm path
These values are always uints, casting them to floats does no good.
Fixes piglit glsl-1.50-geometry-primitive-id-restart tests for softpipe.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-08 18:54:07 +02:00
Bruno Jiménez
ec73778f1f clover: Add support for CL_MAP_WRITE_INVALIDATE_REGION
OpenCL 1.2 CL_MAP_WRITE_INVALIDATE_REGION sounds a lot like
PIPE_TRANSFER_DISCARD_RANGE:

From OpenCL 1.2 spec:
    The contents of the region being mapped are to be discarded.

From p_defines.h:
    Discards the memory within the mapped region.

v2: Move the code for validating flags to the front-end as
    suggested by Francisco Jerez

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-08-08 18:06:14 +03:00
Chia-I Wu
8d853468bd ilo: break down the format table
The PRMs no longer have a single table for format capabilities.  Multiple
tables take up less space, and are easier to maintain.

Encode typed write information while at it.
2014-08-08 20:23:56 +08:00
Kenneth Graunke
ae95b9dd9b i965: Emit a performance warning on conditional rendering.
We have a CPU-side implementation of conditional rendering; it really
should be done on the GPU.  It's not necessarily that hard, but nobody
has gotten to fixing it yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-08 00:52:10 -07:00
Kenneth Graunke
e9a9d441f0 i965: Set ExecSize to 16 for loop instructions in SIMD16 shaders.
Previously, we explicitly set the execution size to BRW_EXECUTE_8 and
disabled compression for loop instructions.  I can't imagine how this
could be correct in SIMD16 mode.

Looking at the history, it appears that this code has used BRW_EXECUTE_8
since 2007, when we had a SIMD8 backend that supported control flow and
a separate SIMD16 backend that didn't.  Presumably, when we added SIMD16
support for shaders with control flow, we simply neglected to update it.

Note that Gen4-5 don't support SIMD16 on shaders with control flow.

This might be a candidate for stable, but would need to be rewritten
completely due to the brw_inst API changes in master.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 00:51:50 -07:00
Kenneth Graunke
e64dbd050d i965/eu: Merge brw_CONT and gen6_CONT.
The only difference is setting PopCount on Gen4-5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 00:51:44 -07:00
Kenneth Graunke
e7a7b3317c i965/eu: Drop redundant brw_set_src0/brw_set_dest from gen6_CONT.
We shouldn't need to set them, then set them differently.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-08 00:51:34 -07:00
Juha-Pekka Heikkila
d64be94294 util: add src/util/format_srgb.c to .gitignore
format_srgb.c is generated by format_srgb.py python script, having
format_srgb.c in git ignore list will silence git complaints about
untracked file.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-08 09:49:52 +03:00
Ian Romanick
89d92fc00e mesa: Fold _mesa_uniform_merge_location_offset into its only caller
Also delete the comment before that function.  Everything in that
comment was either stale, wrong, or captured elsewhere.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:55 -07:00
Ian Romanick
1c759e32d8 mesa: Fold _mesa_uniform_split_location_offset into its only caller
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:53 -07:00
Ian Romanick
e0c867372a glsl_to_tgsi: Delete unused function set_uniform_initializer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:50 -07:00
Ian Romanick
8f81f4e185 mesa: Use MAX2 to calculate maximum uniform element
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:48 -07:00
Ian Romanick
411abcb237 mesa: Have validate_uniform_parameters return the gl_uniform_storage pointer
This simplifies all the callers, and it enables the removal of one of
the function parameters.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-07 16:17:45 -07:00
Carl Worth
f28a105868 glsl/glcpp: Rename one test to avoid a duplicate test number
With two tests both numbered 118, there was a confusing off-by-two difference
between the last test number and the total number of tests (as reported by
glcpp-test).

With this rename, there's only an off-by-one difference left, (which is easy
to understand given the zero-based test numbering).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
41540997fb glsl/glcpp: Fix handling of commas that result from macro expansion
Here is some additional stress testing of nested macros where the expansion
of macros involves commas, (and whether those commas are interpreted as
argument separators or not in subsequent function-like macro calls).

Credit to the GCC documentation that directed my attention toward this issue:

	https://gcc.gnu.org/onlinedocs/gcc-3.2/cpp/Argument-Prescan.html

Fixing the bug required only removing code from glcpp. When first testing the
details of expansions involving commas, I had come to the mistaken conclusion
that an expanded comma should never be treated as an argument separator, (so
had introduced the rather ugly COMMA_FINAL token to represent this).

In fact, an expanded comma should be treated as a separator, (as tested here),
and this treatment can be avoided by judicious use of parentheses (as also
tested here).

With this simple removal of the COMMA_FINAL token, the behavior of glcpp
matches that of gcc's preprocessor for all of these hairy cases.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
318369aceb glsl/glcpp: Integrate recent glcpp-test-cr-lf test into "make check"
Beyond just listing this in the TESTS variable in Makefile.am, only minor
changes were needed to make this work. The primary issue is that the build
system runs the test script from a different directory than the script
itself. So we have to use the $srcdir variable to find the test input files.

Using $srcdir in this way also ensures that this test works when using an
out-of-tree build.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
7ba74c65a7 glsl/glcpp: Fix glcpp-test to correctly extract test-specific arguments
The (optional) test-specific command-line arguments to be passed to glcpp are
embedded within the source files of some tests, and glcpp-test uses grep to
extract them.

Of course, grep is line-based and looks for the native line-separator to
determine line boundaries. So, for files using non-native line separators,
grep was getting quite confused and passing bogus arguments to glcpp.

Fix this by canonical-izing the line separators in the source file prior to
using grep.

With this commit, the glcpp-test-cr-lf tests pass entirely:

	\r:	143/143 tests pass
	\r\n:	143/143 tests pass
	\n\r:	143/143 tests pass

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
f1340745c0 glsl/glcpp: Fix line-continuation code to handle multiple newline flavors
Sometimes the newline separator is a single character, and sometimes it is two
characters. Before we can fold away and line-continuation backslashes, we
identify the flavor of line separator that is in use.

With this identified, we then correctly search for backslashes followed
immediately by the first character of the line separator.

Also, when re-inserting newlines to replace collapsed newlines, we carefully
insert newlines of the same flavor.

With this commit, almost all remaining test are fixed as tested by
glcpp-test-cr-lf:

	\r:	142/143 tests pass
	\r\n:	142/143 tests pass
	\n\r:	143/143 tests pass

(The only remaining failures have nothing to do with the actual pre-processor
code, but are due to a bug in the way the test suite uses grep to try to
extract test-specific command-line options from the source files.)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
ec69e00843 glsl/glcpp: Don't include any newline characters in #error token
Some tests were failing because the message printed by #error was including a
'\r' character from the source file in its output.

This is easily avoided by fixing the regular expression for #error to never
include any of the possible newline characters, (neither '\r' nor '\n').

With this commit 2 tests are fixed for each of the '\r' and '\r\n' cases.

Current results after the commit are:

	\r:	137/143 tests pass
	\r\n	142/143 tests pass
	\n\r:	139/143 tests pass

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
04e40fd337 glsl/glcpp: Treat CR+LF pair as a single newline
The GLSL specification says that either carriage-return, line-feed, or both
together can be used to terminate lines. Further, it says that when used
together, the pair of terminators shall be interpreted as a single line.

This final requirement has not been respected by glcpp up until now, (it has
been emitting two newlines for every CR+LF pair).

Here, we fix the lexer by using a regular expression for NEWLINE that eats
up both "\r\n" (or even "\n\r") if possible before also considering a single
'\n' or a single '\r' as a line terminator.

Before this commit, the test results are as follows:

	\r:	135/143 tests pass
	\r\n:	  4/143 tests pass
	\n\r:	  4/143 tests pass

After this commit, the test results are as follows:

	\r:	135/143 tests pass
	\r\n:	140/143 tests pass
	\n\r:	139/143 tests pass

So, obviously, a dramatic improvement.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
f4ddd026c6 glsl/glcpp: Add test script for testing various line-termination characters
The GLSL specification has a very broad definition of what is a
newline. Namely, it can be the carriage-return character, '\r', the newline
character, '\n', or any combination of the two, (though in combination, the
two are treated as a single newline).

Here, we add a new test-runner, glcpp-test-cr-lf, that, for each possible
line-termination combination, runs through the existing test suite with all
source files modified to use those line-termination characters. Instead of
using the .expected files for this, this script assumes that the regular test
suite has been run already and expects the output to match the .out
files. This avoids getting 4 test failures for any one bug, and instead will
hopefully only report bugs actually related to the line-termination
characters.

The new testing is not yet integrated into "make check". For that, some
munging of the testdir option will be necessary, (to support "make check" with
out-of-tree builds). For now, the scripts can just be run directly by hand.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
218e878b54 glsl/glcpp: Fix for macros that expand to include "defined" operators
Prior to this commit, the following snippet would trigger an error in glcpp:

	#define FOO defined BAR
	#if FOO
        #endif

The problem was that support for the "defined" operator was implemented within
the grammar, (where the parser was parsing the tokens of the condition
itself). But what is required is to interpret the "defined" operator that
results after macro expansion is performed.

I could not find any fix for this case by modifying the grammar alone. The
difficulty is that outside of the grammar we already have a recursive function
that performs macro expansion (_glcpp_parser_expand_token_list) and that
function itself must be augmented to be made aware of the semantics of the
"defined" operator.

The reason we can't simply handle "defined" outside of the recursive expansion
function is that not only must we scan for any "defined" operators in the
original condition (before any macro expansion occurs); but at each level of
the recursive expansion, we must again scan the list of tokens resulting from
expansion and handle "defined" before entering the next level of recursion to
further expand macros.

And of course, all of this is context dependent. The evaluation of "defined"
operators must only happen when we are handling preprocessor conditionals,
(#if and #elif) and not when performing any other expansion, (such as in the
main body).

To implement this, we add a new "mode" parameter to all of the expansion
functions to specify whether resulting DEFINED tokens should be evaluated or
ignored.

One side benefit of this change is that an ugly wart in the grammar is
removed. We previously had "conditional_token" and "conditional_tokens"
productions that were basically copies of "pp_token" and "pp_tokens" but with
added productions for the various forms of DEFINED operators. With the new
code here, those ugly copy-and-paste productions are eliminated from the
grammar.

A new "make check" test is added to stress-test the code here.

This commit fixes the following Khronos GLES3 CTS tests:

	conditional_inclusion.basic_2_vertex
	conditional_inclusion.basic_2_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
a48ff781c1 glsl/glcpp: Swallow empty #pragma directives.
Previously, we were passing these through, just like any other pragma. But the
downstream compiler was tripping up on them. It seems easier to swallow these
in the preprocessor and not pass them on at all rather than fixing the
downstream compiler.

This fixes the following Khronos GLES3 CTS tests:

	preprocessor.pragmas.pragma_vertex
	preprocessor.pragmas.pragma_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
bf9bce5bea glsl/glcpp: Fix #pragma to not over-increment the line-number count
Previously, the #pragma directive was swallowing an entire line, (including
the final newline). At that time it was appropriate for it to increment the
line count.

More recently, our handling of #pragma changed to not include the newline. But
the code to increment yylineno stuck around. This was causing __LINE__ to be
increased by one more than desired for every #pragma.

Remove the bogus, extra increment, and add a test for this case.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
9a54b07651 glsl/glcpp: Add testing for null directives with spaces and comments
This new "make check" test stresses out the support from the last two commits,
(to esnure that '#' is correctly interpreted as the null directives,
regardless of any whitespace or comments on the same line).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
c0127c30dd glsl/glcpp: Fix NULL directives when followed by a single-line comment
This is the fix for the following line:

	#  // comment to ignore here

According to the translation-phase rules, the comment should be removed before
the preprocessor looks to interpret the null directive.

So in our implementation we must explicitly look for single-line comments in
the <HASH> start condition as well.

This commit fixes the following Khronos GLES3 CTS tests:

	null_directive_vertex
	null_directive_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
e84e159caa glsl/glcpp: Add tests for #define followed by comments
This simply tests the previous commit, (that #define followed by a comment
will still generate the expected "#define without macro name" error message).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
b4b2a5c3f3 glsl/glcpp: Allow single-line comments immediately after #define
We were already correctly supporting single-line comments in case like:

	#define FOO bar // comment here...

The new support added here is simply for the none-too-useful:

	#define // comment instead of macro name

With this commit, this line will now give the expected "#define without
macro name" error message instead of the lexer just going off into the
weeds.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:29 -07:00
Carl Worth
b76482e731 glsl/glcpp: Add test for "#define without macro name"
This ensures that the previous commit indeed generates the expected error
message when a "#define" directive is not followed by anything except for a
newline.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:28 -07:00
Carl Worth
a196ab1f8a glsl/glcpp: Add explicit error for "#define without macro name"
Previously, glcpp would emit an error like this if <EOF> happened to occur
immediately after the "#define", but in general would just get confused,
(leading to un-helpful error messages).

To fix things to generate a clean error message, we do a few things:

	1. Don't require horizontal whitespace immediately after #define

	2. Add a production for the error case, (DEFINE_TOKEN followed
	   immediately by a NEWLINE token).

	3. Make the lexer reset to the <INITIAL> state after every NEWLINE.

This 3rd point prevents the lexer from getting so confused and generating
further spurious errors in the file because it was stuck in the <DEFINE> start
condition.

We also drop the similar error message from the <EOF> rule since the
newly-added rule will have already printed the error message.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-07 16:08:28 -07:00
Matt Turner
b6ab52b7f9 docs: List GL+GLSL versions as parts of a whole.
Listing the GLSL version as an individual component of a GL version,
separate from the extensions isn't really right. The GLSL changes are
(almost?) entirely comprised of changes listed in the extensions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-07 16:00:24 -07:00
Matt Turner
bbd5dd5226 i965/vec4: Remove unused emit_bool_comparison method.
Apparently unused since it was added in commit af3c9803.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-07 16:00:24 -07:00
Matt Turner
50d5fc192b mesa: Drop USE_IEEE define.
I think OpenVMS was the only platform that Mesa ran on that used a
non-IEEE representation for floats. We removed OpenVMS support a while
back, and this should alleviate the need to continue updating the
this-platform-uses-IEEE list.

The one bit of this patch that needs review is the IS_INF_OR_NAN,
because I'm not sure if MSVC supports isfinite.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82268
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-07 16:00:24 -07:00
Ian Romanick
4837b130a7 mesa: Group gl_system_value values by the stage where they exist
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:59 -07:00
Ian Romanick
5d7275c350 glsl_to_tgsi: Assert that the _mesa_sysval_to_semantic mapping is correct
Future patches will rearrange the values in gl_system_value, and I want
to catch errors.  Designated initializers would make all of this
unnecessary.

v2: Don't use STATIC_ASSERT.  Not only does it not work, but GCC doesn't
tell you that it's not going to work.  Thanks for nothing!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:57 -07:00
Ian Romanick
21ef7f58e3 mesa/st: Only one copy of mesa_sysval_to_semantic
Future patches will necessitate changes to the table, and I only want to
update one.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:55 -07:00
Ian Romanick
1c887ae6e2 glsl_to_tgsi: Constify mesa_sysval_to_semantic
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-07 15:19:53 -07:00
Kenneth Graunke
b7679639bc i965/clip: Fix brw_clip_unfilled.c/compute_offset's assembly.
Due to the destination register width of 1 or 2, these instructions get
ExecSize 1 or 2.  But dir and offset (used as src0) are both registers
of width 4, violating the execsize >= width assertion.

I honestly don't think this could have ever worked.

Fixes Piglit's polygon-offset and polygon-mode-offset tests on Gen4-5.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70441
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-07 13:22:52 -07:00
Tapani Pälli
151fb1e808 glsl: support unsigned increment in ir_loop controls
Current version can create ir_expression where operands have
different base type, patch adds support for unsigned type.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
https://bugs.freedesktop.org/show_bug.cgi?id=80880
2014-08-07 07:31:49 +03:00
Jason Ekstrand
787bac3808 mesa/formats: Fix the size of ETC2_SRGB8_PUNCHTHROUGH_ALPHA1
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-06 15:15:53 -07:00
Jason Ekstrand
bb89d82ac4 mesa/formats: Use the correct swizzle parameter for the 11-bit EAC formats
Red-only formats should be x001 and RG formats should be xy01.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-08-06 15:15:44 -07:00
Roland Scheidegger
6e9005e8b0 draw: fix clipvertex trouble if position comes from gs
If the vertex shader has no position but the gs has, the clipvertex output
was -1 (because it's the same as vs position in this case if there's no
explicit clipvertex output). This caused crashes (or assertion failures) in
clipping since in the end position (which came from gs) was different from
cv (-1) and we then tried to use the bogus cv input.
Rather than just test for -1 cv value in clipping, make it explicitly return
the position output of the gs instead which seems cleaner (since we really
don't want to use the clipvertex value from the vs (it could be a valid value
in the (unsupported) case of vs writing clipvertex but still using a gs).
This fixes piglit shader_runner clip-distance-out-values.shader_test.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-08-06 18:01:33 +02:00
Roland Scheidegger
11bd6f0e9b draw: don't run pipeline stages when gs has no position output
The clip stage may crash if there's no position output, for this reason
code was added to avoid running the pipeline stages in this case
(c7c7186045). However, this failed to actually
work when there was a geometry shader, since unlike the vertex shader it did
not initialize the position output to -1, hence the code trying to detect
this didn't trigger. So simply initialize the position output to -1 just like
the vs does.
This fixes piglit glsl-1.50-transform-feedback-type-and-size (segfault->pass).
clip-distance-out-values.shader_test goes from segfault to assertion failure,
suggesting more fixes are needed, no other piglit changes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-08-06 18:01:33 +02:00
Vinson Lee
c40d7d6d94 dri/xmlconfig: s/uint/unsigned int/
This patch fixes this build error on Mac OS X.

./xmlconfig.h:61:5: error: unknown type name 'uint'; did you mean 'int'?
    uint nRanges;         /**< \brief Number of ranges */
    ^~~~
    int
./xmlconfig.h:79:5: error: unknown type name 'uint'; did you mean 'int'?
    uint tableSize;
    ^~~~
    int

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 16:52:42 -07:00
Brian Paul
1125d021de mesa include stdint.h in formats.h
To get uint8_t type, to fix MSVC build.
Trivial.
2014-08-05 13:07:46 -06:00
Jason Ekstrand
fc2b2d337e mesa/texstore: Add a generic rgba integer texture upload path
Again, we delete a lot of functions that aren't really doing anything
interesting anymore.

v2: Comment the texstore_rgba_integer function

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
d267b75715 mesa/texstore: Add a generic float/normalized rgba texture upload path
This commit also removes a bunch of functions which aren't doing anything
more interesting than the general path does.

v2: Better comment the texstore_via_float function

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
3dbf5bf657 mesa/texstore: Use _mesa_swizzle_and_convert when possible
This should be both faster and more accurate than our general slow-path of
converting everything to float.

v2: Add a comment to top of the texstore_swizzle function

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
4c8fc26835 main/texstore: Split texture storage into three functions
This commit splits the texture storage into three functions:
texstore_depth_stencil, texstore_compressed, and texstore_rgba.  Right now
this split seems artificial since we just have one function pointer per
format and there is no difference between these three categories.  However,
this split makes it much easier to write a more general function upload
path for one of these categories than the current function pointers.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:17 -07:00
Jason Ekstrand
6b912dc129 mesa/format_utils: Add a function to convert a mesa_format to an array format
This commits adds the _mesa_format_to_array function that determines if the
given format can be represented as an array format and computes the array
format parameters. This is a direct helper function for using
_mesa_swizzle_and_convert

v2: Better documentation and commit message
v3: Fixed a potential segfault from an invalid endianness swizzle

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
d55f77b503 mesa/format_utils: Add a general format conversion function
Most format conversion operations required by GL can be performed by
converting one channel at a time, shuffling the channels around, and
optionally filling missing channels with zeros and ones.  This adds a
function to do just that in a general, yet efficient, way.

v2:
 * Add better comments including full docs for functions
 * Don't use __typeof__
 * Use inline helpers instead of writing out conversions by hand,
 * Force full loop unrolling for better performance

v3: Add another set of parens around the MAX_INT macro

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
452d64986b mesa/imports: Add a _mesa_half_is_negative helper function
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
850fb0d1dc mesa/formats: Add layout and swizzle information
v2: Move the MESA_FORMAT_SWIZZLE enum to the top of the file

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:16 -07:00
Jason Ekstrand
55a929955f mesa/formats: Remove IndexBits
Mesa hasn't supported color-indexed textures for some time.  This is 0 for
all texture formats, so we don't need to store it.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
12610ffcf7 mesa/formats: Autogenerate the format_info structure from a CSV file
Instead of a having all of the format metadata in a gigantic hard-to-edit
array of type struct format_info, we now have a human-readable CSV file.
The CSV file also contains more format information than the format_info
struct contained so we can potentially make format_info more detailed later.

The python to generate the format information was added the previous
commit.  This commit turns it on in both automake and scons builds.

v2: Split into two commits and stuff to generate format_info.c from scons

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
3420565310 mesa/main: Add python code to generate the format_info structure
This adds a python script called format_info.py that is used to generate a
single format_info.c file that contains the filled-out format_info array.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
d4c780e052 mesa: Add python to parse the formats CSV file
The basic concept for the format parser was taken from the format CSV
parser in gallium/auxilliary/util.  However, this one has been altered in a
number of ways:

 * Removed big endian vs. little endian stuff (mesa doesn't need it)
 * Better documentation: Almost every method has a full docstring
 * An actual Swizzle class with methods for composition and inverses
 * Over-all cleaner (in my opinion) implementation and class interactions
 * A few bug fixes

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
056cc47e12 mesa: Add a format description CSV file
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 10:56:15 -07:00
Jason Ekstrand
1d47f67455 util/tests/hash_table: Link against libmesautil instead of libmesa
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82159

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-05 10:52:48 -07:00
Brian Paul
36de884ffd st/mesa: adjust Z coordinates for quad clearing
Specify the quad's Z position in clip coordinate space, not
normalized Z space.  Use viewport scale, translation = 0.5, 0.5.

Before, we were specifying the quad's Z position in [0,1] and using
viewport scale=1.0, translate=0.0.  That works fine, unless your
driver needs to work in clip coordinate space and needs to
reconstruct viewport near/far values from the scale/translation
factors.  The VMware svga driver falls into that category.

When we did that reconstruction we wound up with near=-1 and far=1
which are outside the limits of [0,1].  In some cases, this caused
the quad to be drawn at the wrong depth.  In other cases it was
clipped away.

Fixes some scissored depth clears with VMware driver.  This should
have no effect on other drivers.  We're already using these values
for the glBitmap and glDraw/CopyPixels code.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-08-05 10:21:18 -06:00
Brian Paul
6719914f98 mesa: make vertex array type error checking a little more efficient
Compute the bitmask of supported array types once instead of every
time we call a GL vertex array function.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-08-05 10:18:34 -06:00
Michel Dänzer
3347c634d0 glsl_to_tgsi: Fix typo shader_program -> shader
This was a regression introduced by commit
f4b0ab7afd ('st/mesa: fix incorrect size
of UBO declarations') which caused an assertion failure while compiling
shaders of e.g. UE4 demos.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81834
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 23:34:00 +09:00
Brian Paul
8563335b65 mesa: update wglext.h to version 20140630
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-05 08:19:02 -06:00
Brian Paul
c344f45333 mesa: update glxext.h to version 20140725
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-05 08:18:58 -06:00
Brian Paul
d96607970b mesa: update glext.h to version 20140725
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-05 08:18:50 -06:00
Neil Roberts
816dbdb106 meta: Disable dithering during glBlitFramebuffer
According to the GL spec the only fragment operations that should affect
glBlitFramebuffer are “the pixel ownership test, the scissor test, and sRGB
conversion”. That implies that dithering should not be performed so we need to
disable it when implementing the blit with a render.

Before commit 05b52efbc9 the dithering state would be left as whatever the
application picks (the default being GL_TRUE) and after that commit it was
explicitly enabled. Neither of these were correct.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81828
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-05 14:48:15 +01:00
Emil Velikov
afcf5d33cf libgl-xlib: drop duplicate mesautil from scons build
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:35 +01:00
Emil Velikov
4f0f75deba llvmpipe/tests: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:32 +01:00
Emil Velikov
07a275991e gallium/tests: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:30 +01:00
Emil Velikov
692009cab1 targets/omx: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:56:27 +01:00
Emil Velikov
807b5467a3 targets/xvmc: automake: link against libmesautil.la
Or the build will fail due to unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-05 13:53:43 +01:00
Jan Vesely
d0b4ac642b targets/clover: link against libmesautil.la
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-05 12:54:08 +09:00
Jan Vesely
e28136343b gallivm: Fix build with latest LLVM
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-08-05 12:52:56 +09:00
Roland Scheidegger
6b834af77e targets/dri: link with mesautil
Similar to other recent build fixes.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-05 04:13:17 +02:00
Roland Scheidegger
9042e8863a gallium/docs: Document TEX2/TXL2/TXB2 instructions and fix up other tex doc
Add documentation for TEX2/TXL2/TXB2 tgsi opcodes. Also, the texture opcode
documentation wasn't very accurate so fix this up a bit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-05 04:13:17 +02:00
Roland Scheidegger
c3c33756ff gallivm: fix cube map array (and cube map shadow with bias) handling
In particular need to handle TEX2/TXB2/TXL2 opcodes.
cube map shadow with bias already used TXB2 which didn't work before
at all, despite that there's by default no piglit change (but using
no_quad_lod and no_rho_opt indeed passes some more tex-miplevel-selection
tests).
The actual sampling code still won't handle cube map arrays.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 04:13:17 +02:00
Roland Scheidegger
ea05cfaaca llvmpipe: implement support for cube map arrays
This just covers the resource side of things, not the actual sampling.
Here things are trivial as cube map arrays are identical to 2d arrays in
all respects.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-05 04:13:17 +02:00
Anuj Phogat
d308f57fe7 egl: Fix OpenGL ES version checks in _eglParseContextAttribList()
We would generate EGL_BAD_CONFIG because _eglGetContextAPIBit
returns zero for the combination of EGL_OPENGL_ES_API and a major
version > 3.  By just returning zero, the caller can't tell the
difference between a bad version (which should generate
EGL_BAD_MATCH) and a bad API (which should generate
EGL_BAD_CONFIG).  This patch causes us to filter out major
versions > 3 at a point where we can generate the correct error.

Fixes gles3 Khronos CTS test:
egl_create_context.egl_create_context

V2: Fix commit message as suggested by Ian.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-04 18:31:26 -07:00
Anuj Phogat
338fef61f8 meta: Fix datatype computation in get_temp_image_type()
Changes in the patch will cause datatype to be computed
correctly for 8 and 16 bit integer formats. For example:
GL_RG8I, GL_RG16I etc.

Fixes many failures in gles3 Khronos CTS test:
copy_tex_image_conversions_required
copy_tex_image_conversions_forbidden

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-04 17:19:42 -07:00
Anuj Phogat
4bab55c874 meta: Move the call to _mesa_get_format_datatype() out of switch
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-04 17:19:41 -07:00
Anuj Phogat
7de90890c6 meta: Use _mesa_get_format_bits() to get the GL_RED_BITS
We currently get red bits from ctx->DrawBuffer->Visual.redBits
by making a false assumption that the texture we're writing to
(in glCopyTexImage2D()) is used as a DrawBuffer.

Fixes many failures in gles3 Khronos CTS test:
copy_tex_image_conversions_required

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-04 17:19:41 -07:00
Anuj Phogat
9796a17265 meta: Initialize the variable in declaration statement
Saves one line of code :)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-04 17:19:20 -07:00
Anuj Phogat
c7def2257a mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formats
GL_TEXTURE_CUBE_MAP is an allowed texture target in glTexStorage2D()
and is allowed to be used (like GL_TEXTURE_2D) with compressed internal
formats.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 17:12:29 -07:00
Anuj Phogat
2fc4205461 mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()
Fixes many failures in gles3 Khronos CTS test: packed_pixels

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:12:23 -07:00
Anuj Phogat
938b3d0034 mesa: Add utility function _mesa_is_enum_format_unorm()
V2: Add missing formats.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:12:14 -07:00
Anuj Phogat
6df48ff27a mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in glCopyTexImage*()
Fixes many failures in gles3 Khronos CTS test: packed_pixels

Khronos bug# 9807
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:12:05 -07:00
Anuj Phogat
5c0d2a12f3 mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()
Fixes many failures in gles3 Khronos CTS test: packed_pixels

V2: Add the check for alpha bits to avoid confusion.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:52 -07:00
Anuj Phogat
e0fe00eeac mesa: Add a helper function _mesa_is_enum_format_unsized()
Function is utilized by next patch in the series.

V2: Add missing formats.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:44 -07:00
Anuj Phogat
2d362a6aee mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3
Fixes few failures in gles3 Khronos CTS test: packed_pixels

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:34 -07:00
Anuj Phogat
845b5ec89f mesa: Add utility function _mesa_is_enum_format_snorm()
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:25 -07:00
Anuj Phogat
3c7a0c690a mesa: Fix condition for using compressed internalformat in glCompressedTexImage3D()
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:18 -07:00
Anuj Phogat
e27c9f3a02 mesa: Add error condition for using compressed internalformat in glTexStorage3D()
Fixes gles3 Khronos CTS test: texture_storage_texture_internal_formats

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:10 -07:00
Anuj Phogat
ac2adf66c1 mesa: Turn target_can_be_compressed() in to a utility function
V2:  Declare the function in teximage.h

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 17:11:00 -07:00
Anuj Phogat
a94d78438d mesa: Fix error condition for valid texture targets in glTexStorage* functions
Fixes gles3 Khronos CTS test: texture_storage_texture_targets

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-08-04 17:10:48 -07:00
Ian Romanick
7b18983147 glsl: Rebuild the symbol table without unreachable symbols
Previously we had to keep unreachable global symbols in the symbol table
because the symbol table is used during linking.  Having the symbol
table retain pointers to freed memory... what could possibly go wrong?
At the same time, this meant that we kept live references to tons of
memory that was no longer needed.

New strategy:  destroy the old symbol table, and make a new one from the
reachable symbols.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 59 40,642,425,451       76,337,968       69,720,886     6,617,082            0
After  (32-bit): 46 40,661,487,174       75,116,800       68,854,065     6,262,735            0

Before (64-bit): 79 37,179,441,771      106,986,512       98,112,095     8,874,417            0
After  (64-bit): 64 37,200,329,700      104,872,672       96,514,546     8,358,126            0

A real savings of 846KiB on 32-bit and 1.5MiB on 64-bit.

v2: (by Kenneth Graunke) Just add the ir_function from the IR stream,
    rather than looking it up in the symbol table; they're now
    identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-04 15:48:09 -07:00
Kenneth Graunke
3d051772c8 glsl: Only create one ir_function for a given name.
Piglit's spec/glsl-1.10/linker/override-builtin-{const,uniform}-05 tests
do the following:

1. Call abs(float) - a built-in function.
2. Create a user-defined replacement for abs(float).
3. Call abs(float) again - now the user function.

At step 1, we created an ir_function which included the built-in
signature, added it to the symbol table, and emitted it into the IR
stream.

Then, when processing the function definition at step 2, we'd see that
there was already an ir_function.  But, since there were no user-defined
functions, we skipped over a bunch of code, and ended up creating a
second one.  This new ir_function shadowed the original in the symbol
table, but both ended up in the IR stream.

This results in an awkward situation where searching for an ir_function
via the symbol table, a forward linked list walk, and a reverse linked
list walk may return different ir_functions.  This seems undesirable.

This patch instead re-uses the existing ir_function, putting both
built-in and user-defined signatures in the same one.  The previous
patch's additional filtering ensures everything continues working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-04 15:48:06 -07:00
Kenneth Graunke
21129d4de3 glsl: Make it possible to ignore built-ins when matching signatures.
Historically, we've implemented the rules for overriding built-in
functions by creating multiple ir_functions and relying on the symbol
table to hide the one containing built-in functions.  That works, but
has a few drawbacks, so the next patch will change it.

Instead, we'll have a single ir_function for a particular name, which
will contain both built-in and user-defined signatures.  Passing an
extra parameter to matching_signature makes it easy to ignore built-ins
when they're supposed to be hidden.

I didn't add the parameter to exact_matching_signature since it wasn't
necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-08-04 15:47:06 -07:00
Kenneth Graunke
f82f2fb3dc mesa: Actually use the Mesa IR optimizer for ARB programs.
On Haswell, this cuts 1-3 instructions from 183 vertex shaders in
"Shadowrun Returns", "Shatter", and "Trine 2."  It adds 2 instructions
to a single fragment shader in "Closure."

total instructions in shared programs: 278803 -> 278546 (-0.09%)
instructions in affected programs:     41930 -> 41673 (-0.61%)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-04 15:43:56 -07:00
Ian Romanick
b48621c348 glsl: Do not add extra padding to structures
This code was attemping to align the base of the structure to the required
alignment of the structure.  However, it had two problems:

1. It was aligning the target structure member, not the base of the
structure.

2. It was calculating the alignment based on the members previous to the
target member instead of all the members of the structure.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.nested_structs.6
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.6
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.5
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.19
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.0
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.2
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.6
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.12

v2: Fix rebase failure noticed by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
b17a4d5dab glsl: Correctly determine when the field of a UBO is row-major
Previously if a field of an block with an instance name was marked
row-major (but block itself was not), we would think the field (and it's
sub-fields) were column-major.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.basic_types.7
ES3-CTS.shaders.uniform_block.random.basic_types.9
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.1
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.3
ES3-CTS.shaders.uniform_block.random.nested_structs.3
ES3-CTS.shaders.uniform_block.random.nested_structs.5
ES3-CTS.shaders.uniform_block.random.nested_structs.8
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.3
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.6
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.7
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.8
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.9
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.1
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.3
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.4
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.6
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.1
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.5
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.0
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.4
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.7
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.8
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.12
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.14
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.15
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.16
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.1
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.8
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.9
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.10
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.11
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.13
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.14
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.15
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.16
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.17

Fixes gles3conform failures (caused by previous commits) in:

ES3-CTS.shaders.uniform_block.random.basic_types.8
ES3-CTS.shaders.uniform_block.random.basic_arrays.3
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.9
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.13
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.18
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.4

v2: Fix rebase failure noticed by Matt.

v3: Use without_array() instead of older predicates.

v4: s/GLSL_MATRIX_LAYOUT_DEFAULT/GLSL_MATRIX_LAYOUT_INHERITED/g

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v2]
2014-08-04 14:40:07 -07:00
Ian Romanick
b71f149a44 linker: Use the matrix layout information in ir_variable and glsl_type for UBO layout
Use the data that is stored in the ir_variable and the glsl_type to
determine whether or not a UBO member is row-major.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat2x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat2x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat3x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat3x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat4x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.shared.row_major_mat4x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat2x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat2x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat3x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat3x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat4x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.packed.row_major_mat4x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat2x3
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat2x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat3x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat3x4
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat4x2
ES3-CTS.shaders.uniform_block.instance_array_basic_type.std140.row_major_mat4x3
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.5
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.9

Causes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.basic_types.8
ES3-CTS.shaders.uniform_block.random.basic_arrays.3
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.13
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.18
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.4

These failures will be fixed shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
d561e79a67 glsl: Track matrix layout of variables using two bits
Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.3
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.13

Causes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.9

This failure will be fixed shortly.

v2: Use without_array() instead of older predicates.

v3: s/GLSL_MATRIX_LAYOUT_DEFAULT/GLSL_MATRIX_LAYOUT_INHERITED/g

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
2014-08-04 14:40:07 -07:00
Ian Romanick
68fa4cab1a glsl: Also track matrix layout information into structures
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
814d694160 glsl: Track matrix layout of structure fields using two bits
v2: Rename GLSL_MATRIX_LAYOUT_DEFAULT to GLSL_MATRIX_LAYOUT_INHERITED.
Add comments in glsl_types.h explaining the layouts.  Suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
ab7098c8df glsl: Correctly load columns of a row-major matrix
For a row-major matrix, the next column starts at the next element.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat2
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat3
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat4
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat2x3
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat2x4
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat3x2
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat3x4
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat4x2
ES3-CTS.shaders.uniform_block.single_basic_array.shared.row_major_mat4x3
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat2
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat3
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat4
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat2x3
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat2x4
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat3x2
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat3x4
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat4x2
ES3-CTS.shaders.uniform_block.single_basic_array.packed.row_major_mat4x3
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat2
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat3
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat4
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat2x3
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat2x4
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat3x2
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat3x4
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat4x2
ES3-CTS.shaders.uniform_block.single_basic_array.std140.row_major_mat4x3
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.9

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
7f731340d2 linker: Add padding after the last field of a structure
This causes the thing following the structure to be vec4-aligned.

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.random.nested_structs.2
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.5

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:07 -07:00
Ian Romanick
47c6fc5b04 linker: Add a last_field parameter to various program_resource_visitor methods
I also considered renaming visit_field(const glsl_struct_field *) to
entry_record and adding an exit_record method.  This would be more
similar to the hierarchical visitor.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:06 -07:00
Ian Romanick
46356c46ea mesa: Do not list inactive block members as active
Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_packed
ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_packed
ES3-CTS.shaders.uniform_block.random.scalar_types.7
ES3-CTS.shaders.uniform_block.random.basic_arrays.4
ES3-CTS.shaders.uniform_block.random.basic_arrays.6
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.2
ES3-CTS.shaders.uniform_block.random.nested_structs.9
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.3

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:06 -07:00
Ian Romanick
1ca25abe25 glsl: Do not eliminate 'shared' or 'std140' blocks or block members
Commit 32f32292 (glsl: Allow elimination of uniform block members)
enabled elimination of unused uniform block members to fix a gles3
conformance test failure.  This went too far the other way.

Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec says:

    "All members of a named uniform block declared with a shared or
    std140 layout qualifier are considered active, even if they are not
    referenced in any shader in the program. The uniform block itself is
    also considered active, even if no member of the block is
    referenced."

Fixes gles3conform failures in:

ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_shared
ES3-CTS.shaders.uniform_block.single_nested_struct.per_block_buffer_std140
ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_shared
ES3-CTS.shaders.uniform_block.single_nested_struct_array.per_block_buffer_std140
ES3-CTS.shaders.uniform_block.random.scalar_types.2
ES3-CTS.shaders.uniform_block.random.scalar_types.9
ES3-CTS.shaders.uniform_block.random.vector_types.1
ES3-CTS.shaders.uniform_block.random.vector_types.3
ES3-CTS.shaders.uniform_block.random.vector_types.7
ES3-CTS.shaders.uniform_block.random.vector_types.9
ES3-CTS.shaders.uniform_block.random.basic_types.5
ES3-CTS.shaders.uniform_block.random.basic_types.6
ES3-CTS.shaders.uniform_block.random.basic_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_arrays.2
ES3-CTS.shaders.uniform_block.random.basic_arrays.5
ES3-CTS.shaders.uniform_block.random.basic_arrays.8
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.0
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.4
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.5
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.6
ES3-CTS.shaders.uniform_block.random.basic_instance_arrays.9
ES3-CTS.shaders.uniform_block.random.nested_structs.0
ES3-CTS.shaders.uniform_block.random.nested_structs.1
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays.4
ES3-CTS.shaders.uniform_block.random.nested_structs_instance_arrays.8
ES3-CTS.shaders.uniform_block.random.nested_structs_arrays_instance_arrays.7
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.3
ES3-CTS.shaders.uniform_block.random.all_per_block_buffers.6
ES3-CTS.shaders.uniform_block.random.all_shared_buffer.18

v2: Whitespace and other minor fixes suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 14:40:06 -07:00
Ian Romanick
6305caea52 glsl: Use the without_array predicate to simplify some code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-08-04 14:40:06 -07:00
Ian Romanick
22f7a46d74 glsl: Add without_array type predicate
Returns the type without any arrays.

This will be used in later patches in this series.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-04 14:40:06 -07:00
Ian Romanick
146be3ddbe glsl: Use constant_expression_value instead of as_constant
Just a few lines earlier we may have wrapped the index expression with
ir_unop_i2u expression.  Whenever that happens, as_constant will return
NULL, and that almost always happens.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2014-08-04 14:40:06 -07:00
Brian Paul
b249712643 targets/graw-gdi: link with mesautil, not mesautils
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
a3bdbef020 wmesa: link with mesautil
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
d6a7ff6d3b osmesa: link with mesautil
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
c4e23f039e targets/libgl-gdi: link with mesautil
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
0ba5d8010d targets/egl-static: link with libmesautil.la
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 15:22:48 -06:00
Brian Paul
b0b9871f69 mesa/x86: put code in braces to silence declarations after code warning
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-08-04 15:22:48 -06:00
Jason Ekstrand
ea705a4537 src/Makefile.am: Move gtest before util
Since the ralloc test in util/tests needs gtest, we need to make sure that
the gtest subdir is loaded first.  This fixes bug #82148.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 13:21:08 -07:00
Brian Paul
9b10bc5589 util: include c99_compat.h in format_srgb.h to get 'inline' definition
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Brian Paul
04764f3bd9 util: include c99_compat.h in hash_table.h to get 'inline' definition
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Brian Paul
b035869ff8 targets/vdpau: link with libmesautil.la to fix build breakage
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Brian Paul
9f88893829 xlib: fix missing mesautil build breakage
Fixes the non-DRI build.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-08-04 14:06:13 -06:00
Matthew McClure
ff0cbfb3db svga: SVGA_3D_CMD_BIND_GB_SHADER needs to reserve two relocations.
With this patch, the SVGA_3D_CMD_BIND_GB_SHADER functionality will reserve
two relocations, one for the shader ID and the second for the MOB ID.

Verified with the WDDM winsys path that the number of relocations and patch
locations required is two.

Fixes Bug 1277406

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-08-04 14:06:13 -06:00
Jason Ekstrand
0236e75b2a gallium: Add libmesautil dependency to gdm and xa targets
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 12:38:01 -07:00
Jason Ekstrand
e97498ef81 mesa/main: Use the RGB <-> sRGB conversion functions in libmesautil
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:20 -07:00
Jason Ekstrand
992e1ea8e4 gallium: Move sRGB <-> RGB handling to libmesautil
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:15 -07:00
Jason Ekstrand
efa0aa8ffc util: Gather some common macros
This gathers macros that have been included across components into util so
that the include chain can be more vertical.  In particular, this makes
util stand on its own without any dependence whatsoever on the rest of
mesa.

Signed-off-by: "Jason Ekstrand" <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:10 -07:00
Kenneth Graunke
72e55bb688 util: Move the open-addressing linear-probing hash_table to src/util.
This hash table is used in core Mesa, the GLSL compiler, and the i965
driver, which makes it a good candidate for the new src/util module.

It's much faster than program/hash_table.[ch] (see commit 6991c2922f
for data), and José's u_hash_table.c has a comment saying Gallium should
probably consider switching to a linear probing hash table at some point.
So this seems like the best candidate for a shared data structure.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

v2 (Jason Ekstrand): Pick up another hash_table use and patch up scons

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:07:05 -07:00
Kenneth Graunke
1e0da6233b util: Move ralloc to a new src/util directory.
For a long time, we've wanted a place to put utility code which isn't
directly tied to Mesa or Gallium internals.  This patch creates a new
src/util directory for exactly that purpose, and builds the contents as
libmesautil.la.

ralloc seemed like a good first candidate.  These days, it's directly
used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl
didn't make much sense.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

v2 (Jason Ekstrand): More realloc uses and some scons fixes

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:58 -07:00
Jason Ekstrand
dcc29c18b4 mesa/SConscript: Use Makefile.sources instead of duplicating the file lists
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-04 11:06:52 -07:00
Emil Velikov
87e719ae98 targets/dri: resolve the scons build
With earlier commit we've conditionally enabled/added the kms_dri target
for automake builds. Unfortunately the we forgot to add the appropriate
define in the scons build, resulting in a broken library due to the
undefined symbol 'kms_swrast_create_screen'.

Reported-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Roland Scheidegger <sroland@vmware.com>
2014-08-04 18:26:35 +01:00
Jan Vesely
cf3c73cf20 mesa/st: Fix compiler warnings
both array and index are unsigned types

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 09:51:44 -06:00
Jan Vesely
6614def764 gallium: Fix compiler warning.
warning: type qualifiers ignored on function return type

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-04 09:51:38 -06:00
Tapani Pälli
d66acc7077 glsl: fix switch statement default case regressions
This patch fixes regressions caused by commit 48deb4d. Regressions
happened because 'run_default' var did not get initialized when default
case was the last one.

Now all the switch tests in es3conform suite are passing.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81857
2014-08-04 12:32:59 +03:00
Aaron Watry
47e5039680 st/dri: Fix driver loading if swrast isn't built
If building hardware drivers only, then kms_swrast_create_screen
won't be defined in inline_drm_helper.h and hardware drivers will
fail to dlopen as a result.

Copy the #if guards from inline_drm_helper.h to dri_kms_init_screen
to make the definition/use of the function match.

Fixes radeonsi_dri.so dlopen with the following configure:

./configure --with-dri-drivers= --with-dri-driverdir=/usr/local/lib/dri/ \
--enable-gbm --enable-gallium-gbm --enable-debug --enable-opencl \
--enable-opencl-icd --with-gallium-drivers=radeonsi \
--with-egl-platforms=drm --enable-glx-tls --enable-texture-float \
--enable-omx

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-03 12:13:47 -05:00
Ilia Mirkin
7b3d0a9a1e mesa/st: only convert AND(a, NOT(b)) into MAD when not using native integers
Native integers imply a somewhat different handling of booleans. Instead
of being 1.0/0.0 floats, they are 0 (true) / -1 (false) integers. As such
the original optimization no longer applies.

Reported-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-08-03 10:05:53 -04:00
Marek Olšák
152006e149 Remove XA state tracker support for Radeon
We don't support this type of X acceleration and we never did.
Other drivers might want to do the same thing.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-03 14:00:25 +02:00
Carl Worth
179c5d4e6d docs: Import 10.2.5 release notes, add news item. 2014-08-02 22:54:26 -07:00
Ilia Mirkin
47b064fd8a mesa/st: add support for dynamic ubo selection
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
v2: fix src register, use index2D for base of 1
Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-08-02 23:51:40 -04:00
Kenneth Graunke
5d90926052 i965: Delete stale "pre-gen4" comment in texture validation code.
In commit 16060c5adc, Eric changed the
code to not relayout just for baselevel changes - only if the range of
miplevels actually increases.  So this comment is now wrong.

Notably, the i915 version of the code actually does what the comment
says.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-02 05:25:06 -07:00
Kenneth Graunke
8ccae4fe28 i965: Delete sampler state structures.
We've moved to using bitshifts (like we did for surface state); nothing
uses the structures anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
b8c2538e17 i965: Replace sizeof(struct gen7_sampler_state) with the size itself.
These are the last users of struct gen7_sampler_state.

v2: Use a local sampler_state_size variable, to help distinguish the
    various 16s (suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
7da612e8d0 i965: Drop sizeof(struct brw_sampler_state) from estimated prim size.
This is the last user of the structure.

v2: Use a local variable with a sensible name so people know what 16 is.
    (Suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
3d1a4d1f5b i965: Make BLORP use brw_emit_sampler_state().
This simplifies the code, removes use of the old structures, and also
allows us to combine the Gen6 and Gen7+ code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:41 -07:00
Kenneth Graunke
6b5b78b518 i965: Delete redundant sampler state dumping code.
Although the Gen4-6 and Gen7+ variants used different structure types,
they didn't use any of the fields - only the size, which is identical.
So both decoders did exactly the same thing.

Someday we should implement useful decoders for SAMPLER_STATE.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
3f3e0be666 i965: Make some brw_sampler_state.c functions static again.
Now that gen7_sampler_state.c is gone, everything is once again in a
single file.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
2fe2fe1fce i965: Stop using gen7_update_sampler_state; rm gen7_sampler_state.c.
The code in brw_sampler_state.c now handles all generations; we don't
need the extra Gen7+ only code anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
7679393f56 i965: Make brw_update_sampler_state use 8 bits for LOD fields on Gen7+.
This was the only actual difference between Gen4-6 and Gen7+ in terms of
the values we program.  The rest was just mechanical structure
rearrangement.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
a50b640dfe i965: Make brw_update_sampler_state() use brw_emit_sampler_state().
Instead of stuffing bits directly into the brw_sampler_state structure,
we now store them in local variables, then use brw_emit_sampler_state()
to assemble the packet.  This separates the decision about what values
to use from the actual packet emission, which makes the code more
reusable across generations.

v2: Put const on a bunch of local variables and move declarations,
    as suggested by Topi Pohjolainen.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
05f0796eb6 i965: Introduce a function to emit a SAMPLER_STATE structure.
This simply assembles all the SAMPLER_STATE fields into their proper bit
locations.  Making it work on all generations was easy enough; some of
the fields are even in the same place.

Not used by anything yet, but will be soon.  I made it non-static so
BLORP can use it too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:16:40 -07:00
Kenneth Graunke
7cdb0a30fa i965: Add const to upload_default_color's sampler parameter.
It doesn't edit the value, and this lets us use const in more places.

Needed to implement Topi's review comments for the next patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-08-02 05:16:18 -07:00
Kenneth Graunke
b590a1237c i965: Add #defines for SAMPLER_STATE fields.
We'll use these to replace the existing structures.

I've adopted the convention that "BRW" applies to all hardware, and
"GENX" applies starting with generation X, but might be replaced by some
later generation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
eee8196782 i965: Convert wrap mode #defines to an enum.
This makes it easy to tell that they're grouped together, and also
improves gdb printing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
6afe21da62 i965: Delete gen7_upload_sampler_state_table and vtable mechanism.
brw_upload_sampler_state_table now handles all generations, so we don't
need the vtable mechanism either.

There's still a lot of code duplication; the next patches will address
that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
c2f231e181 i965: Make brw_upload_sampler_state_table handle Gen7+ as well.
This copies a few changes from gen7_upload_sampler_state_table; the next
patch will delete that function.

Gen7+ has per-stage sampler state pointer update packets, so we emit
them as soon as we emit a new table for a stage.  On Gen6 and earlier,
we have a single packet, so we delay until we've changed everything
that's going to be changed.

v2: Split 3DSTATE_SAMPLER_STATE_POINTERS_XS packet emission into a
    helper function (suggested by Topi Pohjolainen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
8fbc96ca74 i965: Shift brw_upload_sampler_state_table away from structures.
The Gen4-6 and Gen7+ code is virtually identical, but both use different
structure types.  Switching to use a uint32_t pointer and operate on the
number of DWords will make it possible to share code.

It turns out that SURFACE_STATE is the same number of DWords on every
platform currently; it will be easy to handle a change there, though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
378eea9708 i965: Push computation for sampler state batch offsets up a level.
Other than this, brw_update_sampler_state only deals with a single
SAMPLER_STATE structure, and doesn't need to know which position it is
in the table.  The caller takes care of dealing with multiple surface
states.

Pushing this up a level allows us to drop the ss_index parameter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
7efa183e8f i965: Drop unused 'ss_index' parameter from gen7_update_sampler_state.
This was copied from the Gen4-6 code, but is unused.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
a381592a8e i965: Stop storing sdc_offset in brw_stage_state.
sdc_offset is produced and consumed in the same function, so there's no
need to store it in the context, nor pass pointers to it through various
call chains.

Saves 128 bytes per brw_stage_state structure, and makes the code
clearer as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
9a1a8cb84d i965: Drop the degenerate brw_sampler_default_color structure.
It's just an array of four floats, and we have an array of four floats,
so this is literally just a memcpy...but with custom structs and strange
macros to give the appearance of doing something more.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
c8e2549785 i965: Write a better file comment for brw_sampler_state.c.
The old one has been inaccurate for years.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
3f67fb4dc3 i965: Rename brw_wm_sampler_state.c to brw_sampler_state.c.
When the driver was originally written, it only supported texturing in
the pixel shader backend; vertex and geometry shader texturing came much
later.  Originally, the pixel shader was referred to as "WM" (the
Windowizer/Masker unit).  So, this code happened to only be relevant for
the WM stage, at the time.

However, sampler state really applies to all stages, so putting "wm" in
the filename doesn't make sense.  I dropped it in gen7_sampler_state.c;
at this point the asymmetry just trips people up.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kenneth Graunke
6e12035834 i965/blorp: Don't set min_mag_neq bit in Gen6 SAMPLER_STATE.
The "Min/Mag State Not Equal" bit is supposed to be set when the min/mag
filters or address rounding modes differ.  BLORP uses identical min/mag
settings, so the bit should be unset.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-08-02 05:14:42 -07:00
Kevin Rogovin
e41cc45361 define GL_OES_standard_derivatives if extension is supported
Define the macro GL_OES_standard_derivatives as 1 if the extension
GL_OES_standard_derivatives is supported.

V2 [Chris]: Correct trailing whitespace

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-02 11:52:41 +12:00
Roland Scheidegger
3b69347efc llvmpipe: don't store number of layers per level
This could be recalculated, though it turns out the only use of it after
resource allocation is for calculating whole resource size (for scene size
accounting though that isn't quite ideal neither). Thus, instead just store
the whole resource size and drop it (saving a couple bytes of storage per
resource). It makes things simpler too. Note that for the accounting winsys
resources always come back with size 0 but this is unchanged (we don't actually
know the size in any case).
Also reformat llvmpipe_texture_layout (drop unneded indentation).

v2: adapt to previous changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-01 23:31:11 +02:00
Roland Scheidegger
7e7aebbbd0 llvmpipe: integrate memory allocation into llvmpipe_texture_layout
Seems pointless to just duplicate some of the calculations (the calculation
of actual memory used compared to what was predicted in llvmpipe_texture_layout
actually could have differed slightly in some cases due to different alignment
rules used though this should have been of no consequence).

v2: keep the previous mip alignment of MAX2(64, cacheline). This was added for
ARB_map_buffer_alignment - I'm not convinced it's needed for textures, but
it was supposed to be cleanup without functional change. Also replace div
with 64bit mul / comparison.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-08-01 23:31:11 +02:00
Roland Scheidegger
47096fbb5d llvmpipe: get rid of impossible code in alloc_image_data
Only used for non display target resources.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-08-01 23:31:11 +02:00
Jordan Justen
c860a379d2 i965/miptree: Layout 1D Array as 2D Array with height of 1
1D array miptrees were being laid out as a 2D texture with 1 slice.
This happened due to the mesa core storing the 1D array slice count in
the height field. On Intel hardware, we want to create a 2D array with
a height of 1 for the 1D array case.

Fixes assertion failure in piglit (gen6, gen8):
spec/glsl-1.30/execution/tex-miplevel-selection textureOffset 1DArrayShadow

In release builds of Mesa, this test was observed to cause a GPU hang
on gen8.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81450
Tested-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-08-01 11:13:07 -07:00
Glenn Kennard
3a9278b92c r600g: Implement gpu_shader5 textureGather
Adds 0-3 textureGather component selection and non-constant offsets

Caveat: 0 and 1 texture swizzles only work if textureGather component
select is 3 or a component that does not exist in the sampler texture
format. This is a hardware limitation, any other value returns
128/255=0.501961 for both 0 and 1.

Passes all textureGather piglit tests on radeon 6670, except for those
using 0/1 texture swizzles due to aforementioned reason.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 16:19:47 +02:00
Aditya Atluri
f455f34ab9 mesa: Add missing atomic buffer bindings and unbindings
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 15:50:26 +02:00
Michel Dänzer
150ac07b85 r600g/radeonsi: Prefer VRAM for CPU -> GPU streaming buffers
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 11:25:27 +09:00
Michel Dänzer
8898fff46c r600g/radeonsi: Reduce or even drop special treatment of persistent mappings
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-08-01 11:04:16 +09:00
Jon TURNEY
095c37e472 target-helpers: Do not build kms_dri on libdrm-less platforms.
Fix build since 3b176c441b for
dri_platform=none hosts.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-01 01:31:58 +01:00
Glenn Kennard
b1eb00cd40 r600g: gpu_shader5 gl_SampleMaskIn support
Map TGSI_SEMANTIC_SAMPLEMASK to register/component.
Enable face register when sample mask is needed by shader.
Requires Evergreen/Cayman

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-31 11:51:05 +02:00
Glenn Kennard
2768a56f58 r600g: Implement gpu_shader5 integer ops
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-31 11:51:04 +02:00
Glenn Kennard
2133a1aedf r600g: Add IMUL_HI/UMUL_HI support
Fixes fs-imulExtended, fs-imulExtended-only-msb, fs-umulExtended,
fs-umulExtended-only-msb piglit tests.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-31 11:51:04 +02:00
Glenn Kennard
a48b615006 r600g: Implement GL_ARB_texture_query_lod
Requires Evergreen or later

v2 (Andreas): Update relnotes/10.3

Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2014-07-31 11:51:04 +02:00
Eric Anholt
1da4bb5b97 gbm: Log at least one dlerror() when we fail to open any drivers.
We don't want to log every single error (such as all the ones where the file
wasn't even present in our list of search paths), but if you didn't find any
driver, then seeing at least one error is useful (since the common case as a
developer is a single DEFAULT_DRIVER_DIR or GBM_DRIVERS_PATH entry).

v2: Rebase on swrast changes.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 22:31:30 -07:00
Eric Anholt
ef81ce9909 gbm: Fix a debug log message
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 22:30:19 -07:00
Eric Anholt
bfb0da9fa7 gallium: Add a uif() helper function to complement fui()
I found myself often wanting this when I'm printing out a uint32_t mapping
of some GPU data, and I want to put in an interpretation of that value as
a float.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 22:30:19 -07:00
Vinson Lee
bf3a26266d glapi: Do not use backtrace on DragonFly.
execinfo.h is not available on DragonFly.

Fixes this build 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>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-30 21:48:09 -07:00
Roland Scheidegger
5a12155503 gallivm: fix up out-of-bounds level when using conformant out-of-bound behavior
When using (d3d10) conformant out-of-bound behavior for texel fetching
(currently always enabled) the level still needs to be set to a safe value
even though the offset in the end won't get used because the level is used
to look up the mip offset itself and the actual strides, which might otherwise
crash.
For simplicity, we'll use level 0 in this case (this ought to be safe, llvmpipe
does not actually fill in level 0 information if first_level is larger, but
some random strides / offsets shouldn't hurt as ultimately we always use
offset 0 in this case).
Fixes a crash in some in-house test where random huge levels appear in
lp_build_fetch_texel() (the test actually uses level 0 always but if the
fetching happens in a block with a execution mask random values may appear).

CC: <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-07-31 01:31:06 +02:00
Giovanni Campagna
e57ad3d38c dri: Add a new capabilities for drivers that can't share buffers
The kms-dri swrast driver cannot share buffers using the GEM,
so it must tell the loader to disable extensions relying on
that, without disabling the image DRI extension altogether
(which would prevent the loader from working at all).
This requires a new gallium capability (which is queried on
the pipe_screen and for swrast drivers it's forwarded to the
winsys), and requires a new version of the DRI image extension.

[Emil Velikov]
 - Rebased on top of gallium-dri megadrivers.
 - Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook.
The can_share_buffer cap is set at InitScreen. We use a different
InitScreen (and thus value for the cap) function for kms_dri, due to
deeper differences originating from dri megadrivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:43:41 +01:00
Giovanni Campagna
3b176c441b gallium: Add a dumb drm/kms winsys backed swrast provider
Add a new winsys and target that can be used with a dri2 state tracker
and loader instead of drisw. This allows to use gbm as a dri2/image
loader and avoid the extra copy from the backbuffer to the shadow
frontbuffer.

The new driver is called "kms_swrast", and is loaded by gbm as a
fallback, because it is only useful with the gbm platform (as no buffer
sharing is possible)

To force select the driver set the environment variable
GBM_ALWAYS_SOFTWARE

[Emil Velikov]
 - Rebase on top of gallium megadriver.
 - s/text/test/ in configure.ac (Spotted by Andreas Pokorny).
 - Add scons support for winsys/sw/kms-dri and fix the build.
 - Provide separate DriverAPI, due to different InitScreen hook.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Giovanni Campagna
8430af5ebe Add support for swrast to the DRM EGL platform
Turn GBM into a swrast loader (providing putimage/getimage backed
by a dumb KMS buffer). This allows to run KMS+DRM GL applications
(such as weston or mutter-wayland) unmodified on cards that don't
have any client side HW acceleration component but that can do
modeset (examples include simpledrm and qxl)

[Emil Velikov]
 - Fix make check.
 - Split dri_open_driver() from dri_load_driver().
 - Don't try to bind the swrast extensions when using dri.
 - Handle swrast->CreateNewScreen() failure.
 - strdup the driver_name, as it's free'd at destruction.
 - s/LIBGL_ALWAYS_SOFTWARE/GBM_ALWAYS_SOFTWARE/
 - Move gbm_dri_bo_map/unmap to gbm_driiint.h.
 - Correct swrast fallback logic.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Emil Velikov
e3a3dbe940 st/gbm: don't segfault if the fail to create the screen
Whenever dd_create_screen/pipe_loader_* fails, gdrm->dev may be NULL.
Thus peeking inside the struct will lead to a crash.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Emil Velikov
d93ae21939 st/gbm: retrieve the driver-name via dd_driver_name()
... on static targets. Otherwise we'll crash badly as gdrm->dev is
NULL when we try to copy the string driver_name.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-30 16:33:09 +01:00
Brian Paul
85109bc507 glsl/glcpp: rename ERROR to ERROR_TOKEN to fix MSVC build
ERROR is a #define in the MSVC WinGDI.h header file.
Add the _TOKEN suffix as we do for a few other lexer tokens.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-30 08:12:03 -06:00
Ian Romanick
66decc7efa configure: Don't override user -g or -O options for debug builds
Principle of least surprise: --enable-debug should enable debugging.
Ages ago, Mesa's build system only added -g in dri-debug builds (yay for
the static Makefiles).  If you forgot to change it (or wrap the build
with custom scripts), you would often be disappointed when trying to gdb
Mesa bugs.  New developers, that may not yet have custom scripts, will
have this same issue.

I think we should enable experienced developers to do what they want,
and make things easier for new developers.  I already pass '-ggdb3 -O1'
or '-ggdb3 -Og' for CFLAGS, and I don't want configure to change them
for me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-29 15:49:27 -07:00
Carl Worth
a62354a987 glsl: Add flex options to eliminate the default rule
We've had bugs in the past where we have been inadvertently matching the
default rule.

Just as we did in the pre-processor in the previous commit, we can use:

	%option warn nodefault

in the compiler to instruct flex to not generate the default rule, and
further to warn if our set of rules could let any characters go unmatched.

With this warning active, flex actually warns that the catch-all rule we
recently added to the compiler could never be matched. Since that is all
safely determined at compile time now, we can safely drop this run-time
compiler error message, (as we do in this commit).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
bc8721f16f glsl/glcpp: Add flex options to eliminate the default rule.
We've had multiple bugs in the past where we have been inadvertently matching
the default rule, (which we never want to do). We recently added a catch-all
rule to avoid this, (and made this rule robust for future start conditions).

Kristian pointed out that flex allows us to go one step better. This syntax:

	%option warn nodefault

instructs flex to not generate the default rule at all. Further, flex will
generate a warning at compile time if the set of rules we provide are
inadequate, (such that it would be possible for the default rule to be
matched).

With this warning in place, I found that the catch-all rule was in fact
missing something. The catch-all rule uses a pattern of "." which doesn't
match newlines. So here we extend the newline-matching rule to all start
conditions. That is enough to convince flex that it really doesn't need
any default rule.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
4ebff9bca6 glsl/glcpp: Combine the two rules matching any character
Using a single rule here means that we can use the <*> syntax to match
all start conditions. This makes the catch-all rule more robust against
the addition of future start conditions, (no need to maintain an ever-
growing list of start conditions for this rul).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
80e9301d9b glsl/glcpp: Alphabetize lists of start conditions
There is no behavioral change here. It's just easier to verify that lists
of start conditions include all expected conditions when they appear in a
consistent order.

The <INITIAL> state is special, so it appears first in all lists. All others
appear in alphabetical order.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-29 15:11:51 -07:00
Carl Worth
f9c99aefea glsl/glcpp: Add a catch-all rule for unexpected characters.
In some of the recent glcpp bug-fixing, we found that glcpp was emitting
unrecognized characters from the input source file to stdout, and dropping
them from the source passed onto the compiler proper.

This was obviously confusing, and totally undesired.

The bogus behavior comes from an implicit default rule in flex, which is
that any unmatched character is implicitly matched and printed to stdout.

To avoid this implicit matching and printing, here we add an explicit
catch-all rule. If this rule ever matches it prints an internal compiler
error. The correct response for any such error is fixing glcpp to handle
the unexpected character in the correct way.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:51 -07:00
Carl Worth
4757c74c84 glsl/glcpp: Treat carriage return as equivalent to line feed.
Previously, the '\r' character was not explicitly matched by any lexer
rule. This means that glcpp would have been using the default flex rule to
match '\r' characters, (where they would have been printed to stdout rather
than actually correctly handled).

With this commit, we treat '\r' as equivalent to '\n'. This is clearly an
improvement the bogus printing to stdout. The resulting behavior is compliant
with the GLSL specification for any source file that uses exclusively '\r' or
'\n' to separate lines.

For shaders that use a multiple-character line separator, (such as "\r\n"),
glcpp won't be precisely compliant with the specification, (treating these as
two newline characters rather than one), but this should not introduce any
semantic changes to the shader programs.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:51 -07:00
Carl Worth
12d583b21a glsl/glcpp: Add test for a multi-line comment within an #if 0 block
This test is written to exercise a bug which I recently wrote, (but
fortunately caught and fixed before ever committing it).

For the curious:

  The bug happened when the NEWLINE_CATCHUP code didn't actually return the
  NEWLINE token (due to the skipping). This resulted in the lexer continuing
  on through all the subsequent rules while still in the NEWLINE_CATCHUP start
  condition, (which then triggered the internal-compiler-error catch-all
  rule).

  What is intended is for the return of the NEWLINE token to start a new
  iteration of the lexer loop, at which time the NEWLINE_CATCHUP-handling code
  will reset from the <NEWLINE_CATCHUP> to the <INITIAL> start condition.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
346d712e87 glsl/glcpp: Test that macro parameters substitute immediately after periods
At one point while rewriting the lexing rule for pre-processing numbers, I
made it a bit too aggressive and within a replacement list sucked up a
parameter name that appeared immediately after a period. This caused the
parameter name to be unreplaced when the macro was expanded.

It was in some piglit tests that I originally found this issue. Here, I'm
adding a test to "make check" to ensure that this behavior remains correct.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
285c9392ad glsl/glcpp: Add (non)-support for ++ and -- operators
These operators aren't defined for preprocessor expressions, so we never
implemented them. This led them to be misinterpreted as strings of unary
'+' or '-' operators.

In fact, what is actually desired is to generate an error if these operators
appear in any preprocessor condition.

So this commit looks like it is strictly adding support for these
operators. And it is supporting them as far as passing them through to the
subsequent compiler, (which was already happening anyway).

What's less apparent in the commit is that with these tokens now being lexed,
but with no change to the grammar for preprocessor expressions, these
operators will now trigger errors there.

A new "make check" test is added to verify the desired behavior.

This commit fixes the following Khronos GLES3 CTS test:

	invalid_op_1_vertex
	invalid_op_1_fragment
	invalid_op_2_vertex
	invalid_op_2_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
34cd293c8a glsl/glcpp: Emit error for duplicate parameter name in function-like macro
This will emit an error for something like:

	#define FOO(x,x) ...

Obviously, it's not a legal thing to do, and it's easy to check.

Add a "make check" test for this as well.

This fixes the following Khronos GLES3 CTS tests:

	invalid_function_definitions.unique_param_name_vertex
	invalid_function_definitions.unique_param_name_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
fe1e0ac852 glsl/glcpp: Add an explanatory comment for "loc != NULL" check
Just reading the code, it looked like a bug that _define_object_macro had this
check, but _define_function_macro did not. Upon further reading, that's
because the check is to allow for our builtins to be defined, (and there are
no builtin function-like macros).

Add my new understanding as a comment to help the next reader.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
18c589d20e glsl/glcpp: Drop the HASH_ prefix from token names like HASH_IF
Previously, we had a single token for "#if" but now that we have two separate
tokens, it looks much better to see:

	HASH_TOKEN IF

than:

	HASH_TOKEN HASH_IF

(Note, that for the same reason we use HASH_TOKEN instead of HASH, we also use
DEFINE_TOKEN instead of DEFINE to avoid a conflict with the <DEFINE> start
condition in the lexer.)

There should be no behavioral change from this commit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Kenneth Graunke
de0b4b6607 glsl: Properly lex extra tokens when handling # directives.
Without this, in the <PP> state, we would hit Flex's default rule, which
prints tokens to stdout, rather than returning them as tokens. (Or, after the
previous commit, we would hit the new catch-all rule and generate an internal
compiler error.)

With this commit in place, we generate the desired syntax error.

This manifested as a weird bug where shaders with semicolons after
extension directives, such as:

   #extension GL_foo_bar : enable;

would print semicolons to the screen, but otherwise compile just fine
(even though this is illegal).

Fixes Piglit's extension-semicolon.frag test.

This also fixes the following Khronos GLES3 conformance tests, (and for real
this time):

	invalid_char_in_name_vertex
	invalid_char_in_name_fragment

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
f196eb2d39 glsl: Add an internal-error catch-all rule
This is to avoid the default, silent flex rule which simply prints the
character to stdout.

For the following Khronos GLES3 conformance tests:

	invalid_char_in_name_vertex
	invalid_char_in_name_fragment

With this commit, these tests now report Pass where they previously reported
Fail, but Mesa isn't behaving correctly yet. It's now reporting the internal
error where what is really desired is a syntax error.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
f062f0506a glsl/glcpp: Correctly parse directives with intervening comments
It's legal (though highly bizarre) for a pre-processor directive to look like
this:

	#  /* why? */ define FOO bar

This behavior comes about since the specification defines separate logical
phases in a precise order, and comment-removal occurs in a phase before the
identification of directives.

Our implementation does not use an actual separate phase for comment removal,
so some extra care is necessary to correctly parse this. What we want is for
'#' to introduce a directive iff it is the first token on a line, (ignoring
whitespace and comments). Previously, we had a lexical rule that worked only
for whitespace (not comments) with the following regular expression to find a
directive-introducing '#' at the beginning of a line:

	HASH		^{HSPACE}*#{HSPACE}*

In this commit, we switch to instead use a simple literal match of '#' to
return a HASH_TOKEN token and add a new <HASH> start condition for whenever
the HASH_TOKEN is the first non-space token of a line. This requires the
addition of the new bit of state: first_non_space_token_this_line.

This approach has a couple of implications on the glcpp parser:

	1. The parser now sees two separate tokens, (such as HASH_TOKEN and
	   HASH_DEFINE) where it previously saw one token (HASH_DEFINE) for
	   the sequence "#define". This is a straightforward change throughout
	   the grammar.

	2. The parser may now see a SPACE token before the HASH_TOKEN token of
	   a directive. Previously the lexical regular expression for {HASH}
	   would eat up the space and there would be no SPACE token.

This second implication is a bit of a nuisance for the parser. It causes a
SPACE token to appear in a production of the grammar with the following two
definitions of a control_line:

	control_line
	SPACE control_line

This is really ugly, since normally a space would simply be a token
separator, so it wouldn't appear in the tokens of a production. This leads to
a further problem with interleaved spaces and comments:

	/* ... */    /* ... */ #define /* ..*/

For this, we must not return several consecutive SPACE tokens, or else we would need an arbitrary number of new productions:

	SPACE SPACE control_line
	SPACE SPACE SPACE control_line
	ad nauseam

To avoid this problem, in this commit we also change the lexer to emit only a
single SPACE token for any series of consecutive spaces, (whether from actual
whitespace or comments). For this compression, we add a new bit of parser
state: last_token_was_space. And we also update the expected results of all
necessary test cases for the new compression of space tokens.

Fortunately, the compression of spaces should not lead to any semantic changes
in terms of what the eventual GLSL compiler sees.

So there's a lot happening in this commit, (particularly for such a tiny
feature). But fortunately, the lexer itself is looking cleaner than ever. The
only ugly bit is all the state updating, but it is at least isolated to a
single shared function.

Of course, a new "make check" test is added for the new feature, (directives
with comments and whitespace interleaved in many combinations).

And this commit fixes the following Khronos GLES3 CTS tests:

	function_definition_with_comments_vertex
	function_definition_with_comments_fragment

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:50 -07:00
Carl Worth
dfdf9dc082 glsl/glcpp: Rename HASH token to HASH_TOKEN
This is in preparation for the planned addition of a new <HASH> start
condition to the lexer. Both start conditions and token types are, of course,
in the same default C namespace, so a start condition and a token type with
the same name will collide. (And unfortunately, they are both apparently
implemented as equivalent numeric types so the collision is undetected at
compile time and simply leads to unpredictable behavior at run time.)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
0d5f5d127b glsl/glcpp: Don't use start-condition stack when switching to/from <DEFINE>
This commit does not cause any behavioral change for any valid program. Prior
to entering the <DEFINE> start condition, the only valid start condition is
<INITIAL>, so whether pushing/popping <DEFINE> onto the stack or explicit
returning to <INITIAL> is equivalent.

The reason for this change is that we are planning to soon add a start
condition for <HASH> with the following semantics:

	<HASH>: We just saw a directive-introducing '#'

	<DEFINE>: We just saw "#define" starting a directive

With these two start conditions in place, the only correct behavior is to
leave <DEFINE> by returning to <INITIAL>. But the old push/pop code would have
returned to the <HASH> start condition which would then cause an error when
the next directive-introducing '#' would be encountered.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
2fdc1f50c4 glsl/glcpp: Add a -d/--debug option to the standalone glcpp program
The verbose debug output from the parser is quite useful when debugging, and
having this available as a command-line option is much more convenient than
manually forcing this into the code when needed, (which is what I had been
doing for too long previously).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
8e8f8ff1b2 glsl/glcpp: Fix off-by-one error in column in first-line error messages
For the first line we were initializing the column to 1, but for all
subsequent lines we were initializing the column to 0. The column number is
advanced for each token read before any error message is printed. So the 0
value is the correct initialization, (so that the first column is reported as
column 1).

With this extremely minor change, many of the .expected files are updated such
that error messages for the first line now have the correct column number in
them.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
0742e0acd3 glsl/glcpp: Minor tweak to wording of error message
It makes more sense to print the directive name with the preceding '#'.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
f583f214d5 glsl/glcpp: Stop using a lexer start condition (<SKIP>) for token skipping.
Here, "skipping" refers to the lexer not emitting any tokens for portions of
the file within an #if condition (or similar) that evaluates to false.

Previously, the lexer had a special <SKIP> start condition used to control
this skipping. This start condition was not handled like a normal start
condition. Instead, there was a particularly ugly block of code set to be
included at the top of the generated lexing loop that would change from
<INITIAL> to <SKIP> or from <SKIP> to <INITIAL> depending on various pieces of
parser state, (such as parser->skip_state and parser->lexing_directive).

Not only was that an ugly approach, but the <SKIP> start condition was
complicating several glcpp bug fixes I attempted recently that want to use
start conditions for other purposes, (such as a new <HASH> start condition).

The recently added RETURN_TOKEN macro gives us a convenient way to implement
skipping without using a lexer start condition. Now, at the top of the
generated lexer, we examine all the necessary parser state and set a new
parser->skipping bit. Then, in RETURN_TOKEN, we examine parser->skipping to
determine whether to actually emit the token or not.

Besides this, there are only a couple of other places where we need to examine
the skipping bit (other than when returning a token):

	* To avoid emitting an error for #error if skipped.

	* To avoid entering the <DEFINE> start condition for a #define that is
          skipped.

With all of this in place in the present commit, there are hopefully no
behavioral changes with this patch, ("make check" still passes all of the
glcpp tests at least).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
09b4e12900 glsl/glcpp: Abstract a bit of common code for returning string tokens
Now that we have a common macro for returning tokens, it makes sense to
perform some of the common work there, (such as copying string values).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
828686d4eb glsl/glcpp: Drop extra, final newline from most output
The glcpp parser is line-based, so it needs to see a NEWLINE token at the end
of each line. This causes a trick for files that end without a final newline.

Previously, the lexer for glcpp punted in this case by unconditionally
returning a NEWLINE token at end-of-file, (causing most files to have an extra
blank line at the end). Here, we refine this by lexing end-of-file as a
NEWLINE token only if the immediately preceding token was not a NEWLINE token.

The patch is a minor change that only looks huge for two reasons:

	1. Almost all glcpp test result ".expected" files are updated to drop
	   the extra newline.

	2. All return statements from the lexer are adjusted to use a new
	   RETURN_TOKEN macro that tracks the last-token-was-a-newline state.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:49 -07:00
Carl Worth
5dbdc341e8 glsl/glcpp: Add testing for EOF sans newline (and fix for <DEFINE>, <COMMENT>)
The glcpp implementation has long had code to support a file that ends without
a final newline. But we didn't have a "make check" test for this.

Additionally, the <EOF> action was restricted only to the <INITIAL> state so
it would fail to get invoked if the EOF was encountered in the <COMMENT> or
the <DEFINE> case. Neither of these was a bug, per se, since EOF in either
of these cases is an error anyway, (either "unterminated comment" or
"missing macro name for #define").

But with the new explicit support for these cases, we not generate clean error
messages in these cases, (rather than "unexpected $end" from before).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
21dda50549 glsl/glcpp: Remove some un-needed calls to NEWLINE_CATCHUP
The NEWLINE_CATCHUP code is only intended to be invoked after we lex an actual
newline character ('\n'). The two extra calls here were apparently added
accidentally because the pattern happened to contain a (negated) '\n',
(see commit 6005e9cb28).

I don't think either case could have caused any actual bug. (In the first
case, the pattern matched right up to the next newline, so the NEWLINE_CATCHUP
code was just about to be called. In the second case, I don't think it's
possible to actually enter the <SKIP> start condition after commented newlines
without any intervening newline.)

But, if nothing else, the code is cleaner without these extra calls.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
cc335c0e57 glsl/glcpp: Add support for comments between #define and macro identifier
The recent adddition of an error for "#define followed by a non-identifier"
was a bit to aggressive since it used a regular expression in the lexer to
flag any character that's not legal as the first character of an identifier.

But we need to allow comments to appear here, (since we aren't removing
comments in a preliminary pass). So we refine the error here to only flag
characters that could not be an identifier, nor a comment, nor whitespace.

We also augment the existing comment support to be active in the <DEFINE>
state as well.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
ea2e9300ec glsl/glcpp: Emit proper error for #define with a non-identifier
Previously, if the preprocessor encountered a #define with a non-identifier,
such as:

	#define 123 456

The lexer had no explicit rules to match non-identifiers in the <DEFINE> start
state. Because of this, flex's default rule was being invoked, (printing
characters to stdout), and all text was being discarded by the compiler until
the next identifier. As one can imagine, this led to all sorts of interesting
and surprising results.

Fix this by adding an explicit rule complementing the existing
identifier-based rules that should catch all non-identifiers after #define and
reliably give a well-formatted error message.

A new test is added to "make check" to ensure this bug stays fixed.

This commit also fixes the following Khronos GLES3 CTS test:

	define_non_identifier_vertex

(The "fragment" variant was passing earlier only because the preprocessor was
behaving so randomly and causing the compilation to fail. It's lucky, in fact,
that the "vertex" version succesfully compiled so we could find and fix this
bug.)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-29 15:11:48 -07:00
Carl Worth
9e45fb6f51 glsl/glcpp: Add testing for directives preceded by a space
This test simply has one of each directive, all of which are preceded by a
single space character.
2014-07-29 15:11:48 -07:00
Carl Worth
da7f226a27 glsl/glcpp: Fix to emit spaces following directives
The glcpp lexer and parser use the space_tokens state bit to avoid emitting
tokens for spaces while parsing a directive. Previously, this bit was only
being set again by the first non-space token following a directive.

This led to a bug where a space, (or a comment that should emit a space),
immediately following a directive, (optionally searated by newlines), would be
omitted from the output.

Here we fix the bug by also setting the space_tokens bit whenever we lex a
newline in the standard start conditions.
2014-07-29 15:11:48 -07:00
Marek Olšák
49e2275d0d configure.ac: require libdrm_radeon 2.4.56 because of the Hawaii fix there 2014-07-29 23:25:42 +02:00
Jason Ekstrand
3ea922dd7c main/get_hash_params: Add GL_SAMPLE_SHADING_ARB
GL_SAMPLE_SHADING is specified as a valid pname for glGet in the
GL_ARB_sample_shading extension.  It seems as if we forgot to add it to the
table of pnames.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2014-07-29 10:50:38 -07:00
Yaakov Selkowitz
b12d5f0d00 os_process.c: Add cygwin as an expected platform
mesa/mesa/src/gallium/auxiliary/os/os_process.c:40:2: warning: #warning unexpected platform in os_process.c [-Wcpp]
 #warning unexpected platform in os_process.c
mesa/mesa/src/gallium/auxiliary/os/os_process.c:77:2: warning: #warning unexpected platform in os_process.c [-Wcpp]
 #warning unexpected platform in os_process.c

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-29 17:53:08 +01:00
Yaakov Selkowitz
d05f72d4c3 xmlconfig: Use program_invocation_short_name when building for cygwin
mesa/mesa/src/mesa/drivers/dri/common/xmlconfig.c:104:10: warning: #warning "Per application configuration won't work with your OS version." [-Wcpp]
 #        warning "Per application configuration won't work with your OS version."

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-29 17:52:57 +01:00
Brian Paul
448f14918c docs: fix date typo: July 78 -> 18 2014-07-29 09:16:23 -06:00
Brian Paul
7844263f07 svga: remove unneeded depth==1 assertion in svga_texture_view_surface()
We can create 3D texture views.  Avoids an assertion in piglit
fbo-generatemipmap-3d test and allows it to pass.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-07-29 09:16:23 -06:00
José Fonseca
66a1b3a1da st/wgl: Clamp wglChoosePixelFormatARB's output nNumFormats to nMaxFormats.
While running https://github.com/nvMcJohn/apitest with apitrace I noticed that Mesa was producing bogus results:

  wglChoosePixelFormatARB(hdc, piAttribIList = {...}, pfAttribFList = &0, nMaxFormats = 1, piFormats = {19, 65576, 37, 198656, 131075, 0, 402653184, 0, 0, 0, 0, -573575710}, nNumFormats = &12) = TRUE

However https://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states

    <nNumFormats> returns the number of matching formats. The returned
    value is guaranteed to be no larger than <nMaxFormats>.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-29 15:41:32 +01:00
Michel Dänzer
8d0a1a6bc0 gallium/radeon: Add some Emacs .dir-locals.el files
Based on the toplevel one but adapted to the driver/winsys coding styles.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-29 17:59:13 +09:00
Chia-I Wu
9a53f941c7 ilo: fix fb height of HiZ ops
It was set to aligned width.  It appears to be fine on GEN7+, but causes
random hangs on GEN6.
2014-07-29 10:24:59 +08:00
Tapani Pälli
76b11d15d3 glapi: add indexed blend functions (GL 4.0)
This makes some of the UE4 engine demos (Stylized, Mobile Temple)
render correctly, tested on Intel Haswell machine.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78716
2014-07-28 16:26:27 -07:00
Marek Olšák
a9528cef6b r600g,radeonsi: switch all occurences of array_size to util_max_layer
This fixes 3D texture support in all these cases, because array_size is 1
with 3D textures and depth0 actually contains the "array size".
util_max_layer is universal and returns the last layer index for any texture
target.

A lot of the cases below can't actually be hit with 3D textures, but let's
be consistent.

This fixes a failure in:
    piglit layered-rendering/clear-color-all-types 3d single_level
for r600g and radeonsi, which was caused by an incorrect CMASK size
calculation.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
71ce92200e radeonsi: fix occlusion queries on Hawaii
This was just a guess - and it worked!

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
156b7e244c winsys/radeon: fix vram_size overflow with Hawaii
This fixes piglit spec/!OpenGL 3.1/minmax.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
0e7f56313d radeonsi: fix a hang with streamout on Hawaii
I actually couldn't reproduce this one, but internal docs recommend this
workaround. Better safe than sorry.

Also, the number of dwords for the sync packets is increased by 4 instead
of 2, because it wasn't bumped last time when a new packet was added there.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
3d9e87406c radeonsi: fix a hang with instancing on Hawaii
This fixes "piglit/bin/arb_transform_feedback2-draw-auto instanced".

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
c7407b94a8 gallium/util: add a helper for calculating primitive count from vertex count
This is needed by the following commit which is a candidate for stable too.

Cc: mesa-stable@lists.freedesktop.org
2014-07-28 23:57:08 +02:00
Marek Olšák
9b046474c9 radeonsi: fix CMASK and HTILE calculations for Hawaii
This fixes the checkerboard pattern in glxgears and anything that triggers
fast color clear.

num_channels is always <= 8, but Hawaii has 16 pipes.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
ecbd3a545a r600g,radeonsi: add debug flags which disable tiling
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-28 23:57:08 +02:00
Marek Olšák
04f2c88f45 gallium: rename shader cap MAX_CONSTS to MAX_CONST_BUFFER_SIZE
This new name isn't so confusing.

I also changed the gallivm limit, because it looked wrong.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: use sizeof(float[4])
2014-07-28 23:57:08 +02:00
Marek Olšák
d5bcb5e8de r600g: switch SNORM conversion to DX and GLES behavior
it also matches GL 4.2

further discussion:
http://lists.freedesktop.org/archives/mesa-dev/2013-August/042680.html

Cc: mesa-stable@lists.freedesktop.org
2014-07-28 23:57:08 +02:00
Tom Stellard
5fe20592d4 util: Fix typo
Spotted by okias on IRC.
2014-07-28 16:40:05 -04:00
Chia-I Wu
cc1e1da24a ilo: correctly propagate resource renames to hardware
Not only should we mark states dirty when the underlying resource is renamed,
we should also update the CSO bo when available.
2014-07-28 23:55:55 +08:00
Chia-I Wu
fb1820355b ilo: add ilo_resource_get_bo() helper
We will need it in the following commit.
2014-07-28 23:55:55 +08:00
Tom Stellard
6f0c1f2b5f radeonsi: Use util_memcpy_cpu_to_le32()
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-28 10:14:28 -04:00
Tom Stellard
f0e0737922 util: Add util_memcpy_cpu_to_le32() v3
v2:
  - Preserve word boundaries.

v3:
  - Use const and restrict.
  - Fix indentation.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-28 10:10:43 -04:00
Tom Stellard
3d636b4785 clover: Add checks for image support to the image functions v2
Most image functions are required to return a CL_INVALID_OPERATION
error when used on devices without image support.

v2:
  - Simplified the code

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-28 10:10:30 -04:00
Bruno Jiménez
7f96bea5bc r600g/compute: Add debug information to promote and demote functions
v2: Add information about the item's starting point and size
v3: Rebased on top of master

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-28 10:10:20 -04:00
Bruno Jiménez
e7715126f7 r600g/compute: Add documentation to compute_memory_pool
v2: Rebased on top of master

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-28 10:09:46 -04:00
Chia-I Wu
717e3b1ca1 ilo: unblock an inline write with a staging bo
This should allow a deeper pipeline.
2014-07-28 22:57:22 +08:00
Chia-I Wu
7395432f2e ilo: try unblocking a transfer with a staging bo
When mapping a busy resource with PIPE_TRANSFER_DISCARD_RANGE or
PIPE_TRANSFER_FLUSH_EXPLICIT, we can avoid blocking by allocating and mapping
a staging bo, and emit pipelined copies at proper places.  Since the staging
bo is never bound to GPU, we give it packed layout to save space.
2014-07-28 22:57:22 +08:00
Chia-I Wu
0a0e57b070 ilo: enable persistent and coherent transfers
Enable PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT and reorder caps a bit.
2014-07-28 22:57:22 +08:00
Chia-I Wu
b02e993d8c ilo: drop ptr from ilo_transfer
With the recent clean-ups, we can pass the mapped pointer around between
functions cleanly.  Drop it to make ilo_transfer smaller.
2014-07-28 22:57:22 +08:00
Chia-I Wu
b1dd54d9fe ilo: s/TRANSFER_MAP_UNSYNC/TRANSFER_MAP_GTT_UNSYNC/
It maps to drm_intel_gem_bo_map_unsynchronized(), which results in
unsynchronized GTT mapping.
2014-07-28 22:57:22 +08:00
Chia-I Wu
2a82bb30e8 ilo: drop unused context param from transfer functions
Many of the transfer functions do not need an ilo_context.  Drop it.
2014-07-28 22:57:22 +08:00
Chia-I Wu
8abf6c06e8 ilo: tidy up transfer mapping/unmapping
Add xfer_map() to replace map_bo_for_transfer().  Add xfer_unmap() and
xfer_alloc_staging_sys() to simplify texture and buffer mapping/unmapping, and
enable more code sharing between them.
2014-07-28 22:57:22 +08:00
Chia-I Wu
2f4bed0405 ilo: tidy up choose_transfer_method()
Add a bunch of helper functions and a big comment for
choose_transfer_method().  This also fixes handling of
PIPE_TRANSFER_MAP_DIRECTLY to not ignore tiling.
2014-07-28 22:57:22 +08:00
Chia-I Wu
91656eb375 ilo: free transfers with util_slab_free()
We used FREE() in one of the error path.
2014-07-28 22:57:22 +08:00
EdB
1d3e06c216 clover: Add clUnloadPlatformCompiler.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-28 14:46:44 +02:00
EdB
39869423cb clover: Add clCreateProgramWithBuiltInKernels.
[ Francisco Jerez: Check for devices not associated with the specified
  context.  Style fix. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-28 14:45:29 +02:00
Jordan Justen
be8bc588b9 glsl/cs: Add several GLSL compute shader variables
With MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader, this fixes piglit:
built-in-constants tests/spec/arb_compute_shader/minimum-maximums.txt

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-27 17:59:28 -07:00
Jordan Justen
12029046a2 main/cs: Add additional compute shader constant values
With MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader, this fixes piglit:
* arb_compute_shader-minmax

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-27 17:58:58 -07:00
Chris Forbes
74e100affc glsl: No longer require ubo block index to be constant in ir_validate
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
be237a6129 glsl: Accept nonconstant array references in lower_ubo_reference
Instead of falling back to just the block name (which we won't find),
look for the first element of the block array. We'll deal with the rest
in the backend by arranging for the blocks to be laid out contiguously.

V2: Squashed together patches 3, 5 of V1, plus a naming tweak.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
c59802d3a1 glsl: Convert uniform_block in lower_ubo_reference to ir_rvalue.
Previously this was a block index with special semantics for -1.
With ARB_gpu_shader5, this need not be a compile-time constant, so
allow any rvalue here and convert the -1 to a NULL pointer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
9c90a63378 glsl: Mark entire UBO array active if indexed with non-constant.
Without doing a lot more work, we have no idea which indices may
be used at runtime, so just mark them all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chris Forbes
8eae5ceb99 glsl: Allow non-constant UBO array indexing with GLSL4/ARB_gpu_shader5.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-26 16:46:03 +12:00
Chia-I Wu
4714c4ec48 ilo: simplify ilo_flush()
Move fence creation to the new ilo_fence_create().
2014-07-26 12:30:39 +08:00
Bruno Jiménez
654fd3e33f r600g/compute: Defrag the pool at the same time as we grow it
This allows us two things: we now need less item copies when we have
to defrag+grow the pool (to just one copy per item) and, even in the
case where we don't need to defrag the pool, we reduce the data copied
to just the useful data that the items use.

Note: The fallback path is a bit ugly now, but hopefully we won't need
it much.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 17:51:57 -04:00
Bruno Jiménez
4ca04f3112 r600g/compute: Try to use a temporary resource when growing the pool
Now, before moving everything to host memory, we try to create a
new resource to use as a pool. I we succeed we just use this resource
and delete the previous one. If we fail we fallback to using the
shadow.

This should make growing the pool faster, and we can also save
64KB of memory that were allocated for the 'shadow', even if they
weren't used.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 17:51:57 -04:00
Rob Clark
5eb11eb192 freedreno: fix typo in gpu version check
Opps, I should use larger fonts, I guess.

Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 14:29:02 -04:00
Rob Clark
db193e5ad0 freedreno/ir3: split out shader compiler from a3xx
Move the bits we want to share between generations from fd3_program to
ir3_shader.  So overall structure is:

  fdN_shader_stateobj -> ir3_shader -> ir3_shader_variant -> ir3
                                    |- ...
                                    \- ir3_shader_variant -> ir3

So the ir3_shader becomes the topmost generation neutral object, which
manages the set of variants each of which generates, compiles, and
assembles it's own ir.

There is a bit of additional renaming to s/fd3_compiler/ir3_compiler/,
etc.

Keep the split between the gallium level stateobj and the shader helper
object because it might be a good idea to pre-compute some generation
specific register values (ie. anything that is independent of linking).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
7d7e6ae9c3 freedreno/a3xx/compiler: rename ir3_shader to ir3
First step of reoganization split out compiler (so it can be shared
between a3xx and a4xx).  Rename ir3_shader -> ir3 (since we'll want
the name ir3_shader for a higher level object).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
faaeddb55e freedreno/a3xx/compiler: scheduler vs pred reg
The scheduler also needs to be aware of predicate register (p0) in
addition to address register (a0).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
9f391322a0 freedreno/a3xx/compiler: little cleanups
Remove some obsolete comments, rename deref->addr.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
d48faad3c2 freedreno/a3xx: enable/disable wa's based on patch-level
It seems like for the most part, different behaviors, workarounds, etc,
should be conditional on GPU patch revision (ie. a320.0 vs a320.2)
rather than GPU id (a320 vs a330).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Rob Clark
9613ca569f freedreno/a3xx/compiler: make IR heap dyanmic
The fixed size heap is a remnant of the fdre-a3xx assembler.  Yet it is
convenient for being able to free the entire data structure in one shot
without worrying about leaking nodes.

Change it to dynamically grow the heap size (adding chunks) as needed so
we don't have an artificial upper limit on shader size (other than hw
limits) and don't always have to allocate worst-case size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-25 13:29:28 -04:00
Jan Vesely
0bc1fa22d8 r600g/compute: Fix singed/unsigned comparison compiler warnings.
The iteration variables go from 0 anyway.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 12:55:05 -04:00
Tom Stellard
0ec8587642 clover: Query the device to see if images are supported
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-25 12:49:45 -04:00
Tom Stellard
1607a8efc1 gallium: Add PIPE_CAP_COMPUTE_IMAGES_SUPPORTED
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-25 12:49:20 -04:00
Bruno Jiménez
d6b89aef26 r600g/compute: Allow compute_memory_defrag to defragment between resources
This will be used in the following patch to avoid duplicated code

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 12:38:42 -04:00
Bruno Jiménez
5cf108078c r600g/compute: Allow compute_memory_move_item to move items between resources
v2: Remove unnecesary variables

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-25 12:38:28 -04:00
Dylan Baker
bf1247936a gbm: Search LIBGL_DRIVERS_PATH if GBM_DRIVERS_PATH is not set
The GBM_DRIVERS_PATH environment variable is not documented, and only
used to set the location of gbm drivers, while LIBGL_DRIVERS_PATH is
used for everything else, and is documented.

Generally this split leads to confusion as to why gbm doesn't work.

This patch will read LIBGL_DRIVERS_PATH as a fallback if
GBM_DRIVERS_PATH is not set.

The comments clearly indicate that using LIBGL_DRIVERS_PATH is
preferred over GBM_DRIVERS_PATH.

v2: - Use GBM_DRIVERS_PATH as a fallback
v3: [jordan.l.justen@intel.com] - Make LIBGL_DRIVERS_PATH the fallback

Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-24 23:15:06 -07:00
Jerome Glisse
cce58147eb winsys/radeon: fix indentation
Can we please keep it clean and avoid ending up in messy situation
like ddx.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
2014-07-24 17:30:31 -04:00
Jason Ekstrand
989d2e3709 Add an accelerated version of F_TO_I for x86_64
According to a quick micro-benchmark, this new version is 20% faster on my
Haswell laptop.

v2: Removed the XXX note about x86_64 from the comment
v3: Use an intrinsic instead of an __asm__ block.  This should give us MSVC
    support for free.
v4: Enable it for all x86_64 builds, not just with USE_X86_64_ASM

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-24 12:44:56 -07:00
Matt Turner
2a33510f16 i965/fs: Decide predicate/predicate_inverse outside of the for loop.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-24 11:27:44 -07:00
Matt Turner
96128d134b i965/fs: Swap if/else conditions in SEL peephole.
Will clarify make the next commit easier to read.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-24 11:27:44 -07:00
Matt Turner
ac2acf04f7 i965: Improve dead control flow elimination.
... to eliminate an ELSE instruction followed immediately by an ENDIF.

instructions in affected programs:     704 -> 700 (-0.57%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-24 11:27:43 -07:00
Ilia Mirkin
0ddc28b026 nvc0/ir: support 2d constbuf indexing
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:42 -04:00
Ilia Mirkin
4eef537960 gm107/ir: emit LDC subops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:42 -04:00
Ilia Mirkin
fc3d5fe01d gk110/ir: emit load constant subop
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
9c4959d0df mesa/st: add support for interpolate_at_* ops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
dfb0ca1606 nv50/ir: fix phi/union sources when their def has been merged
In a situation where double-register values are used, the phi nodes can
still end up being u32 values. They all get merged into one RA node
though. When fixing up the merge (which comes after the phi node), the
phi node's def would get fixed, but not its sources which would remain
at the low register value.

This maintains the invariant that a phi node's defs and sources are
allocated the same register.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
32702cceed nv50/ir: fix hard-coded TYPE_U32 sized register
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
3f6b34bacc nvc0: mark shader header if fp64 is used
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
b21a28797c nv50/ir: keep track of whether the program uses fp64
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
47e5a8d7a2 nvc0: make sure that the local memory allocation is aligned to 0x10
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-07-24 08:26:41 -04:00
Ilia Mirkin
637b6c2478 mesa: add ARB_clear_texture.xml to file list, remove duplicate decls
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-24 08:26:41 -04:00
Chia-I Wu
9d6166880d ilo: check the tilings of imported handles
Just to be cautious.
2014-07-24 13:38:51 +08:00
Chia-I Wu
cbc943c43e ilo: clean up resource bo renaming
s/alloc_bo/rename_bo/ as that is what the functions do.  Simplify bo
allocation and move the complexity to bo renaming.
2014-07-24 13:21:35 +08:00
Chia-I Wu
cf8c9947a8 ilo: share some code between {tex,buf}_create_bo
Add resource_get_bo_name() and resource_get_bo_initial_domain() for use by
both functions.
2014-07-24 10:49:02 +08:00
Chia-I Wu
c1a1a627c4 ilo: use native 3-component vertex formats on GEN7.5+
GEN7.5 gains support for those formats natively.
2014-07-24 09:54:20 +08:00
Chia-I Wu
2126541b0b ilo: allow for device-dependent format translation
Pass ilo_dev_info to all format translation functions.
2014-07-24 09:33:33 +08:00
Jason Ekstrand
6bac86cd85 i965: Accelerate uploads of RGBA and BGRA GL_UNSIGNED_INT_8_8_8_8_REV textures
Since intel is always going to be little-endian,
GL_UNSIGNED_INT_8_8_8_8_REV is the same as GL_UNSIGNED_BYTE for RGBA and
BGRA textures, so the same acceleration code will work.  We might as well
use it.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-23 16:48:35 -07:00
Ian Romanick
5072d0e7fc mesa: Fix the name in the error message
Obvious copy-and-paste bug.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 16:42:47 -07:00
Ian Romanick
3f04a1532e glsl: Fix some bad indentation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 16:42:47 -07:00
Kenneth Graunke
d4d886a0bc i965/fs: Set LastRT on the final FB write on Broadwell.
In Piglit's EXT_framebuffer_multisample/alpha-to-coverage-dual-src-blend
test, key->nr_color_regions == 2, but the dual source blend FB write has
ir->target set to 0.  So we failed to set "Last Render Target Select" on
any FB write message.

We only emit one FB write per render target, so my comment about setting
LastRT on every FB write directed at the last color region is a bit...
misinformed.  According to the documentation, depth buffer writes and
scoreboard updates happen on the FB write with LastRT set, so I believe
we want to set it only once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-23 15:44:37 -07:00
Kenneth Graunke
36a4a6bbdc i965: Port INTEL_DEBUG=optimizer to the vec4 backend.
Largely via copy and paste.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 15:44:16 -07:00
Kenneth Graunke
8d2e95bd4b i965: Save the gl_shader_stage enum in backend_visitor.
This will be useful for INTEL_DEBUG=optimizer in the vec4 backend, which
needs to know whether it's currently processing a VS or GS.  It isn't
worth adding virtual methods for this case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 15:44:14 -07:00
Kenneth Graunke
d6d3e6027d i965: Don't print WE_normal in disassembly.
Dropping this helps most lines fit in an 80 column terminal.  The
absence of WE_normal also helps call attention to WE_all, where
something unusual is going on.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-23 15:44:08 -07:00
Rob Clark
2f181bc391 freedreno/a3xx/compiler: fix p0 (kill, etc)
Don't assert (debug builds) or assign random uninitialized value for
predicate register (p0).. that screws up kill, etc.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 15:10:53 -04:00
Tom Stellard
fb237ba746 Revert "r600g/compute: Fix warnings"
This reverts commit 467f1585e2.

This breaks the build on some systems.
2014-07-23 11:52:05 -04:00
Grigori Goronzy
2a766b0b64 radeon/llvm: fix formatting
Use K&R and same indent as most other code. No functional change
intended.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:40:41 -04:00
Grigori Goronzy
0e9cdedd2e radeon/llvm: enable unsafe math for graphics shaders
Accuracy of some operations was recently improved in the R600 backend,
at the cost of slower code. This is required for compute shaders,
but not for graphics shaders. Add unsafe-fp-math hint to make LLVM
generate faster but possibly less accurate code.

Piglit didn't indicate any regressions.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:40:33 -04:00
Tom Stellard
467f1585e2 r600g/compute: Fix warnings 2014-07-23 10:29:17 -04:00
Glenn Kennard
2fa6d659c3 r600g: Use hardware sqrt instruction
Piglit quick tests including sqrt pass, no other regressions,
tested on radeon 6670.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
dbaf0bc388 r600g/compute: Remove unneeded code from compute_memory_promote_item
Now that we know that the pool is defragmented, we positively know
that allocated + unallocated will be the total size of the
current pool plus all the items that will be promoted. So we only
need to grow the pool once.

This will allow us to just add the new items to the end of the
item_list without the need of looking for a place to the new item.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
e7bda844e6 r600g/compute: Quick exit if there's nothing to add to the pool
This way we can avoid defragmenting the pool, even if it is needed
to defragment it, and looping again through the list of unallocated
items.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
90d7b09ed2 r600g/compute: Defrag the pool if it's necesary
This patch adds a new member to the pool to track its status.
For now it is used only for the 'fragmented' status, but if
needed it could be used for more statuses.

The pool will be considered fragmented if: An item that isn't
the last is freed or demoted.

This 'strategy' has a problem, although it shouldn't cause any bug.
If for example we have two items, A and B. We choose to free A first,
now the pool will have the 'fragmented' status. If we now free B,
the pool will retain its 'fragmented' status even if it isn't
fragmented.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
d8b6f0dacb r600g/compute: Add a function for defragmenting the pool
This new function will move items forward in the pool, so that
there's no gap between them, effectively defragmenting the pool.

For now this function is a bit dumb as it just moves items
forward without trying to see if other items in the pool could
fit in the gaps.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Bruno Jiménez
1f705b2bee r600g/compute: Add a function for moving items in the pool
This function will be used in the future by compute_memory_defrag
to move items forward in the pool.

It does so by first checking for overlaping ranges, if the ranges
don't overlap it will copy the contents directly. If they overlap
it will try first to make a temporary buffer, if this buffer fails
to allocate, it will finally fall back to a mapping.

Note that it will only be needed to move items forward, it only
checks for overlapping ranges in that case. If needed, it can
easily be added by changing the first if.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-23 10:29:17 -04:00
Rob Clark
23ae2db854 freedreno/a3xx: more vtx formats
Actually what we currently handle is just the SCALED versions, and not
the int versions.  The difference probably matters more when we actually
support integer in the compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:10 -04:00
Rob Clark
a5ac36a75f freedreno/a3xx/compiler: const file relative addressing
Teach new compiler scheduling and register assignment how to deal with
relative addressing.  This gets us what we need to avoid falling back to
old compiler for CONST[ADDR[0].x+n].  It is also a prerequisite for temp
file relative addressing, although that is going to also need some
cleverness in register assignment to keep arrays grouped together.

NOTE: doing address calculation in full precision and then narrowing to
s16 in the mov to addr reg seems to sometimes cause lockups (and
sometimes work?!).  It seems more reliable to do the address calculation
in s16, like the blob does.  Which means teaching RA how to deal with
mixed half and full precision allocation.  Fortunately that didn't turn
out to be too hard, so that is a nice bonus which we could probably take
better advantage of elsewhere.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:10 -04:00
Rob Clark
c18ae9c293 freedreno/a3xx/compiler: move function
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Rob Clark
3a7da7f5ec freedreno/a3xx: add back a few stalls
Technically we should not need these.  CP_LOAD_STATE can be pipelined.
But removing them broke a few piglit tests, like fbo-depth-
GL_DEPTH_COMPONENT24-readpixels.  I expect these are just masking a
problem elsewhere, or perhaps they are only needed under some more
specific circumstances.  But until that is understood properly, give
back a bit of the perf boost we got from c63450e8.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Rob Clark
9f6dfd16e3 targets/dri: fix freedreno targets
The kernel driver name is either "kgsl" (downstream/android) or "msm"
(upstream).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Rob Clark
c357e8475a freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-07-23 09:03:09 -04:00
Neil Roberts
c6398a38af docs: Update GL3.txt and relnotes for GL_ARB_clear_texture 2014-07-23 12:10:37 +01:00
Neil Roberts
0779f37e15 meta: Add a meta implementation of GL_ARB_clear_texture
Adds an implementation of the ClearTexSubImage driver entry point that tries
to set up an FBO to render to the texture and then calls glClearBuffer with a
scissor to perform the actual clear. If an FBO can't be created for the
texture then it will fall back to using _mesa_store_ClearTexSubImage.

When used in combination with _mesa_store_ClearTexSubImage this should provide
an implementation that works for all DRI-based drivers. However as this has
only been tested with the i965 driver it is currently only enabled there.

v2: Only enable the extension for the i965 driver instead of all DRI drivers.
    Remove an unnecessary goto. Don't require GL_ARB_framebuffer_object. Add
    some more comments.

v3: Use glClearBuffer* to avoid having to modify glClearColor and friends.
    Handle sRGB textures. Explicitly disable dithering.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
05b52efbc9 meta: Add a state flag for the GL_DITHER
The Meta implementation of glClearTexSubImage is going to want to ensure that
dithering is disabled so that it can get a consistent color across the whole
texture when clearing. This adds a state flag to easily save it and set it to
the default value when performing meta operations.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
df9945ca26 texstore: Add a generic implementation of GL_ARB_clear_texture
Adds an implmentation of the ClearTexSubImage driver entry point that just
maps the texture and writes the values in. The extension is not yet enabled by
default because it doesn't work with multisample textures as they don't have a
simple linear layout.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
fbbbf7529c mesa/main: Add generic bits of ARB_clear_texture implementation
This adds the driver entry point for glClearTexSubImage and fills in the
_mesa_ClearTexImage and _mesa_ClearTexSubImage functions that call it.

v2: Don't clear some of the images if only one of them makes an error

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-07-23 11:50:38 +01:00
Neil Roberts
2e63f91e60 teximage: Add utility func for format/internalFormat compatibility check
In texture_error_check() there was a snippet of code to check whether the
given format and internal format are basically compatible. This has been split
out into its own static helper function so that it can be used by an
implementation of glClearTexImage too.
2014-07-23 11:50:38 +01:00
Ilia Mirkin
c4067acd90 mesa/main: add ARB_clear_texture entrypoints
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2014-07-23 11:50:37 +01:00
Michel Dänzer
07c65b85ea r600g/radeonsi: Use write-combined CPU mappings of some BOs in GTT
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-23 18:55:50 +09:00
Michel Dänzer
37d43ebb28 winsys/radeon: Use separate caching buffer managers for VRAM and GTT
Should reduce overhead because the caching buffer manager doesn't need to
consider buffers of the wrong type.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-23 15:43:04 +09:00
Dave Airlie
2c947760ed docs/GL3.txt: update status for ARB_compute_shader
since some bits are done in tree, but nobody is working on it anymore.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-23 11:06:15 +10:00
Anuj Phogat
9548ba6e7b mesa: Don't use memcpy() in _mesa_texstore() for float depth texture data
because float depth texture data needs clamping to [0.0, 1.0]. Let the
_mesa_texstore() fallback to slower path.

Fixes Khronos GLES3 CTS tests:
shadow_execution_vert
shadow_execution_frag

V2: Move the check to _mesa_texstore_can_use_memcpy() function.
    Add check for floating point data types.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 18:33:29 -07:00
Kenneth Graunke
29af97f280 i965/fs: Fix gl_SampleMask handling for SIMD16 on Gen8+.
We actually want to use mov(16), not mov(8).

Fixes 7 Piglit tests: ARB_sample_shading/builtin-gl-sample-mask [2468]
and ARB_sample_shading/builtin-gl-sample-mask-simple [468].

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80991
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-21 14:59:13 -07:00
Kenneth Graunke
38ffef7840 i965/fs: Fix gl_SampleID for 2x MSAA and SIMD16 mode.
We might be able to do this without an extra program key field, but this
is non-invasive and fixes the bug, for now.

This fixes the following Piglit tests on Broadwell:
- ARB_sample_shading/builtin-gl-sample-id 2
- ARB_sample_shading/builtin-gl-sample-position 2
- EXT_framebuffer_multisample/multisample-blit 2 color
- EXT_framebuffer_multisample/multisample-blit 2 color linear
- EXT_framebuffer_multisample/multisample-blit 2 depth
- EXT_framebuffer_multisample/no-color 2 depth combined
- EXT_framebuffer_multisample/no-color 2 depth separate
- EXT_framebuffer_multisample/no-color 2 depth single
- EXT_framebuffer_multisample/no-color 2 depth-computed combined
- EXT_framebuffer_multisample/no-color 2 depth-computed separate
- EXT_framebuffer_multisample/no-color 2 depth-computed single
- EXT_framebuffer_multisample/unaligned-blit 2 color msaa
- EXT_framebuffer_multisample/unaligned-blit 2 depth msaa

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80991
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-21 14:59:12 -07:00
Kenneth Graunke
4cf47c80fc i965: Add missing persample_shading field to brw_wm_debug_recompile.
Otherwise, the performance warning for shader recompiles will just say
"something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-21 11:19:44 -07:00
Kenneth Graunke
caf8c07dd4 i965/disasm: Don't disassemble the URB complete field on Broadwell.
It doesn't exist, so attempting to read it will trigger generation
assertions in the brw_inst API.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-21 11:19:17 -07:00
Kenneth Graunke
662f1ccc24 i965: Disable hex offset printing in disassembly.
Printing the hex offsets makes it basically impossible to diff assembly:
if you add even a single instruction, the entire shader shows up as a
difference.  So, every time I want to compare assembly, I have to strip
this out.

The hex offsets might be useful when debugging compaction, or when
inspecting the program cache buffer.  Since it's occasionally useful,
but uncommon, this patch disables it by default, but makes it easy to
re-enable it temporarily when the need arises.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-21 11:19:08 -07:00
Matt Turner
3e9105f7ee i965/vec4: Use foreach_inst_in_block a couple more places.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:41 -07:00
Matt Turner
1761671b06 i965: Replace cfg instances with calls to calculate_cfg().
Avoids regenerating it unnecessarily.

Every program in shader-db improved, none by an amount less than a 1/3
reduction. One Dota2 shader decreased from 62 -> 24.

cfg calculations:     429492 -> 193197 (-55.02%)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:39 -07:00
Matt Turner
dd65a6d9ad i965/cfg: Add a foreach_block_and_inst macro.
Will let us abstract how the instructions are stored.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:38 -07:00
Matt Turner
680fe0acb3 i965: Add cfg to backend_visitor.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-21 10:35:34 -07:00
Tom Stellard
b0f780345e radeonsi/compute: Add support scratch buffer support v2
The scratch buffer will be used for private memory and also register
spilling.

v2:
  - Code cleanups
2014-07-21 10:00:09 -04:00
Tom Stellard
6cc5334e42 radeonsi/compute: Bump number of user sgprs for LLVM 3.5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 10:00:09 -04:00
Tom Stellard
81385f7596 winsys/radeon: Query the kernel for the number of SEs and SHs per SE
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 10:00:09 -04:00
Tom Stellard
245e86168a radeonsi/compute: Share COMPUTE_DBG macro with r600g
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-21 10:00:09 -04:00
Tom Stellard
9ba3105e0a radeonsi: Read rodata from ELF and append it to the end of shaders
The is used for programs that have arrays of constants that
are accessed using dynamic indices.  The shader will compute
the base address of the constants and then access them using
SMRD instructions.
2014-07-21 10:00:09 -04:00
Ian Romanick
01c21c459f glsl: Fix bad indentation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:04:04 -07:00
Ian Romanick
47e2a74a5a i965: Silence unused parameter warning
brw_fs_visitor.cpp:2400:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:04:01 -07:00
Ian Romanick
22b9641edf i965: Silence 'comparison is always true' warning
The parameter is an int16_t, and we're check that it's value will fit in
16-bits.  Yes, the value that is stored in 16-bits will surely fit in
16-bits.

brw_inst.h: In function 'brw_inst_set_gen6_jump_count':
brw_inst.h:321:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
brw_inst.h:321:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:03:57 -07:00
Ian Romanick
1946612b7d i965: Silence many unused parameter warnings
brw_inst.h: In function 'brw_inst_set_src1_vstride':
brw_inst.h:118:76: warning: unused parameter 'brw' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-19 15:03:49 -07:00
Vinson Lee
f6fc807345 configure.ac: Add LLVM patch version to error message.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-18 21:33:38 -07:00
Jason Ekstrand
ecd3e89b32 main/format_pack: Fix a wrong datatype in pack_ubyte_R8G8_UNORM
Before it was only storing one of the color components due to truncation.
With this patch it now properly stores all of them.

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-18 18:34:36 -07:00
Carl Worth
8ed24543f8 docs: Import 10.2.4 release notes
And add a news item.
2014-07-18 16:50:05 -07:00
Jason Ekstrand
f14d217f5c Add support for RGBA8 and RGBX8 textures in intel_texsubimage_tiled_memcpy
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-07-17 18:20:09 -07:00
Jason Ekstrand
765f4b8c04 i965: Improve debug output in intelTexImage and intelTexSubimage
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-07-17 18:20:09 -07:00
Marek Olšák
d808de31bd radeonsi: only update vertex buffers when they need updating
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
6210d6fdc2 radeonsi: remove nr_vertex_buffers
Unused.

Also inline util_set_vertex_buffers_count and simplify it.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
0ed0bf0696 radeonsi: move vertex buffer descriptors from IB to memory
This removes the intermediate storage (pm4 state) and generates descriptors
directly in a staging buffer.

It also reduces the number of flushes, because the descriptors no longer
take CS space.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
1635ded828 radeonsi: add support for fine-grained sampler view updates
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
bea8f2f46d radeonsi: move si_set_sampler_views to si_descriptors.c
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
dd46841bc9 radeonsi: move sampler descriptors from IB to memory
Sampler descriptors are now represented by si_descriptors.
This also adds support for fine-grained sampler state updates and
the border color update is now isolated in a separate function.

Border colors have been broken if texturing from multiple shader stages is
used. This patch doesn't change that.

BTW, blitting already makes use of fine-grained state updates.
u_blitter uses 2 textures at most, so we only have to save 2.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:59 +02:00
Marek Olšák
2a7b57ad42 radeonsi: implement ARB_draw_indirect
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
887b69a233 radeonsi: don't add info->start to the index buffer offset
info->start will be invalid once info->indirect isn't NULL, so it shouldn't
be added to ib.offset.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
09056b352d radeonsi: use an SGPR instead of VGT_INDX_OFFSET
The draw indirect packets cannot set VGT_INDX_OFFSET, they can only set user
data SGPRs. This is the only way to support start/index_bias with indirect
drawing.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
a66d934139 radeonsi: assume LLVM 3.4.2 is always present
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
4ad682461e configure.ac: require LLVM 3.4.2 for radeon
Needed by ARB_draw_indirect.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
3a86ca54df st/mesa,gallium: add a workaround for Unigine Heaven 4.0 and Valley 1.0
Most (all?) Unigine shaders fail to compile without this if sample shading
is advertised. This is, of course, Unigine developers' fault.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-18 01:58:58 +02:00
Marek Olšák
b0ff18bd34 glsl: add a mechanism to allow #extension directives in the middle of shaders
This is needed to make Unigine Heaven 4.0 and Unigine Valley 1.0 work
with sample shading.

Also, if this is disabled, the error message at least makes sense now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-18 01:58:58 +02:00
Glenn Kennard
392c9f8dfe r600g: Implement GL_ARB_texture_gather
Only supported on evergreen and later. Currently limited
to single component textures as the hardware GATHER4
instruction ignores texture swizzles.

Piglit quick run passes on radeon 6670 with all
applicable textureGather tests, no regressions.

Signed-off-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-07-18 01:58:58 +02:00
Anuj Phogat
984a02ba55 i965: Fix z_offset computation in intel_miptree_unmap_depthstencil()
The bug is triggered by using glTexSubImage2d() with GL_DEPTH_STENCIL
as base internal format and non-zero x, y offsets. Currently x, y
offsets are ignored while updating the texture image.

Fixes Khronos GLES3 CTS tests:
npot_tex_sub_image_2d
npot_tex_sub_image_3d
npot_pbo_tex_sub_image_2d
npot_pbo_tex_sub_image_2d

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-17 15:52:27 -07:00
Anuj Phogat
5d9f5cd35b Revert "i965: Extend compute-to-mrf pass to understand blocks of MOVs"
This reverts commit bbefb15e01.
Fixes the 11 regressions caused in framebuffer_blit tests in
Khronos GLES3 CTS tests:

Original patch reduced the instruction count but had no performance
benefits. So, it's safe to revert it without causing any performance
regressions.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-17 15:49:46 -07:00
Adel Gadllah
b656e3c603 i915: Fix up intelInitScreen2 for DRI3
Commit 442442026e updated both i915 and i965 for DRI3 support,
but one check in intelInitScreen2 was missed for i915 causing crashes
when trying to use i915 with DRI3.

So fix that up.

Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
References: https://bugzilla.redhat.com/show_bug.cgi?id=1115323
References: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754297
Tested-by: František Zatloukal <Zatloukal.Frantisek@gmail.com>
Tested-by: Dirk Griesbach <spamthis@freenet.de>
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-17 14:42:35 -07:00
Pavel Popov
4ceb612a10 mesa: Fix regression introduced by commit "mesa: fix packing of float texels to GL_SHORT/GL_BYTE".
This commit "mesa: fix packing of float texels to GL_SHORT/GL_BYTE" replaced *_TO_BYTE to *_TO_BYTE_TEX because *_TO_FLOAT_TEX are used to unpack the texels to floats.
In this case *_TO_FLOATZ in function extract_float_rgba also should be replaced to *_TO_FLOAT_TEX. Underline that these macros automatically preserve zero when converting.

The regression was observed on 3 oglconform tests:
    snorm-textures basic.getTexImage
    snorm-textures advanced.mipmap.manual.getTex
    snorm-textures advanced.mipmap.upload.getTex

Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-18 08:01:07 +12:00
Thorsten Glaser
3cfe6bc9cc nv50: fix build failure on m68k due to invalid struct alignment assumptions
Make alignment assumptions explicit by inserting correct padding with
unknown struct members.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-07-17 10:31:30 -04:00
Tom Stellard
74dfd86ed6 clover: Call end_query before getting timestamp result v2
v2:
  - Move the end_query() call into the timestamp constructor.
  - Still pass false as the wait parameter to get_query_result().

Reviewed-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-17 09:33:37 -04:00
Tapani Pälli
48deb4dbf2 glsl: handle a switch where default is in the middle of cases
This fixes following tests in es3conform:

   shaders.switch.default_not_last_dynamic_vertex
   shaders.switch.default_not_last_dynamic_fragment

and makes following tests in Piglit pass:

   glsl-1.30/execution/switch/fs-default-notlast-fallthrough
   glsl-1.30/execution/switch/fs-default_notlast

No Piglit regressions.

v2: take away unnecessary ir_if, just use conditional assignment
v3: use foreach_in_list instead of foreach_list

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v3)
2014-07-17 07:39:12 +03:00
Kenneth Graunke
9e47ed2f77 glsl: Make the tree rebalancer use vector_elements, not components().
components() includes matrix columns, so if this code encountered a
matrix, it would ask for something like a vec9 or vec16.  This is
clearly not what you want.

Earlier code now prevents this from seeing matrices, but we should still
use vector_elements, for clarity.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-16 15:43:13 -07:00
Kenneth Graunke
7db75927ca glsl: Guard against error_type in the tree rebalancer.
This helped me track down the bug fixed in the previous commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-16 15:43:13 -07:00
Kenneth Graunke
9697f8088f glsl: Make the tree rebalancer bail on matrix operands.
It doesn't handle things like (vector * matrix) correctly, and
apparently Matt's intention was to bail.

Fixes shader compilation in Natural Selection 2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-16 15:43:13 -07:00
Kenneth Graunke
99f8ea295f Revert "i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams."
This reverts commit 3178d2474a.

This caused GPU hangs on Ivybridge for some users and huge (80%)
performance regressions across the board on multiple platforms.

We need to find a better solution.  I've made several attempts, but none
of them have worked yet.  In the meantime, we should revert this.

Reverting it breaks GL_PRIMITIVES_GENERATED for non-zero streams, but
that's okay, since we don't expose GL_ARB_gpu_shader5 yet.

Fixes Piglit's EXT_transform_feedback/generatemipmap prims_generated
test case on Haswell.
2014-07-16 14:19:29 -07:00
Chia-I Wu
1661f7559b ilo: add some missing formats
Map more pipe formats to hardware formats.  Enable more VB formats on Haswell.
2014-07-16 14:31:59 +08:00
Chia-I Wu
69cd3ebd6f ilo: update and tailor the surface format table
Recreate the table from scratch with the help of a pdf-table-to-csv converter.
Switch to a form that is more suitable for ilo.
2014-07-16 14:31:59 +08:00
Kenneth Graunke
a2de656278 i965: Don't copy propagate abs into Broadwell logic instructions.
It's not clear what abs on logical instructions means on Broadwell, and
it doesn't appear to do anything sensible.

Fixes 270 Piglit tests (the bitand/bitor/bitxor tests with abs).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81157
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-15 22:12:15 -07:00
Kenneth Graunke
cf1b5eee7f i965/fs: Use WE_all for gl_SampleID header register munging.
This code should execute without regard to the currently executing
channels.  Asking for gl_SampleID inside control flow might break in
strange ways.  It appears to break even at the top of the program in
SIMD16 mode occasionally as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2014-07-15 22:10:10 -07:00
Kenneth Graunke
e5adc560cc i965/fs: Set force_uncompressed and force_sechalf on samplepos setup.
gen8_fs_generator uses these to decide whether to set the execution size
to 8 or 16, so we incorrectly made both of these MOVs the full width in
SIMD16 shaders.  (It happened to work out on Gen4-7.)

Setting them should also help inform optimization passes what's really
going on, which could help avoid bugs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2014-07-15 22:10:06 -07:00
Kenneth Graunke
2eaf3f670f i965: Set execution size to 8 for instructions with force_sechalf set.
Both inst->force_uncompressed and inst->force_sechalf mean that the
generated instruction should be uncompressed and have an execution size
of 8.  We don't require the visitor to set both flags - setting
inst->force_sechalf by itself is supposed to be enough.

On Gen4-7, guess_execution_size() demoted instructions to 8-wide based
on the default compression state.  On Gen8+, we instead set a default
execution size, which worked great...except that we forgot to check
inst->force_sechalf when deciding whether to use 8 or 16.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
2014-07-15 22:09:49 -07:00
Christoph Bumiller
4198711006 nvc0: fix translate path for PRIM_RESTART_WITH_DRAW_ARRAYS
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-15 17:57:45 -04:00
Christoph Bumiller
a284a0afa2 nvc0: add support for indirect drawing
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-15 17:57:45 -04:00
Ilia Mirkin
bbc4a7bd31 nouveau: check if a fence has already been signalled
nouveau_fence_update does real work unconditionally. Avoid doing that if
the fence we're checking on has already been signalled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-15 17:57:45 -04:00
Matt Turner
c11096c749 glsl: Don't declare variables in for-loop declaration.
Reported-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-15 12:17:48 -07:00
Connor Abbott
58270c2fac exec_list: Make various places use the new length() method.
Instead of hand-rolling it.

v2 [mattst88]: Rename get_size to length. Expand comment in ir_reader.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-07-15 11:16:16 -07:00
Connor Abbott
7b0f69225a exec_list: Add a function to give the length of a list.
v2 [mattst88]: Remove trailing whitespace. Rename get_size to length.
               Mark as const.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-07-15 11:16:16 -07:00
Connor Abbott
28c4fd4bc6 exec_list: Add a prepend function.
This complements the existing append function. It's implemented in a
rather simple way right now; it could be changed if performance is a
concern.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
2014-07-15 11:16:16 -07:00
Ian Romanick
9a723b970e mesa: Don't allow GL_TEXTURE_{LUMINANCE,INTENSITY}_* queries outside compat profile
There are no queries for GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE, GL_TEXTURE_LUMINANCE_TYPE, or
GL_TEXTURE_INTENSITY_TYPE in any version of OpenGL ES or desktop OpenGL
core profile.

NOTE: Without changes to piglit, this regresses
required-sized-texture-formats.

v2: Rebase on different initial change.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.2 <mesa-stable@lists.freedesktop.org>
2014-07-15 10:46:33 -07:00
Ian Romanick
750286600b mesa: Don't allow GL_TEXTURE_BORDER queries outside compat profile
There are no texture borders in any version of OpenGL ES or desktop
OpenGL core profile.

Fixes piglit's gl-3.2-texture-border-deprecated.

v2: Rebase on different initial change.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.2 <mesa-stable@lists.freedesktop.org>
2014-07-15 10:46:33 -07:00
Ian Romanick
ee58c71a65 mesa: Handle uninitialized textures like other textures in get_tex_level_parameter_image
Instead of catching the special case early, handle it by constructing a
fake gl_texture_image that will cause the values required by the OpenGL
4.0 spec to be returned.

Previously, calling

    glGenTextures(1, &t);
    glBindTexture(GL_TEXTURE_2D, t);
    glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, 0xDEADBEEF, &value);

would not generate an error.

Anuj: Can you verify this does not regress proxy_textures_invalid_size?

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Suggested-by: Brian Paul <brianp@vmware.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Cc: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-15 10:46:33 -07:00
Matt Turner
83214edf8a i965/fs: Relax interference check in register coalescing.
A similar attempt was made in commit 5ff1e446 and was reverted in commit
a39428cf after causing a regression in an ES 3 conformance test. The
test still passes after this commit.

total instructions in shared programs: 1994827 -> 1992858 (-0.10%)
instructions in affected programs:     128247 -> 126278 (-1.54%)
GAINED:                                0
LOST:                                  1

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-15 10:12:29 -07:00
Matt Turner
1d97212007 i965/fs: Perform CSE on sends-from-GRF rather than textures.
Should potentially allow a few more cases, while avoiding doing CSE on
texture operations on Gen <= 6 with the MRF.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80211
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: lu hua <huax.lu@intel.com>
2014-07-15 10:12:29 -07:00
Matt Turner
103716a862 glsl: Update expression types after rebalancing the tree.
If we saw a tree that looked like

            vec3
           /   \
         vec3 float
        /   \
      vec3 float
     /   \
   vec3 float

We would see that all of the expression types were vec3, and then
rebalance to

           vec3
        /        \
      vec3       vec3 <-- should be float
     /   \      /    \
   vec3 float float float

This patch adds code to visit the rebalanced tree and update the
expression types from the bottom up.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80880
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-15 10:12:29 -07:00
Matt Turner
7b962a4e6b glsl: Add callback_leave to ir_hierarchical_visitor. 2014-07-15 10:12:29 -07:00
Matt Turner
76caaedd7e i965: Initialize new chunks of realloc'd memory.
Otherwise we'd compare uninitialized pointers with NULL and dereference,
leading to crashes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-15 10:12:29 -07:00
Tom Stellard
0d711e719e radeon/llvm: Fix LLVM diagnostic error reporting
We were trying to print the error message after disposing the
message object.

Tested-by and Reviewed-by: Aaron Watry <awatry@gmail.com>
2014-07-15 11:55:26 -04:00
José Fonseca
20b431fd9e util/tgsi: Fix ureg_EMIT/ENDPRIM prototype.
0cbefc1bea added a source argument to
EMIT/ENDPRIM, but it did not update tgsi_ureg accordingly, causing all
users of ureg_EMIT/ENDPRIM to fail at runtime with an assertion failure.

Trivial.
2014-07-15 14:56:31 +01:00
Vinson Lee
e945a19b35 glapi: Use GetProcAddress instead of dlsym on Windows.
This patch fixes this MinGW build error.

glapi_gentable.c: In function '_glapi_create_table_from_handle':
glapi_gentable.c:123:9: error: implicit declaration of function 'dlsym' [-Werror=implicit-function-declaration]
         *procp = dlsym(handle, symboln);
         ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Brian Paul <brianp@vmware.com>
2014-07-14 22:21:10 -07:00
Chia-I Wu
c25fe88ebf ilo: raise texture size limits
Report the hardware limits now that max-texture-size piglit test has been
fixed.
2014-07-15 12:00:15 +08:00
Chia-I Wu
81d7f33e30 ilo: move away from drm_intel_bo_alloc_tiled
We want to know the exact sizes of the BOs, and the driver has the knowledge
to do so.  Refactoring of the resource allocation code is needed though.
2014-07-15 12:00:10 +08:00
Marek Olšák
d859bdb4b5 radeonsi: partially revert "switch descriptors to i32 vectors"
It indeed breaks LLVM 3.4.2.
2014-07-14 21:40:19 +02:00
Matt Turner
130c99ca15 i965/vec4: Invalidate live intervals in opt_cse, not _local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Matt Turner
aba15d93a6 i965/vec4: Move aeb list into opt_cse_local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Matt Turner
1ca6b5d2e8 i965/fs: Invalidate live intervals in opt_cse, not _local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Matt Turner
bdbaa9ab5b i965/fs: Move aeb list into opt_cse_local.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-14 11:27:52 -07:00
Cody Northrop
0f679f0ab5 glsl: Fix aggregates with dynamic initializers.
Vectors are falling in to the ir_dereference_array() path.

Without this change, the following glsl aborts the debug driver,
or gets the wrong answer in release:

mat2x2 a = mat2( vec2( 1.0, vertex.x ), vec2( 0.0, 1.0 ) );

Also submitting piglit tests, will reference in bug.

v2: Rebase on Mesa master.

v3: Remove unneeded check for arrays, which are covered by
    process_array_constructor(), recommended by Timothy Arceri.

Signed-off-by: Cody Northrop <cody@lunarg.com>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79373
2014-07-14 08:36:36 -07:00
Jon TURNEY
923f78440c Avoid mesa_dri_drivers import lib being installed
On Cygwin and MinGW, linking a shared library also generates an import library

Use a wildcard which also matches the name of the megadriver import lib,
mesa_dri_drivers.dll.a, so that is also removed after megadriver symlinks are
created

(This then matches src/gallium/targets/dri/Makefile.am, which already does
things this way)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-13 16:06:46 +01:00
Chris Forbes
5899a45a5b i965/vec4: Silence warnings about unhandled interpolation ops
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-13 11:13:23 +12:00
Chris Forbes
1e4068ca45 docs: Mark off ARB_gpu_shader5 interpolation functions for i965
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-13 10:04:25 +12:00
Chris Forbes
9c0bddf735 i965/fs: add support for ir_*_interpolate_at_* expressions
SIMD8-only for now.

V5: - Fix style complaints
    - Move prototype to be with other oddball emit functions
    - Use unreachable() instead of assert() where possible

V6: - Describe what is happening with the clamping
    - Add reg_width to make some expressions clearer

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:24 +12:00
Chris Forbes
5ed147c26f i965/fs: Skip channel expressions splitting for interpolation
The backend will have to do a message send, so we want to keep these in
one piece, just like texture ops.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:22 +12:00
Chris Forbes
6e91f2df95 i965/fs: add generator support for pixel interpolator query
V5: - Split into separate opcodes
    - Pass message data in src1 immediate
    - Put noperspective bit in fs_inst rather than adding any junk to
      backend_instruction

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:18 +12:00
Chris Forbes
d732598b63 i965: add low-level support for send to pixel interpolator
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:17 +12:00
Chris Forbes
0b0572a2ad i965/disasm: add support for pixel interpolator messages
V3: Rework for brw_inst changes

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:16 +12:00
Chris Forbes
1b6163bdf5 i965: Add message descriptor bit definitions for pixel interpolator
These got lost in the big brw_inst shakeup.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-13 10:01:13 +12:00
Chris Forbes
f55e9a7c75 i965/disasm: Disassemble indirect sends more properly
- Don't try to disassemble send's src1 as a descriptor if it's not an
  immediate.

- In the same case, show src1 as an operand (makes it easier to see
  bogus register regions, etc -- the hardware is very fussy)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-12 11:29:17 +12:00
Chris Forbes
1854ead64c i965: Avoid crashing while dumping vec4 insn operands
We'd otherwise go looking into virtual_grf_sizes for things that aren't
in there at all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-12 11:29:17 +12:00
Chris Forbes
1499619fe6 i965: Fix two broken asserts in brw_eu_emit
These were looking in the wrong field.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-12 11:29:09 +12:00
Chris Forbes
b45d417108 glsl: add new interpolateAt* builtin functions
V2: - Don't assume everyone wants interpolateAtSample() lowered to
      interpolateAtOffset. It turns out this isn't what we want most
      of the time for i965. Lowering can be added later in an ir pass
      which drivers opt into, rather than bolting it straight into the
      builtin definition.
    - Only expose the interpolateAt* builtins in the fragment language.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-12 11:20:02 +12:00
Chris Forbes
1d5b06664f glsl: add new expression types for interpolateAt*
Will be used to implement interpolateAt*() from ARB_gpu_shader5

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-12 11:20:00 +12:00
Chris Forbes
8b7a323596 allow builtin functions to require parameters to be shader inputs
The new interpolateAt* builtins have strange restrictions on the
<interpolant> parameter.

- It must be a shader input, or an element of a shader input array.
- It must not include a swizzle.

V2: Don't abuse ir_var_mode_shader_in for this; make a new flag.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-12 11:19:50 +12:00
Marek Olšák
ee2a818d33 radeonsi: rename definitions of shader limits
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-11 19:36:29 +02:00
Marek Olšák
4f3f0435bf radeonsi: switch descriptors to i32 vectors
This is a follow-up to the commit which adds texture fetches with offsets.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-11 19:36:29 +02:00
Marek Olšák
877bb52dc9 radeonsi: properly implement texture opcodes that take an offset
Instead of using intr_name in lp_build_tgsi_action, this selects the names
with a switch statement in the emit function. This allows emitting
llvm.SI.sample for instructions without offsets and llvm.SI.image.sample.*.o
otherwise.

This depends on my LLVM changes.

When LLVM 3.5 is released, I'll switch all texture instructions to the new
intrinsics.
2014-07-11 19:36:29 +02:00
Marek Olšák
04aa2bd724 radeonsi: fix texture fetches with derivatives for 1DArray and 3D textures 2014-07-11 19:36:29 +02:00
Marek Olšák
b279f0143f radeonsi: fix samplerCubeShadow with bias
Pack the depth value before overwriting it with cube coordinates.

Cc: mesa-stable@lists.freedesktop.org
2014-07-11 19:36:29 +02:00
Marek Olšák
a11fff329e st/mesa: fix samplerCubeShadow with bias
It has 5 coordinates: (x,y,z,depth,lodbias)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-11 19:36:29 +02:00
Marek Olšák
734e4946f5 mesa: fix crash in st/mesa after deleting a VAO
This happens when glGetMultisamplefv (or any other non-draw function) is
called, which doesn't invoke the VBO module to update _DrawArrays and
the pointer is invalid at that point.

However st/mesa still dereferences it to setup vertex buffers ==> crash.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-11 19:36:29 +02:00
Jon TURNEY
f381c27c54 configure: Cygwin requires _XOPEN_SOURCE >= 700 to prototype strndup()
Adjust definition of _XOPEN_SOURCE appropriately for use of strndup() added with
commit da3a47d6

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-07-11 15:26:02 +01:00
Brian Paul
da46b9de9f gallium/docs: minor clarification for TXQ instruction
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-10 11:30:04 -06:00
Brian Paul
c45b9b5721 softpipe: fix sp_get_dims() for PIPE_BUFFER
Before, we were checking the level against view->u.tex.last_level but
level is not valid for buffers.  Plus, the aliasing of the view->u.tex
view->u.buf members (a union) caused the level checking arithmetic to
be totally wrong.  The net effect is we always returned early for
PIPE_BUFFER size queries.

This fixes the piglit "textureSize 140 fs samplerBuffer" test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-10 10:59:40 -06:00
Brian Paul
faa6b0cdc3 glsl/glcpp: move macro declaration before code to fix MSVC build
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-07-10 08:08:10 -06:00
Ilia Mirkin
acaed8f41d nvc0/ir: add support for interpolating with non-default settings
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 22:32:13 -04:00
Ilia Mirkin
7c9161521a gallium: add INTERP_* opcodes to support interpolateAt*
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-09 22:32:13 -04:00
Ilia Mirkin
ca5e15f40f r600g: remove unused base_vector_chan variable
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-09 22:32:13 -04:00
Ilia Mirkin
b8db6db8b0 i965: forward-declare struct brw_context in brw_reg.h
Commit 54e91e7420 introduced a function declaration that uses
brw_context. While brw_context tends to get included in most files, it
is not when compiling intel_asm_annotation.c resulting in the following
warning:

In file included from brw_shader.h:25:0,
                 from brw_cfg.h:32,
                 from intel_asm_annotation.c:24:
brw_reg.h:122:39: warning: 'struct brw_context' declared inside
parameter list [enabled by default]
brw_reg.h:122:39: warning: its scope is only this definition or
declaration, which is probably not what you want [enabled by default]

Add a forward-declaration for struct brw_context to avoid the issue.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 22:31:51 -04:00
Ilia Mirkin
a432079400 nvc0/ir: fix encoding of offset register into interpolation instruction
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 21:10:24 -04:00
Ilia Mirkin
7f937875c0 nvc0/ir: account for indirect textures on fermi for txd
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 21:10:24 -04:00
Ilia Mirkin
9807a8ddaf nvc0/ir: unset s/r indirect sources before moving everything
With the current logic, it's very likely that s/r indirect sources are
right after the "regular" ones. Unset them before moving the texture
arguments over rather than after, as one of those arguments would
likely have assumed one of the s/r positions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 21:10:24 -04:00
Emil Velikov
0bdc3e1afd targets/dri-swrast: Convert to static/shared pipe-driver
Convert the final dri target to the single DRI (megadriver) library.
Cleanup all the automake leftovers from the conversion stage and
update the scons build.

v2: Link in llvmpipe, when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:49 +01:00
Emil Velikov
29ca7d2c94 st/dri: merge dri/drm and dri/sw backends
Move the driver_name to dri2/drisw and remove all the SPLIT_TAGETS
mayhem. In the next step we'll unify the dri and dri-swrast targets,
completing the gallium DRI megadriver.

v2: Remove leftover st/dri Makefiles from CONFIG_FILES. Spotted by
Thomas Helland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:49 +01:00
Emil Velikov
f6483aa694 targets/dri-swrast: convert to gallium megadrivers :)
Export the approapriate new symbol, and keep backwards compat
via the megadriver_stub helper library.

Our next step would be to unify dri/drm and dri/sw, leading to
a complete megadrivers solution, and having a single library
that provides dri across all targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
dab5d16f0e scons: build and use a single dri_common library
Rather than building two identical ones for dri-vmwgfx and dri-swrast
build a single library, and drop some duplication in the build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
0e357234f3 st/dri/drm: remove __driDriverExtensions and driDriverAPI
... and use libmegadriver_stub as their provider.
Teach scons how to build the library archive and use it.

v2: scons: fix build on a drm-less system.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
3b7c120be3 targets/dri: cleanup conversion leftovers
With all the users converted to __driGetExtensions_* we can
have only a single inclusion of the required header + define.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
f6898aa264 targets/dri: update scons build to handle __driDriverGetExtensions_vmwgfx
Cc: Jose Fonseca <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
5c68a1dc0b targets/dri: Add __driDriverGetExtensions_vmwgfx
Identical to previous commits - will bring us a step closer
to megadrivers.

Cc: Jose Fonseca <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
ff0e25f3a6 targets/dri: Add __driDriverGetExtensions_i965 symbol
Identical to previous commits - will bring us a step closer
to megadrivers.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
3591acacf9 targets/dri: Add __driDriverGetExtensions_i915 symbol
Identical to previous commits - will bring us a step closer
to megadrivers.

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:48 +01:00
Emil Velikov
f48b06f89d targets/dri: Add __driDriverGetExtensions_freedreno symbol
Identical to previous two commits - will bring us a step closer
to megadrivers.

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:47 +01:00
Emil Velikov
4cd1bb6a91 targets/dri: Add __driDriverGetExtensions_(r300|r600|radeonsi) symbols
The symbol is introduced by the mesa megadrivers, and
adding gallium support for it will allow us to merge
st/dri/drm and st/dri/sw. Resulting in a single dri library
across all of gallium.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:47 +01:00
Emil Velikov
5b7e43aea8 targets/dri: Add __driDriverGetExtensions_nouveau symbol
The symbol is introduced by the mesa megadrivers, and adding
gallium support for it will allow us to merge st/dri/drm and
st/dri/sw. Resulting in a single dri library across gallium.

v2: Rebase on top of gallium dri3.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:47 +01:00
Ilia Mirkin
532eb72be3 tgsi: add interpolation location modifier support to text parser
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-09 19:26:32 -04:00
Ilia Mirkin
6b92a06ea3 mesa/st: add per sample shading state to fp key and set interpolation
This enables a gallium driver not to care about the semantics of
ARB_sample_shading vs ARB_gpu_shader5 sample attributes. When
ARB_sample_shading-style sample shading is enabled, all of the fp inputs
are marked for interpolation at the sample location.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 19:26:32 -04:00
Ilia Mirkin
4c97ed4411 gallium: switch dedicated centroid field to interpolation location
The new location field can be either center, centroid, or sample, which
indicates the location that the shader should interpolate at.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-09 19:26:32 -04:00
Kenneth Graunke
e3b16294cb meta: Call glObjectLabel before linking.
i965 precompiles shaders at link time, and prints a disassembly if
INTEL_DEBUG=vs,gs,fs, including the shader name.  However, blit shaders
were showing up as "unnamed" since we hadn't set a name prior to
linking.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-09 16:04:52 -07:00
Kenneth Graunke
272e36e229 ff_fragment_shader: Access glsl_types directly.
Originally, we didn't have direct accessors for all of the GLSL types,
so the only way to get at them was to use the symbol table.  Now, we
can just get at them directly, which is simpler and faster.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-07-09 15:48:24 -07:00
Brian Paul
c03c6e0168 st/mesa: add PIPE_FORMAT_R10G10B10A2_UNORM to format_map table
as a candidate for the GL_RGB10_A2 internal texture format.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 15:06:46 -06:00
Brian Paul
282b783a15 st/mesa: add some missing MESA/PIPE_FORMAT_R10G10B10A2_UNORM switch cases
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 15:06:46 -06:00
Carl Worth
0e12cd7954 glsl/glcpp: Don't choke on an empty pragma
The lexer was insisting that there be at least one character after "#pragma"
and before the end of the line. This caused an error for a line consisting
only of "#pragma" which volates at least the following sentence from the GLSL
ES Specification 3.00.4:

	The scope as well as the effect of the optimize and debug pragmas is
	implementation-dependent except that their use must not generate an
	error. [Page 12 (Page 28 of PDF)]

and likely the following sentence from that specification and also in
GLSLangSpec 4.30.6:

	If an implementation does not recognize the tokens following #pragma,
	then it will ignore that pragma.

Add a "make check" test to ensure no future regressions.

This change fixes at least part of the following Khronos GLES3 CTS test:

	preprocessor.pragmas.pragma_vertex

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:14 -07:00
Carl Worth
43047384c3 glsl/glcpp: Promote "extra token at end of directive" from warning to error
We've always warned about this case, but a recent confromance test expects
this to be an error that causes compilation to fail. Make it so.

Also add a "make check" test to ensure these errors are generated.

This fixes the following Khronos GLES3 conformance tests:

	invalid_conditionals.tokens_after_ifdef_vertex
	invalid_conditionals.tokens_after_ifdef_fragment
	invalid_conditionals.tokens_after_ifndef_vertex
	invalid_conditionals.tokens_after_ifndef_fragment

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:14 -07:00
Carl Worth
dac3c986c5 glsl/glcpp: Once again report undefined macro name in error message.
While writing the previous commit message, I just felt bad documenting the
shortcoming of the change, (that undefined macro names would not be reported
in error messages).

Fix this by preserving the first-encounterd undefined macro name and reporting
that in any resulting error message.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:13 -07:00
Carl Worth
ec6222ef01 glsl/glcpp: Add short-circuiting for || and && in #if/#elif for OpenGL ES.
The GLSL ES Specification 3.00.4 says:

	#if, #ifdef, #ifndef, #else, #elif, and #endif are defined to operate
        as for C++ except for the following:
	...
	• Undefined identifiers not consumed by the defined operator do not
	  default to '0'. Use of such identifiers causes an error.

	[Page 11 (page 127 of the PDF file)]

as well as:

	The semantics of applying operators in the preprocessor match those
	standard in the C++ preprocessor with the following exceptions:

	• The 2nd operand in a logical and ('&&') operation is evaluated if
	  and only if the 1st operand evaluates to non-zero.

	• The 2nd operand in a logical or ('||') operation is evaluated if
	  and only if the 1st operand evaluates to zero.

	If an operand is not evaluated, the presence of undefined identifiers
	in the operand will not cause an error.

(Note that neither of these deviations from C++ preprocessor behavior apply to
non-ES GLSL, at least as of specfication version 4.30.6).

The first portion of this, (generating an error for an undefined macro in an
(short-circuiting to squelch errors), was not implemented previously, but is
implemented in this commit.

A test is added for "make check" to ensure this behavior.

Note: The change as implemented does make the error message a bit less
precise, (it just states that an undefined macro was encountered, but not the
name of the macro).

This commit fixes the following Khronos GLES3 conformance test:

	undefined_identifiers.valid_undefined_identifier_1_vertex
	undefined_identifiers.valid_undefined_identifier_1_fragment
	undefined_identifiers.valid_undefined_identifier_2_vertex
	undefined_identifiers.valid_undefined_identifier_2_fragment

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-09 12:05:13 -07:00
Carl Worth
9794f8f245 glsl/glcpp: Fix glcpp to properly lex entire "preprocessing numbers"
The preprocessor defines a notions of a "preprocessing number" that
starts with either a digit or a decimal point, and continues with zero
or more of digits, decimal points, identifier characters, or the sign
symbols, ('-' and '+').

Prior to this change, preprocessing numbers were lexed as some
combination of OTHER and IDENTIFIER tokens. This had the problem of
causing undesired macro expansion in some cases.

We add tests to ensure that the undesired macro expansion does not
happen in cases such as:

	#define e +1
	#define xyz -2

	int n = 1e;
	int p = 1xyz;

In either case these macro definitions have no effect after this
change, so that the numeric literals, (whether valid or not), will be
passed on as-is from the preprocessor to the compiler proper.

This fixes the following Khronos GLES3 CTS tests:

	preprocessor.basic.correct_phases_vertex
	preprocessor.basic.correct_phases_fragment

v2. Thanks to Anuj Phogat for improving the original regular expression,
(which accepted a '+' or '-', where these are only allowed after one of
[eEpP]. I also expanded the test to exercise this.

v3. Also fixed regular expression to require at least one digit at the
beginning (after an optional period). Otherwise, a string such as ".xyz" was
getting sucked up as a preprocessing number, (where obviously this should be a
field access). Again, I expanded the test to exercise this.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Carl Worth
98c0e3c783 glsl/glcpp: Fix glcpp to catch garbage after #if 1 ... #else
Previously, a line such as:

	#else garbage

would flag an error if it followed "#if 0", but not if it followed "#if 1".

We fix this by setting a new bit of state (lexing_else) that allows the lexer
to defer switching to the <SKIP> start state until after the NEWLINE following
the #else directive.

A new test case is added for:

	#if 1
	#else garbage
	#endif

which was untested before, (and did not generate the desired error).

This fixes the following Khronos GLES3 CTS tests:

	tokens_after_else_vertex
        tokens_after_else_fragment

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Carl Worth
1d862a0b39 glsl/glcpp: Fixup glcpp tests for redefining a macro with whitespace changes.
Previously, the test suite was expecting the compiler to allow a redefintion
of a macro with whitespace added, but gcc is more strict and allows only for
changes in the amounts of whitespace, (but insists that whitespace exist or
not in exactly the same places).

See: https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html:

 These definitions are effectively the same:

      #define FOUR (2 + 2)
      #define FOUR         (2    +    2)
      #define FOUR (2 /* two */ + 2)

 but these are not:

      #define FOUR (2 + 2)
      #define FOUR ( 2+2 )
      #define FOUR (2 * 2)
      #define FOUR(score,and,seven,years,ago) (2 + 2)

This change adjusts the existing "redefine-macro-legitimate" test to work with
the more strict understanding, and adds a new "redefine-whitespace" test to
verify that changes in the position of whitespace are flagged as errors.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Anuj Phogat
a6e9cd14ca glsl/glcpp: Fix preprocessor error condition for macro redefinition
This patch specifically fixes redefinition condition for white space
changes. #define and #undef functionality in GLSL follows the standard
for C++ preprocessors for macro definitions.

From https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html:

These definitions are effectively the same:

     #define FOUR (2 + 2)
     #define FOUR         (2    +    2)
     #define FOUR (2 /* two */ + 2)

but these are not:

     #define FOUR (2 + 2)
     #define FOUR ( 2+2 )
     #define FOUR (2 * 2)
     #define FOUR(score,and,seven,years,ago) (2 + 2)

Fixes Khronos GLES3 CTS tests;
invalid_object_whitespace_vertex
invalid_object_whitespace_fragment

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-07-09 12:05:13 -07:00
Carl Worth
1a46dd6edd glsl/glcpp: Add test to ensure compiler won't allow #undef for some builtins
Currently verifying that an #undef of __FILE__, __LINE__, or __VERSION__ will
generate an error.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-07-09 12:05:13 -07:00
Anuj Phogat
64b7fc2dd1 glsl/glcpp: Do not allow undefining the built-in macros
Fixes piglit tests in spec/glsl-es-3.00/compile:
undef-__FILE__.vert
undef-GL_ES.vert
undef-__LINE__.vert
undef-__VERSION__.vert

Also, fixes Khronos GLES3 CTS tests:
undefine_invalid_object_1_vertex
undefine_invalid_object_1_fragment
undefine_invalid_object_2_vertex
undefine_invalid_object_2_fragment

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-07-09 12:05:13 -07:00
Brian Paul
378fa34c7b gallium/u_blitter: fix some shader memory leaks
The _msaa shaders weren't getting freed.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 12:15:35 -06:00
Ilia Mirkin
e924bb32f4 tgsi: properly parse indirect dimension references (e.g. for UBOs)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-09 12:40:07 -04:00
Christian König
c8011c1885 radeonsi: fix order of r600_need_dma_space and r600_context_bo_reloc
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 15:08:22 +02:00
Brian Paul
d10204930f st/mesa: fix geometry shader memory leak
Spotted by Charmaine Lee.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-07-09 06:43:26 -06:00
Brian Paul
176b64b811 mesa: fix geometry shader memory leaks
Spotted by Charmaine Lee.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-09 06:43:26 -06:00
Brian Paul
971122a9c0 st/mesa: minor simplification of some state atom assignments 2014-07-09 06:43:25 -06:00
Brian Paul
301ffe7b26 st/mesa: minor fix-up in st_GetSamplePosition()
If the driver doesn't implement get_sample_position(), let's return
some non-garbage values.
2014-07-09 06:43:25 -06:00
Brian Paul
91affc8b32 mesa: use float to silence MSVC warning in _mesa_GetMultisamplefv() 2014-07-09 06:43:25 -06:00
Samuel Pitoiset
50bbe49c33 nvc0: allocate more space before a counter is configured
On nvc0, a counter can have up to 6 sources instead of only one
for nve4+. This fixes a crash when a counter uses more than
one source.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-08 19:41:00 -04:00
Tobias Klausmann
a9b21015f5 nv50/ir: use unordered_set instead of list to keep track of var uses
The set of variable uses does not need to be ordered in any way, and
removing/adding elements is a fairly common operation in various
optimization passes.

This shortens runtime of piglit test fp-long-alu to ~22s from ~4h

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-08 19:41:00 -04:00
Kenneth Graunke
503391b46f i965/disasm: Fix disassembly of the any16h/all16h predicates.
BRW_PREDICATE_ALIGN1_ANY16H was incorrectly being disassembled as
"all16h", and ALL16H would probably print as "(null)".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-08 12:31:01 -07:00
Kenneth Graunke
e13a6406c3 glsl: Fix the foreach_in_list_reverse macro.
We clearly don't want to start at the head and walk backwards; we want
to start at the last real element before the tail sentinel.  If the list
is empty, tail_pred will be the head sentinel, and we'll stop.

Nothing uses this function, so I guess nobody noticed it was broken.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-07-08 12:31:01 -07:00
Marek Olšák
be536efe20 radeonsi: mark MSAA config state as dirty at the beginning of CS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81020

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-08 20:46:23 +02:00
Marek Olšák
fe6be9926f gallium: fix u_default_transfer_inline_write for textures
This doesn't fix any known issue. In fact, radeon drivers ignore all
the discard flags for textures and implicitly do "discard range"
for any write transfer.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-08 20:46:23 +02:00
Matt Turner
cf430408c4 i965: Remove artificial dependency between math instructions.
... on Gen6+. I'm not actually sure which class Gen6 fits into.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-08 11:12:02 -07:00
Matt Turner
099cbc1477 i965/fs: Track dependencies in instruction scheduling per reg offset.
Previously instruction scheduling tracked dependencies on a per-register
basis. This meant that there was an artificial dependency between
interpolation instructions writing into the same virtual register.

Instruction scheduling would insert a number of instructions between the
two instructions in this example, when they are actually independent.

   linterp vgrf8+0.0:F, hw_reg2:F, hw_reg3:F, hw_reg6:F
   linterp vgrf8+1.0:F, hw_reg2:F, hw_reg3:F, hw_reg6+16:F

This lead to cases where the first texture coordinate is interpolated at
the beginning of the shader, but the second is done immediately before
the texture operation that uses it as a source.

After this change, the artificial dependency is removed and the
interpolation instructions are scheduled together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-08 11:12:02 -07:00
Jon TURNEY
7a641dd58d configure: Don't special case Cygwin to use gnu99, define _XOPEN_SOURCE instead
Revert "build: Build on Cygwin with gnu99 instead of c99." and define
_XOPEN_SOURCE appropriately.

This reverts commit 53e36d333c.

Since Cygwin 1.7.18 (April 2013), it's headers correctly prototype strtoll()
when using -std=c99, and correctly prototype strdup() when _XOPEN_SOURCE is
defined appropriately, so this workaround is no longer needed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-07-08 14:25:21 +01:00
Chia-I Wu
8ff16111ee ilo: fix fence reference counting
The old code was complicated, and was wrong when *ptr is NULL.
2014-07-08 15:00:36 +08:00
Kristian Høgsberg
bbefb15e01 i965: Extend compute-to-mrf pass to understand blocks of MOVs
The current compute-to-mrf pass doesn't handle blocks of MOVs.  Shaders
that end with a texture fetch follwed by an fb write are left like this:

0x00000000: pln(8)          g6<1>F          g4<0,1,0>F      g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000008: pln(8)          g7<1>F          g4.4<0,1,0>F    g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000010: send(8)         g2<1>UW         g6<8,8,1>F
                            sampler (1, 0, 0, 1) mlen 2 rlen 4              { align1 WE_normal 1Q };
0x00000020: mov(8)          g113<1>F        g2<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000028: mov(8)          g114<1>F        g3<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000030: mov(8)          g115<1>F        g4<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000038: mov(8)          g116<1>F        g5<8,8,1>F                      { align1 WE_normal 1Q compacted };
0x00000040: sendc(8)        null            g113<8,8,1>F
                            render ( RT write, 0, 4, 12) mlen 4 rlen 0      { align1 WE_normal 1Q EOT };

This patch lets compute-to-mrf recognize blocks of MOVs and match them to
instructions (typically SEND) that writes multiple registers.  With this,
the above shader becomes:

0x00000000: pln(8)          g6<1>F          g4<0,1,0>F      g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000008: pln(8)          g7<1>F          g4.4<0,1,0>F    g2<8,8,1>F      { align1 WE_normal 1Q compacted };
0x00000010: send(8)         g113<1>UW       g6<8,8,1>F
                            sampler (1, 0, 0, 1) mlen 2 rlen 4              { align1 WE_normal 1Q };
0x00000020: sendc(8)        null            g113<8,8,1>F
                            render ( RT write, 0, 20, 12) mlen 4 rlen 0     { align1 WE_normal 1Q EOT };

which is the bulk of the shader db results:

total instructions in shared programs: 987040 -> 986720 (-0.03%)
instructions in affected programs:     844 -> 524 (-37.91%)
GAINED:                                0
LOST:                                  0

The optimization also applies to MRT shaders that write the same
color value to multiple RTs, in which case we can eliminate four MOVs in
a similar fashion.  See fbo-drawbuffers2-blend in piglit for an example.

No measurable performance impact.  No piglit regressions.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-07-07 23:39:40 -07:00
Ilia Mirkin
8aa34dc9cb nvc0/ir: fill offset in properly for TXD
Apparently TXD wants its offset differently than TEX, accepting it in
the upper bits of the layer index. Unclear what happens when this is
combined with indirect sampler indexing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
114d46829d nvc0/ir: use manual TXD when offsets are involved
Something about how we're implementing offsets for TXD is wrong, just
flip to the generic quadop-based implementation in that case.

This is the minimal fix appropriate for backporting.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
afea9bae67 nvc0/ir: do quadops on the right texture coordinates for TXD
handleTEX moves the layer as the first argument. This makes sure that
the quadops deal with the texture coordinates.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
1065aa92f4 nv50/ir: ignore bias for samplerCubeShadow on nv50
Unfortunately there's no good way to do this on the nv50 shader isa.
Dropping the bias seems preferable to doing the compare post-filtering.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-07-08 00:14:33 -04:00
Ilia Mirkin
30d91e0eec nv50/ir: retrieve shadow compare from first arg
This can only happen with texture(samplerCubeShadow, bias), where the
compare will be in the first argument.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: <mesa-stable@lists.freedesktop.org>
2014-07-08 00:14:33 -04:00
Carl Worth
9007c4f9f4 docs: Import 10.2.3 release notes
And add a news item.
2014-07-07 16:28:37 -07:00
Matt Turner
f6db414f3c i965/fs: Disable unlit_centroid_workaround on Haswell.
Although the HSW PRM shows it, the BSpec lists this workaround as being
for Ivybridge only.

total instructions in shared programs: 1994951 -> 1993675 (-0.06%)
instructions in affected programs:     27325 -> 26049 (-4.67%)
2014-07-06 18:19:17 -07:00
Matt Turner
6f7c4a8d05 i965/vec4: Perform CSE on CMP(N) instructions.
Port of commit b16b3c87 to the vec4 code.

No shader-db improvements, but might as well. The fs backend saw an
improvement because it's scalar and multiple identical CMP instructions
were generated by the SEL peepholes.
2014-07-06 18:19:15 -07:00
Matt Turner
7921bf0062 i965/vec4: Don't emit null MOVs in CSE.
Port of commit 219b43c6 to the vec4 code.
2014-07-06 18:18:52 -07:00
Matt Turner
949991cc99 i965/vec4: Improve CSE performance by expiring some available expressions.
Port of commit 5daf867f to the vec4 code.
2014-07-06 18:18:52 -07:00
Kenneth Graunke
3c8dc48ad1 i965/vec4: Add basic common subexpression elimination.
[mattst88]: Modified to perform CSE on instructions with
            the same writemask. Offered no improvement before.

total instructions in shared programs: 1995633 -> 1995185 (-0.02%)
instructions in affected programs:     14410 -> 13962 (-3.11%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-06 18:18:51 -07:00
Matt Turner
848fc7f710 i965: Fix warnings introduced in commit e24ef5ab.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-06 18:15:36 -07:00
Christian König
042b061fef gallium/radeon: use PRIX64 instead of PRIu64
We want hex values here, not decimals.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-06 13:28:04 +02:00
Matt Turner
1580865a8c i965: Move assembly annotation functions to intel_asm_annotation.c.
It's C. Compile it as such.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
423932791d i965: Rename intel_asm_printer -> intel_asm_annotation.
The #ifndef include guards already said the right thing :)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
6d3e24a5c2 i965: Make backend_instruction usable from C.
With a hack to place an exec_node in the struct in C to be at the same
location as the inherited exec_node in C++.

Acked-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
0db30fcf89 i965/cfg: Make cfg_t usable from C.
Acked-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
857c06236c i965: Repack backend_instruction struct.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
ce706b4a9b i965: Make a brw_predicate enum.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
46e5b2a497 i965: Make a brw_conditional_mod enum.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
ab74a42eef i965: Move common fields into backend_instruction.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
3de11cacf0 i965: Use enum brw_reg_type for register types.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
34ef6a7651 i965: Move is_zero/one/null/accumulator into backend_reg.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
c019105f37 i965: Make a common backend_reg class.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:30 -07:00
Matt Turner
9377b189f7 i965: Drop imm union from visitor register classes.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:29 -07:00
Matt Turner
53992a102f i965: Use immediate storage in brw_reg for visitor regs.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-07-05 22:42:29 -07:00
Andreas Boll
45446efc30 docs: add news item for mesa-demos 8.2.0 release 2014-07-05 11:32:54 +02:00
Chris Forbes
4087d9ec0b glsl: Fix merging of layout(invocations) with other qualifiers
If another layout qualifier appeared to the left of `invocations` in the
GS input layout declaration, the invocation count would be dropped on
the floor.

Fixes the piglit tests:

spec/ARB_transform_feedback3/arb_transform_feedback3-ext_interleaved_two_bufs_gs_max
spec/ARB_gpu_shader5/arb_gpu_shader5-invocation-id
spec/ARB_gpu_shader5/compiler/correct-multiple-layout-qualifier-invocations.geom
spec/ARB_gpu_shader5/execution/invocations-conflicting

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-05 09:42:17 +12:00
Ilia Mirkin
9a37eb8adb nvc0: add a memory barrier when there are persistent UBOs
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-03 20:08:41 -04:00
Ilia Mirkin
5d4f5218bb nv50: do an explicit flush on draw when there are persistent buffers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-03 20:01:07 -04:00
Ilia Mirkin
b2b7c65122 nv50: disable dedicated ubo upload method
The hardware allows multiple simultaneous renders with the same
memory-backed constbufs but with each invocation having different
values. However in order for that to work, the data has to be streamed
in via the right constbuf slot. We weren't doing that for UBOs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.1" <mesa-stable@lists.freedesktop.org>
2014-07-03 20:01:06 -04:00
Ilia Mirkin
32b71246e7 gallium: rename PIPE_CAP_TGSI_VS_LAYER to also have _VIEWPORT
Now that this cap is used to determine the availability of both, adjust
its name to reflect the new reality.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-07-03 19:39:25 -04:00
Ilia Mirkin
0fb6f1bf1d mesa/st: enable AMD_vertex_shader_viewport_index
The assumption is that any driver capable of emitting layer from the
vertex shader and supporting viewports should be able to also handle
emitting viewport index from the vertex shader.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-03 19:39:25 -04:00
Ilia Mirkin
313acb3ffa r600g: allow vs to write to gl_ViewportIndex
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-03 19:39:25 -04:00
Thomas Hellstrom
556a415033 svga: Don't unnecessarily reemit BindGBShader commands v2
The Linux winsys can no longer relocate shader code, so avoid
reemitting BindGBShader commands. They are costly.

v2: Correctly handle errors from SVGA3D_BindGBShader()

Reported-by: Michael Banack <banackm@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-07-03 22:26:00 +02:00
Aaron Watry
824197efd5 radeon/llvm: Allocate space for kernel metadata operands
Previously, we were assuming that kernel metadata nodes only had 1 operand.

Kernels which have attributes can have more than 1, e.g.:
!0 = metadata !{void (i32 addrspace(1)*)* @testKernel, metadata !1}
!1 = metadata !{metadata !"work_group_size_hint", i32 4, i32 1, i32 1}

Attempting to get the kernel without the correct number of attributes led
to memory corruption and luxrays crashing out.

Fixes the cl/program/execute/attributes.cl piglit test.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76223
CC: "10.2" <mesa-stable@lists.freedesktop.org>
2014-07-03 15:18:03 -05:00
Samuel Iglesias Gonsalvez
7f0420700c glsl: fix duplicated layout qualifier detection for GS
This patch fixes the duplicated layout qualifier detection
for geometry shader's layout qualifiers.

Also it makes the detection code more legible by defining
allowed_duplicates_mask variable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80778
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-07-03 10:34:12 -07:00
Brian Paul
986adb9057 svga: add switch cases for PIPE_SHADER_CAP_DOUBLES
Signed-off-by: Brian Paul <brianp@vmware.com>
2014-07-03 08:25:50 -06:00
Thomas Hellstrom
35cf3831d7 st/xa: Don't close the drm fd on failure v2
If XA fails to initialize with pipe_loader enabled, the pipe_loader's
cleanup function will close the drm file descriptor. That's pretty bad
because the file descriptor will probably be the X server driver's only
connection to drm. Temporarily solve this by dup()'ing the file descriptor
before handing it over to the pipe loader.

This fixes freedesktop.org bugzilla bug #80645.

v2: Fix CC addresses.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-07-03 02:55:00 -07:00
Michel Dänzer
370184e813 Revert "radeonsi: Use dma_copy when possible for si_blit."
This reverts commit 5d5c20920e.

Caused visual corruption, see e.g.
https://bugs.freedesktop.org/show_bug.cgi?id=80827#c1
2014-07-03 11:17:38 +09:00
Ilia Mirkin
7666a9f4ae i965: expose AMD_vertex_shader_viewport_index on gen7+
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-02 21:59:41 -04:00
Ilia Mirkin
df61553070 glsl: add support for AMD_vertex_shader_viewport_index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-02 21:59:38 -04:00
Ilia Mirkin
e593953b50 mesa: add support for AMD_vertex_shader_viewport_index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Tested-by: Tobias Droste <tdroste@gmx.de>
2014-07-02 21:59:05 -04:00
Ilia Mirkin
6c544e5413 mesa/st: enable ARB_fragment_layer_viewport
If multiple viewports are supported, that implies the presence of a GS
and layered rendering, so we can enable ARB_fragment_layer_viewport as
well.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-02 20:20:53 -04:00
Eric Anholt
6ded75ed08 i965/gen6: Add a spec citation about push constant packet requirements.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
e874274d08 i965: Add a comment about null renderbuffer surfaces and why they exist.
I noticed this when trying to find comments about pull constant buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
489ec68554 i965: Update a ton of comments about constant buffers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
e24ef5ab18 i965: Merge VS/GS and WM pull constant buffer upload paths.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
34f4e614dd i965/gen6+: Merge VS/GS and WM push constant buffer upload paths.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
c0f1929dd2 i965: Move dispatch_grf_start_reg and first_curbe_grf into stage_prog_data.
I wanted to access this value from stage-generic code, so stop storing it
under two different names.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
5ba31c34d8 i965: Fix state flags for gen4/5 CURBE.
If we had some NOS affecting VS compilation that resulted in optimization
changing the set of constants to be uploaded, we might not have reuploaded
the constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
a8330c343c i965: Remove a dead define.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
c00d3bd59d i965: Reuse libdrm's header for AUB definitions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
a6af5602af i965: Fix stale comments about the state cache.
This changed in the state streaming work years ago.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
ccf7878126 i965: Fix stale binding table comment.
I recently moved the code from the mentioned location right into this
file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:59 -07:00
Eric Anholt
ccda1b9ba9 i965: Drop the memcmp for finding duplicated CURBE uploads.
At this point, the extra copy of the data and memcmp are as expensive as
just re-uploading.

Note: now that we'll always upload, and brw_constant_buffer watches
BRW_NEW_BATCH anyway, we don't need to explicitly unref the old curbe_bo
at batch reset time.

No significant performance difference on glamor copywinwin10 (n=55),
despite that test having a 98% hit rate on the cache.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:58 -07:00
Eric Anholt
44c63bdd40 i965: Reuse intel_upload.c for gen4/5 constant buffers.
No performance difference on glamor with copywinwin10 (n=40) on my gm45.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-07-02 12:45:58 -07:00
Tom Stellard
fea996c2aa gallium: Add PIPE_SHADER_CAP_DOUBLES
This is for reporting whether or not double precision floating-point
operations are supported.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-02 15:31:52 -04:00
Matt Arsenault
2ab44f657e clover: Fix not setting build log if the build succeeds v2
If there were only warnings, they would not be added to the log.

v2:
  - Use compat::string.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-07-02 15:15:13 -04:00
Francisco Jerez
d2504ead2f clover: Have compat::string allocate its own memory. 2014-07-02 15:15:13 -04:00
Tom Stellard
9e5beac236 gallium/radeon: Only print a message for LLVM diagnostic errors
We were printing messages for all diagnostic types, which was
spamming the console for some OpenCL programs.
2014-07-02 15:15:13 -04:00
Tom Stellard
b9f501bc6b radeon/llvm: Use the llvm.rsq.clamped intrinsic for RSQ
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>

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

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-07-02 14:59:29 -04:00
Ilia Mirkin
141f8fe1d1 r600g: allow viewport index/layer to be sent to ps
In order to support ARB_fragment_layer_viewport, we need to explicitly
send these along to the pixel shader, since it has no other way to
retrieve them.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-07-02 10:53:34 -04:00
Emil Velikov
7414552b18 targets/dri: allow duplicated symbols
With the inclusion of xmlconfig in the loader we're providing dri* symbols
which are already available in libdricommon.la. This leads to a build
break due to the multiple definitions.

Temporary allow multiple definitions, until we come with a better solution.

Reported-by: Laurent Carlier <lordheavym@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-02 12:25:05 +01:00
Emil Velikov
bd322dfd0e st/dri: Remove the old libdridrm library
With all the hw drivers converted, we can go back to having
a single libdridrm provider.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
37b7a76266 targets/dri-vmwgfx: Convert to static/shared pipe-drivers
Convert the final hardware driver to a single dri provider which
includes all the pipe-drivers.

Update the scons build and drop the unused vmw_powf.c.

Cc: José Fonseca <jfonseca@vmware.com>
Cc: Brian Paul <brianp@vmware.com>
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
100e654b25 targets/dri-ilo: Convert to static/shared pipe-driver
Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
0a4be815f4 targets/dri-i915: Convert to static/shared pipe-drivers
v2:
 - Drop inclusion of the winsys wrapper and softpipe/llvmpipe.
 - Remove old Makefile.am, target.c.
 - Correctly append i915 to the megadrivers list.

Cc: Stephane Marchesin <stephane.marchesin@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
231063b032 targets/dri-freedreno: Convert to static/shared pipe-drivers
Now we don't need a second dri module when using kgsl :)

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
495e3e7bed targets/(r300|r600|radeonsi)/dri: Convert to static/shared pipe-drivers
Related to previous commit, merge the separate dri targets to a single
one.

This is essentially all the buildsystem mayhem required for megaradeon.

Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
6eabddd531 targets/dri-nouveau: Convert to static/shared pipe-drivers
Similiar to other targets, we'd like to convert all the separate
targets into a single one, thus we'll minimize the duplication and
overall size of mesa. The conversion per API basis, with the drivers
available either statically or shared. Currently the former is the
default.

v2: Correctly append the version script to the linker flags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:53 +01:00
Emil Velikov
9a7fd2954f st/dri/drm: Add a second libdridrm library
Will be used to create the single dri target library, on our
way to convert all the dri targets during the conversion to
to static/shared pipe-drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:52 +01:00
Emil Velikov
a66dd60547 st/dri: Allow separate dri-targets
With this commit we add a couple of DEFINES making the ST code
conditional, in a way that we can use it to gradually convert
the dri-targets from separate libraries into a single one.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:52 +01:00
Emil Velikov
98204ea7d0 targets/dri-swrast: use drm aware dricommon when building more than swrast
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-02 10:52:52 +01:00
Ilia Mirkin
e1432489c0 docs: update hw-dependent bits of ARB_gpu_shader5
Some of the features are completely implemented by core, while others
have hardware dependencies. Create a list of drivers supporting each
sub-feature that must have hw support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-07-01 20:10:09 -04:00
Ilia Mirkin
27ee7df8ad nvc0: add missed PIPE_CAP_DRAW_INDIRECT
Real support will be forthcoming. For now, avoid the unknown cap error
and compiler warning.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 20:08:36 -04:00
Roland Scheidegger
a7ee842acd llvmpipe: get rid of llvmpipe_get_texture_tile_linear
Because the layout is always linear this didn't really do much any longer -
at some point this triggered per-tile swizzled->linear conversion. The x/y
coords were ignored too.
Apart from triggering conversion, this also invoked alloc_image_data(), which
could only actually trigger mapping of display target resources. So, instead
just call resource_map in the callers (which also gives the ability to unmap
again). Note that mapping/unmapping of display target resources still isn't
really all that clean (map/unmap may be unmatched, and all such mappings use
the same pointer thus usage flags are a lie).

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
a4d0758d9d llvmpipe: get rid of llvmpipe_get_texture_image
The only caller left used it only for non display target textures,
hence it was really the same as llvmpipe_get_texture_image_address - it
also had a usage flag but this was ignored anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
aa1ab8173d llvmpipe: get rid of llvmpipe_get_texture_image_all
Once used for invoking swizzled->linear conversion for all needed images.
But we now have a single allocation for all images in a resource, thus looping
through all slices is rather pointless, conversion doesn't happen neither.
Also simplify the sampling setup code to use the mip_offsets array in the
resource directly - if the (non display target) resource exists its memory
will already be allocated as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
90abdc1541 llvmpipe: allocate regular texture memory upfront
The deferred allocation doesn't really make much sense anymore, since we no
longer allocate swizzled/linear memory in chunks and not per level / slice
neither.
This means we could fail resource creation a bit more (could already fail in
theory anyway) but should not fail maps later (right now, callers can't deal
with neither really).

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
7e1521f191 llvmpipe: get rid of linear_img struct
Just use a tex_data pointer directly - the description was no longer correct
neither.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
b4c3246e7b llvmpipe: (trivial) rename linear_mip_offsets to mip_offsets
Since switching to non-swizzled rendering we only have "normal", aka linear,
offsets.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-07-02 01:55:59 +02:00
Roland Scheidegger
188ba1d6ec target-helpers: don't use designated initializers
it looks since ce1a137228 they are now included
in more places, in particular even for things buildable with msvc, and hence
those break the build.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-02 01:55:59 +02:00
Christoph Bumiller
b97b87940b st/mesa: add support for indirect drawing 2014-07-02 00:47:10 +02:00
Marek Olšák
59330f13b0 gallium/u_vbuf: get draw info from an indirect buffer if there's any
This is required for fallbacks to work with ARB_draw_indirect.
2014-07-02 00:47:10 +02:00
Christoph Bumiller
bc198f8e63 gallium: add facilities for indirect drawing
v2:
Added comments to util_draw_indirect, clarified and fixed map size.
Removed unlikely().
2014-07-02 00:47:09 +02:00
Christoph Bumiller
a27b3582a6 gallium: add PIPE_BIND_COMMAND_ARGS_BUFFER
Intended for use with GL_ARB_draw_indirect's DRAW_INDIRECT_BUFFER
target or for D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS.
2014-07-02 00:47:09 +02:00
Dave Airlie
8392179fcc xmlconfig/dri: bool -> unsigned char
Drop stdbool, due to the X server being a pain and having
struct members called bool, although I've sent a patch to fix
that we should retain stupidity here. Use unsigned char
which is what GLboolean is anyways.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-02 08:24:05 +10:00
Cody Northrop
78121e4b8d i965/fs: Update discard jump to preserve uniform loads via sampler.
Commit 17c7ead7 exposed a bug in how uniform loading happens in the
presence of discard.  It manifested itself in an application as
randomly incorrect pixels on the borders of conditional areas.

This is due to how discards jump to the end of the shader incorrectly
for some channels.  The current implementation checks each 2x2
subspan to preserve derivatives.  When uniform loading via samplers
was turned on, it uses a full execution mask, as stated in
lower_uniform_pull_constant_loads(), and only populates four channels
of the destination (see generate_uniform_pull_constant_load_gen7()).
It happens incorrectly when the first subspan has been jumped over.

The series that implemented this optimization was done before the
changes to use samplers for uniform loads.  Uniform sampler loads
use special execution masks and only populate four channels, so we
can't jump over those or corruption ensues.

This fix only jumps to the end of the shader if all relevant channels
are disabled, i.e. all 8 or 16, depending on dispatch.  This
preserves the original GLbenchmark 2.7 speedup noted in commit
beafced2.

It changes the shader assembly accordingly:

before   : (-f0.1.any4h)  halt(8)  17 2  null { align1 WE_all 1Q };
after(8) : (-f0.1.any8h)  halt(8)  17 2  null { align1 WE_all 1Q };
after(16): (-f0.1.any16h) halt(16) 17 2  null { align1 WE_all 1H };

v2: Cleaned up comments and conditional ordering.
v3: Fix typo.

Signed-off-by: Cody Northrop <cody@lunarg.com>
Reviewed-by: Mike Stroyan <mike@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79948
2014-07-01 13:22:28 -07:00
Matt Turner
fcac7020cf i965/fs: Mark case unreachable to silence warning.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
3d826729da i965: Use unreachable() instead of unconditional assert().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
a3d10c2c30 mesa: Make unreachable macro take a string argument.
To aid in debugging.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
e658440234 i965/vec4: Remove useless conditionals.
Setting a couple of bits is the same cost or less as conditionally
setting a couple of bits.
2014-07-01 08:55:52 -07:00
Matt Turner
2e90d1fb62 i965/fs: Pass cfg to calculate_live_intervals().
We've often created the CFG immediately before, so use it when
available.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
ec1b2d6aa0 i965: Mark fields in the live interval classes protected.
cfg, for instance, is a pointer to a local variable in
calculate_live_intervals, certainly not valid after that function has
returned.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
021094481c glsl: Remove now unused foreach_list* macros.
foreach_list_typed_const was never used as far as I can tell.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:52 -07:00
Matt Turner
266109736a i965: Use typed foreach_in_list_safe instead of foreach_list_safe.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
c5030ac0ac i965: Use typed foreach_in_list instead of foreach_list.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
bc2fbbafd2 i965: Add and use foreach_inst_in_block macros.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
e8e5f0a342 i965/fs: Use is_head_sentinel() instead of ->prev == NULL.
Makes it more clear what we're doing and requires less knowledge of
exec_list.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
d6bb8bb7ce mesa: Add and use foreach_list_typed_safe.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
22cd917329 mesa: Add and use foreach_in_list_use_after.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
d49173a97b glsl: Replace uses of foreach_list_const.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
fd8f65498a glsl: Replace another couple uses of foreach_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
6e217ad1d7 glsl: Use foreach_list_typed when possible.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
373824d769 mesa: Use typed foreach_in_list_safe instead of foreach_list_safe.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
c6a16f6d0e glsl: Use typed foreach_in_list_safe instead of foreach_list_safe.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
e0cb82d0c4 mesa: Use typed foreach_in_list instead of foreach_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
4d78446d78 glsl: Use typed foreach_in_list instead of foreach_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
da9f0316e6 glsl: Add typed foreach_in_list_safe macro.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Matt Turner
3597681040 glsl: Add typed foreach_in_list/_reverse macros.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-07-01 08:55:51 -07:00
Axel Davy
4d6c9352f3 mesa: fix the condition in src/loader/Makefile.am
We want to have the dri common files compiled to define USE_DRICONF.
We need to check both NEED_OPENGL_COMMON and HAVE_DRICOMMON

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Tested-by: Brian Paul <brianp@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
ad6e1e12cc mesa: update comment for UniformBufferSize to indicate size is in bytes
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
f4b0ab7afd st/mesa: fix incorrect size of UBO declarations
UniformBufferSize is in bytes so we need to divide by 16 to get the
number of constant buffer slots.  Also, the ureg_DECL_constant2D()
function takes first..last parameters so we need to subtract one
for the last value.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
01bf8bb875 st/mesa: don't use address register for constant-indexed ir_binop_ubo_load
Before, we were always using the address register and indirect addressing
to index into a UBO constant buffer.  With this change we only do that
when necessary.

Using the piglit bin/arb_uniform_buffer_object-rendering test as an
example:

Shader code:
  uniform ub_rot {float rotation; };
  ...
  m[1][1] = cos(rotation);

Before:
  IMM[1] INT32 {0, 1, 0, 0}
  1: UARL ADDR[0].x, IMM[1].xxxx
  2: MOV TEMP[0].x, CONST[3][ADDR[0].x].xxxx
  3: COS TEMP[1].x, TEMP[0].xxxx

After:
  0: COS TEMP[0].x, CONST[3][0].xxxx

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
dfca35f807 st/mesa: allow 2D indexing for all shader types in translate_src()
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Brian Paul
f11e3dc122 st/mesa: don't ignore const buf index in src_register()
Otherwise, if we were creating a const buffer src register for a UBO
the index into the UBO was always zero.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 09:42:44 -06:00
Ilia Mirkin
5e04526399 nvc0: expose 4 vertex streams, use stream ids in xfb
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
2f2467cb23 nvc0/ir: only merge emit/restart for identical streams
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
e5cdbdecd2 nvc0/ir: avoid creating restarts with non-0 stream
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
40b8aec251 nvc0/ir: fix emitting vertex stream
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-07-01 11:34:40 -04:00
Ilia Mirkin
1d16dbf416 mesa/st: add vertex stream support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:37 -04:00
Ilia Mirkin
746e5260f6 gallium: add a cap for max vertex streams
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:35 -04:00
Ilia Mirkin
43e4b3e311 gallium: add an index argument to create_query
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:31 -04:00
Ilia Mirkin
7f1b365f65 gallium: add support for stream in so info
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:28 -04:00
Ilia Mirkin
0cbefc1bea gallium: add vertex stream argument to EMIT/ENDPRIM
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-07-01 11:34:24 -04:00
Matt Turner
1bfc0a1102 i965/fs: Mark predicated PLN instructions with dependency hints.
To implement the unlit_centroid_workaround, previously we emitted

   (+f0) pln(8) g20<1>F g16.4<0,1,0>F g4<8,8,1>F { align1 1Q };
   (-f0) pln(8) g20<1>F g16.4<0,1,0>F g2<8,8,1>F { align1 1Q };

where the flag register contains the channel enable bits from g0.

Since the predicates are complementary, the pair of pln instructions
write to non-overlapping components of the destination, which is the
case that the dependency control hints are designed for.

Typically setting dependency control hints on predicated instructions
isn't safe (if an instruction doesn't execute due to the predicate, it
won't update the scoreboard, leaving it in a bad state) but since we
must have at least one channel executing (i.e., +f0 is true for some
channel) by virtue of the fact that the thread is running, we can put
the +f0 pln instruction last and set the hints:

   (-f0) pln(8) g20<1>F g16.4<0,1,0>F g2<8,8,1>F { align1 NoDDClr 1Q };
   (+f0) pln(8) g20<1>F g16.4<0,1,0>F g4<8,8,1>F { align1 NoDDChk 1Q };

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 22:31:06 -07:00
Matt Turner
4fe53ee5d7 i965/fs: Predicate PLN instructions used in unlit centroid WA.
Maybe lets us skip some PLN instructions if whole subspans are disabled?

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 22:31:05 -07:00
Matt Turner
6d2536395d i965/fs: Add no_dd_{clear,check} fields to fs_inst.
And plumb them through. Also make the assert in the generator look like
the vec4 one.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 22:31:05 -07:00
Matt Turner
bcbb7c41b7 i965/fs: Let sat-prop ignore live ranges if producer already has sat.
This sequence (where both x and w are used afterwards) wasn't handled.

   mul.sat x, y, z
   ...
   mov.sat w, x

We assumed that if x was used after the mov.sat, that we couldn't
propagate the saturate modifier, but in fact x was already saturated.

So ignore the live range check if the producing instruction already
saturates its result. Cuts one instruction from hundreds of TF2 shaders.

total instructions in shared programs: 1995631 -> 1994951 (-0.03%)
instructions in affected programs:     155248 -> 154568 (-0.44%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Matt Turner
e58992aedd i965/fs: Pass const references to emit functions.
Cuts 10k of .text and saves a bunch of useless struct copies.
2014-06-30 22:31:05 -07:00
Matt Turner
35b741c8e7 i965/vec4: Pass const references to instruction functions.
text	   data	    bss	    dec	    hex	filename
4231165	 123200	  39648	4394013	 430c1d	i965_dri.so
4186277	 123200	  39648	4349125	 425cc5	i965_dri.so

Cuts 43k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Matt Turner
d35f34cea9 i965/vec4: Pass const references to vec4_instruction().
text	   data	    bss	    dec	    hex	filename
4244821	 123200	  39648	4407669	 434175	i965_dri.so
4231165	 123200	  39648	4394013	 430c1d	i965_dri.so

Cuts 13k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Matt Turner
e4b05af5d4 i965/fs: Pass const references to instruction functions.
text	   data	    bss	    dec	    hex	filename
4270747	 123200	  39648	4433595	 43a6bb	i965_dri.so
4244821	 123200	  39648	4407669	 434175	i965_dri.so

Cuts 25k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-30 22:31:05 -07:00
Axel Davy
5d5c20920e radeonsi: Use dma_copy when possible for si_blit.
This improves GLX DRI3 GPU offloading significantly on CPU
bound benchmarks particularly.
No performance impact for DRI2 GPU offloading.

v2: Add missing tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák<marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:10:01 +10:00
Axel Davy
9320c8fea9 glx/dri3: add GPU offloading support.
The differences with DRI2 GPU offloading are:
a) There's no logic for GPU offloading needed in the Xserver

b) for DRI2, the card would render to a back buffer, and
the content would be copied to the front buffer (the same buffers
everytime). Here we can potentially use several back buffers and copy
to buffers with no tiling to share with X. We send them with the
Present extension.

That means than the DRI2 solution is forced to have tearings with GPU
offloading. In the ideal scenario, this DRI3 solution doesn't have this
problem.

However without dma-buf fences, a race can appear (if the card is slow
and the rendering hasn't finished before the server card reads the buffer),
and then old content is displayed. If a user hits this, he should probably
revert to the DRI2 solution (LIBGL_DRI3_DISABLE). Users with cards fast
enough seem to not hit this in practice (I have an Amd hd 7730m, and I
don't hit this, except if I force a low dpm mode)

c) for non-fullscreen apps, the DRI2 GPU offloading solution requires
compositing. This DRI3 solution doesn't have this requirement. Rendering
to a pixmap also works.

d) There is no need to have a DDX loaded for the secondary card.

V4: Fixes some piglit tests

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:07:52 +10:00
Axel Davy
3ecd9e1a93 loader: Use drirc device_id parameter in complement to DRI_PRIME
DRI_PRIME is not very handy, because you have to launch the executable
with it set, which is not always easy to do.
By using drirc, the user specifies the target executable
and the device to use. After that the program will be launched everytime
on the target device.

For example if .drirc contains:

<driconf>
    <device driver="loader">
        <application name="Glmark2" executable="glmark2">
            <option name="device_id" value="pci-0000_01_00_0" />
        </application>
    </device>
</driconf>

Then glmark2 will use if possible the render-node of
ID_PATH_TAG pci-0000_01_00_0.

v2: Fix compilation issue
v3: Add "-lm" and rebase.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:07:40 +10:00
Axel Davy
7ab925a6aa loader: add gpu selection code via DRI_PRIME.
v2: Fix the leak of device_name
v3: Rebased

It enables to use the DRI_PRIME env var to specify
which gpu to use.
Two syntax are supported:
If DRI_PRIME is 1 it means: take any other gpu than the default one.
If DRI_PRIME is the ID_PATH_TAG of a device: choose this device if
possible.

The ID_PATH_TAG is a tag filled by udev.
You can check it with 'udevadm info' on the device node.
For example it can be "pci-0000_01_00_0".

Render-nodes need to be enabled to choose another gpu,
and they need to have the ID_PATH_TAG advertised.
It is possible for not very recent udev that the tag
is not advertised for render-nodes, then
ones need to add a file containing:

SUBSYSTEM=="drm", IMPORT{builtin}="path_id"

in /etc/udev/rules.d/

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:07:30 +10:00
Axel Davy
da3a47d682 drirc: Add string support
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
2014-07-01 13:06:51 +10:00
Dave Airlie
29800e6a3e dri: remove GL types from config queries
This in theory changes ABI for the boolean->bool I think,
but nothing in the tree uses configQueryb AFAICS.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:06:29 +10:00
Dave Airlie
a513daec29 dri/xmlconfig: remove GL types.
This just drops all the GL types from the xmlconfig and use
std C types from stdint and stdbool.

v2: drop further double and header include.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:03:06 +10:00
Dave Airlie
b94dc944df dri3: cache pointer to back instead of looking up.
This is just prep work for the dri3 prime patches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-07-01 13:00:14 +10:00
Alexandre Demers
11a879f260 configure.ac: (trivial) Fixing a typo
Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:50:00 +01:00
Emil Velikov
ce1a137228 targets/egl-static: use inline_drm_helper and Automake.inc helpers
Update all three build systems, and add freedreno to the android
build. Pending future work on the ST we can convert egl-static
to provide either static or dynamic access to the pipe-drivers.

There is no functional change with this patch.

v2: Don't add freedreno to android build, drop the wrapper winsys.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:27:12 +01:00
Emil Velikov
7689aa28cd targets/gbm: convert to static/shared pipe-driver
Move the gbm "target" code to the state-tracker, similar
to other - dri, omx, vdpau... ST.

v2: Drop inclusion of the wrapper winsys and softpipe/llvmpipe.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:27:11 +01:00
Emil Velikov
37e640a073 targets/xa: provide alternative(static) xa target
Now we can build the xa target (libxatracker) with either static
pipe-drivers or shared ones. Currently we default to static.

 - Remove the unused CFLAGS/CPPFLAGS.
 - Use GALLIUM_TARGET_CFLAGS where applicable.

v2: Update the printout messages at configure.
v3: Drop inclusion of the wrapper winsys and softpipe/llvmpipe.

Cc: Jakob Bornecrantz <jakob@vmware.com>
Cc: Rob Clark <robclark@freedesktop.org>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-30 22:27:11 +01:00
Kenneth Graunke
c60a4ba7e3 i965/disasm: Fix INTEL_DEBUG=fs on Broadwell for ARB_fp applications.
Apparently INTEL_DEBUG=fs has crashed on Broadwell for anything using
ARB_fragment_program since commit 9cee3ff5.  We need to NULL-check the
right field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-30 14:06:51 -07:00
Kenneth Graunke
5dfbfd17e0 i965/disasm: Delete gen8_disasm.c.
The functionality has been merged into brw_disasm.c; use that instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
e59a9ecc98 i965/disasm: Stop using gen8_disassemble in favor of brw_disassemble.
At this point, brw_disassemble can do everything gen8_disassemble can
do - and, thanks to the new brw_inst API, it supports all generations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
7b7f95b952 i965/disasm: Improve render target write message disassembly.
Previously, we decoded render target write messages as:

   render ( RT write, 0, 16, 12, 0) mlen 8 rlen 0

which made you remember (or look up) what the numbers meant:

1. The binding table index
2. The raw message control, undecoded:
   - Last Render Target Select
   - Slot Group Select
   - Message Type (SIMD8, normal SIMD16, SIMD16 replicate data, ...)
3. The dataport message type, again (already decoded as "RT write")
4. The write commit bit (0 or 1)

Needless to say, having to decipher that yourself is annoying.  Now, we
do:

   render RT write SIMD16 LastRT Surface = 0 mlen 8 rlen 0

with optional "Hi" and "WriteCommit" for slot group/write commit.

Thanks to the new brw_inst API, we can also stop duplicating code on a
per-generation basis.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
0e5b52e35d i965/disasm: Rename msg_target to SFID.
We haven't used the name "message target" in a while - there are a lot
of things called "target", and it gets confusing.  SFID ("Shared
Function ID") is the term commonly used in the modern documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
c4cf088f43 i965/disasm: Fix typo in RT UNORM write message.
The name of this message is "Render Target UNORM Write" (Sandybridge
PRM, Volume 4 Part 1, Page 210).  Drop the bogus 'c'.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
3603dfff6f i965/disasm: Use Gen6+ SFID case labels.
Most developers will recognize the Gen6+ SFID names more quickly than
the Gen4-5 ones.  Given that they're the same values, just use the new
names.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
4fe78f4cc2 i965/disasm: "Handle" Gen8+ HF/DF immediate cases.
We should print something properly, but I'm not sure how to properly
print an HF, and we don't have any DFs today to test with.

This is at least better than the current Gen8 disassembler, which would
simply assert fail.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
f36bebcd5c i965/disasm: Cut piles of duplicate swizzle printing.
Making a helper function saves us from cut and pasting this four times.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
bdcbcc73dd i965/disasm: Properly decode negate source modifiers on Broadwell.
This is a port of Abdiel's 6f9f916b9b
to brw_disasm.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
00b72bbab5 i965/disasm: Improve disassembly of atomic messages on Haswell+.
This backports the atomic message disassembly support from
gen8_disasm.c, which additionally offers support for decoding atomic
surface read/write messages, and showing SIMD modes and other details.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
eb3185f686 i965/disasm: Actually disassemble Gen7+ URB opcodes.
I never bothered implementing the disassembler for Gen7+ URB opcodes, so
we were just disassembling them as Ironlake/Sandybridge ones.  This
looked pretty bad when running Paul's GS EndPrimitive tests, as the
"write OWord" message was decoded at ff_sync, which doesn't exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
aa9e23dbe8 i965/disasm: Decode Broadwell's invm/rsqrtm math functions.
We don't use these yet, but we may as well disassemble them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
9a91f92596 i965/disasm: Properly disassemble the "atomic" ThreadCtrl value.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
156c73a899 i965/disasm: Properly disassemble all32h/any32h align1 predicates.
While we're adding things, use symbolic constants rather than magic
numbers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:28 -07:00
Kenneth Graunke
03084453d7 i965: Add #defines for any32h/all32h predication.
These have existed since Ivybridge.  We don't use them today, but the
Gen8+ disassembler supports them, and I'd like to use symbolic names
rather than magic numbers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
707c42cb96 i965/disasm: Mark ELSE as having UIP on Gen8+.
This makes brw_disasm.c able to disassemble ELSE instructions correctly
on Broadwell.  (gen8_disasm.c already handles this correctly.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
df4eeed0be i965/disasm: Properly disassemble jump targets on Gen4-5.
Previously, our dissasembly for flow control instructions looked like:

0x00000040: else(8)         ip          65540D     { align16 switch };

It didn't print InstCount properly for ELSE/ENDIF, and didn't even
attempt to disassemble PopCount.

Now it looks like:

0x00000040: else(8)         Jump: 4     Pop: 1     { align16 switch };

which is much more readable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
6928959d8e i965/disasm: Improve disassembly of jump targets on Gen6+.
Previously, flow control instructions generated output like:

(+f0) if(8) 12 8  null         0x000c0008UD { align16 WE_normal 1Q };

which included a dissasembly of the register fields, even though those
are meaningless for flow control instructions---those bits are reused
for another purpose.

It also wasn't immediately obvious which number was UIP and which was
JIP.

With this patch, we instead output:

(+f0) if(8)       JIP: 8       UIP: 12      { align16 WE_normal 1Q };

which is much clearer.

The patch also introduces has_uip/has_jip helper functions which clear
up a some generation/opcode checking mess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
6497890bf4 i965/disasm: Add support for new Gen8+ register types.
While we're at it, use proper names rather than magic numbers for the
existing fields.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
5f106b03a9 i965: Restyle brw_disasm.c.
brw_disasm.c basically wasn't following the Mesa coding style at all.
It used 4-space indent instead of 3-space, didn't cuddle braces, didn't
put function return types on a separate line, put extra spaces in
function calls (between the name and parenthesis), and a number of other
things.

This made it fairly obnoxious to work on, since my editor is configured
to follow Mesa style in the Mesa source repository.  Fixing it to follow
a consistent style now should save time dealing with it later.

These modifications were originally generated by:
$ indent -br -i3 -npcs -ce -cs -l80 --no-tabs
with some manual changes afterwards to fit our style better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
5e20e9a830 i965/disasm: Create an "opcode" temporary.
This saves typing brw_inst_opcode(brw, inst) everywhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Kenneth Graunke
3d1992754f i965/disasm: Eliminate opcode pointer.
opcode is just a pointer to opcode_descs; we may as well use that
directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-30 14:05:27 -07:00
Jason Ekstrand
4000c0112a Remove the ATI_envmap_bumpmap extension
As far as I can tell, the Intel mesa driver is the only driver in the world
still supporting this legacy extension.  If someone wants to do bump
mapping, they can use shaders.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> [v2]
Reviewed-by: Ian Romanick <idr@freedesktop.org> [v3]
2014-06-30 12:02:25 -07:00
Kenneth Graunke
7577cdd830 meta: Use AMD_vertex_shader_layer instead of a GS for layered clears.
On i965, enabling and disabling the GS is not free: you have to do a
full pipeline stall, reconfigure the URB and push constant space, and
emit a bunch of state.  Most clears aren't layered, so the GS isn't
needed in the common case.  But we turned it on universally.

Using AMD_vertex_shader_layer allows us to skip setting up the GS
altogether, while achieving the same effect.

According to Ilia, current nVidia GPUs can't do AMD_vertex_shader_layer.
However, since nouveau is Gallium-based, they're unlikely to ever care
about this path.  Intel and AMD GPUs both support the extension.

Since i965 is the only driver using this path which does layered
rendering, we may as well target it at that.

v2: Improve commit message.  No code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-30 00:08:54 -07:00
Samuel Iglesias Gonsalvez
f3c5b2f7d0 docs: mark "Geometry shader multiple streams" as done for i965
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
5b3492fa3f i965: Enable vertex streams up to MAX_VERTEX_STREAMS.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
0b84fa2c52 mesa: Enable simultaneous queries on different streams.
It should be possible to query the number of primitives written to each
individual stream by a geometry shader in a single draw call. For that
we need to have up to MAX_VERTEX_STREAM separate query objects.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
3178d2474a i965: Implement GL_PRIMITIVES_GENERATED with non-zero streams.
So far we have been using CL_INVOCATION_COUNT to resolve this query but this
is no good with streams, as only stream 0 reaches the clipping stage. Instead
we will use SO_PRIM_STORAGE_NEEDED which can keep track of the primitives sent
to each individual stream.

Since SO_PRIM_STORAGE_NEEDED is related to the SOL stage and according to
ARB_transform_feedback3 we need to be able to query primitives generated in
each stream whether transform feedback is active or not what we do is to
enable the SOL unit even if transform feedback is not active but disable all
output buffers in that case. This effectively disables transform feedback
but permits activation of statistics enabling SO_PRIM_STORAGE_NEEDED even
when transform feedback is not active.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
a374685f09 i965: Implement GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN with non-zero streams.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
ecd9960430 mesa: Include stream information in indexed queries.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Samuel Iglesias Gonsalvez
0e58a3ef2a glsl: include streamId when reading/printing ir_variable IR.
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
a16043ba57 glsl: include streamId when reading/printing emit-vertex and end-primitive IR.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
5d562588a5 i965/gs: Set control data bits for vertices emitted in stream mode.
In stream mode we have to set control data bits with the StreamID
information for every vertex.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
7589683c97 glsl: Validate vertex emission in geometry shaders.
Check if non-zero streams are used. Fail to link if emitting to unsupported
streams or emitting to non-zero streams with output type other than GL_POINTS.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
e877aadde0 glsl: Add support for EmitStreamVertex() and EndStreamPrimitive().
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
4b3fc21032 glsl: Modify ir_end_primitive to have a stream.
This will be necessary to implement EndStreamPrimitive().
EndPrimitive() will produce an ir_end_primitive with the default stream 0.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
8639effefe glsl: Modify ir_emit_vertex to have a stream.
This will be necessary to implement EmitStreamVertex().
EmitVertex() will produce an ir_emit_vertex with the default stream 0.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
9650293b51 i965/gs: Set number of control data bits for stream mode.
If the geometry shader is indeed using streams then we need 2 control data
bits per vertex for the StreamID. If the shader is not using streams then
we don't need control data bits.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
6d3632c9c9 glsl: Store info about geometry shaders that emit vertices to non-zero streams.
On Intel hardware when a geometry shader outputs GL_POINTS primitives we
only need to emit vertex control bits if it emits vertices to non-zero
streams, so use a flag to track this.

This flag will be set to TRUE when a geometry shader calls EmitStreamVertex()
or EndStreamPrimitive() with a non-zero stream parameter in a later patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
598c2e2c83 glsl: Only geometry shader outputs can be associated with non-zero streams.
This should be ensured by the parser, so assert on that.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
e2dd717616 glsl: Two varyings can't write to the same buffer from different streams.
If this is detected, fail to link.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:50 +02:00
Iago Toral Quiroga
1e1f071d25 glsl: Add methods to retrive a varying's name and streamId.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
02fd80e160 glsl: Fail to link if inter-stage input/outputs are not assigned to stream 0
Outputs that are linked to inputs in the next stage must be output to stream 0,
otherwise we should fail to link.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
b908e85ed3 glsl: Assign GLSL StreamIds to transform feedback outputs.
Inter-shader outputs must be on stream 0, which is the default.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
37d795317e i965: Enable transform feedback for streams > 0
Configure hardware to read vertex data for all streams and have all streams
write their varyings to the corresponsing output buffers.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Iago Toral Quiroga
f20c723039 mesa: add StreamId information to transform feedback outputs.
For now initialized to the default stream 0.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Samuel Iglesias Gonsalvez
a7e6ec6898 glsl: Add parsing support for multi-stream output in geometry shaders.
This implements parsing requirements for multi-stream support in
geometry shaders as defined in ARB_gpu_shader5.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-30 08:08:49 +02:00
Emil Velikov
15b5e663b0 st/omx: strcpy the string into the allocated buffer
This fixes commit a001ca98e15(st/omx: keep the name,
(name|role)_specific strings dynamically allocated) in which we
dynamically allocated the buffers for name and (name|role)_specific
yet forgot to copy the encoder strings into them.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80614
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-28 15:24:45 +01:00
Ilia Mirkin
f230015206 mesa: expose ARB_seamless_cubemap_per_texture when supported
All of the bits appear to already be in place to support this in the
sampler (which the original AMD version didn't allow).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-28 00:51:43 -04:00
Emil Velikov
a001ca98e1 st/omx: keep the name, (name|role)_specific strings dynamically allocated
... as it's caller (the external program omxregister-bellagio) is the one
who frees all of the allocated memory.

Reported-by: Pedretti Fabio <pedretti.fabio@gmail.com>
Tested-by: Fabio Pedretti <pedretti.fabio@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-27 19:13:31 +01:00
Chris Forbes
ed66312426 docs: Update the status of a few things in GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-27 22:13:21 +12:00
Axel Davy
c58486516f nv50: fix dri3 prime buffer creation
This is the same fix than
"nvc0: fix dri3 prime buffer creation"

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 13:38:20 +10:00
Dave Airlie
13eddf3bf2 nvc0: fix dri3 prime buffer creation
We need to place shared buffers into GART.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 13:38:14 +10:00
Axel Davy
df282ce1bf gallium/dri2: implement blitImage
V3: call flush_resource before flush
V4: Add new flags

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Axel Davy
8a66a5de83 dri/image: add blitImage to the specification
It allows to blit two __DRIimages.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Axel Davy
27c686309e gallium: Add __DRIimageDriverExtension support to gallium
__DRIimageDriverExtension is used by GLX DRI3 and Wayland.

This patch is a rewrite of
http://lists.freedesktop.org/archives/mesa-dev/2014-May/060318.html
and
http://lists.freedesktop.org/archives/mesa-dev/2014-May/060317.html

Previous patches were:
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Axel Davy
e40cf256f4 dri3: use invalidate.
This doesn't change anything to the intel DRI3 implementation,
but enables the gallium implementation to use dri2.stamp instead
of relying on the stamp shared with the st backend.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Dave Airlie
e4419913bf dri3: fix image extension checking.
Move the image extension setup in with all the others in
bind_extensions, and improve the check to both version
and function pointer.

Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 11:39:34 +10:00
Jasper St. Pierre
b4dcf87f34 glxext: Send the Drawable's ID in the GLX_BufferSwapComplete event
While the official INTEL_swap_event specification says that the drawable
field should contain the GLXDrawable, not the Drawable, the existing
DRI2 code in dri2.c that translates from DRI2_BufferSwapComplete sends out
GLX_BufferSwapComplete with the Drawable's ID, so existing codebases
like Clutter/Cogl rely on getting the Drawable.

Match DRI2's error here and stuff the event with the X Drawable, not
the GLX drawable.

This fixes apps seeing wrong drawables through an indirect GLX context
or with DRI3, which uses the GLX_BufferSwapComplete event directly on
the wire instead of translates Present in mesa.

At the same time, also modify the structure for the event to make sure
that clients don't make the same mistake. This is not an API or ABI
break, as GLXDrawable and Drawable are both typedefs for XID.

Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-27 09:44:56 +10:00
Kenneth Graunke
8cf289c3ef i965: Enable compressed multisample support (CMS) on Broadwell.
Everything is in place and appears to be working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-26 11:50:35 -07:00
Kenneth Graunke
db184d43b0 i965: Add 2x MSAA support to the MCS allocation function.
2x MSAA also uses 8 bits, just like 4x.  More bits are unused.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
a248b2a4eb i965: Hook up the MCS buffers in SURFACE_STATE on Broadwell.
MCS buffers are never allocated on Broadwell, so this does nothing for
now, but puts the infrastructure in place for when they do exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
e10311be9f i965: Drop SINT workaround for CMS layout on Broadwell.
According to the documentation, we don't need this SINT workaround on
Broadwell.  (Or at least, it doesn't mention that we need it.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
fd77187689 i965: Add plumbing for Broadwell's auxiliary surface support.
Broadwell generalizes the MCS fields to allow for multiple kinds of
auxiliary surfaces.  This patch adds the plumbing to set those values,
but doesn't yet hook any up.

v2: (by Jordan Justen) Use mt for qpitch; pitch is tiles - 1.
v3: Don't forget to subtract 1 from aux_mt->pitch.
v4: Drop unnecessary aux_mt->offset (caught by Jordan Justen).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-06-26 11:50:34 -07:00
Jordan Justen
a46cb6a971 i965: Add auxiliary surface field #defines for Broadwell.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-06-26 11:50:34 -07:00
Kenneth Graunke
7c2946fc23 i965: Disassemble all of DP write message control bits on Gen6.
Prior to the new brw_inst API, the brw_instruction structure split off
bits 4 and 5 of msg_control for specific fields, and we failed to
disassemble them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:46:26 -07:00
Matt Turner
40a9754953 i965: Pass brw to brw_try_compact_instruction().
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:25 -07:00
Matt Turner
fa1a3b2e3c i965: Add is_cherryview flag to brw_context.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:24 -07:00
Matt Turner
a25401bc9a i965: Add CSEL opcode definition for Gen8.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:23 -07:00
Matt Turner
e1b477238d i965: Document which instructions are generation specific.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:21 -07:00
Matt Turner
a382b4cb7a i965: Don't set UIP for ENDIF/WHILE.
They don't have a UIP. We used UIP in an array dereference, which never
caused problems on Gen < 8, since UIP was a small integer (number of
instructions). On Gen 8 UIP is in bytes, so it's large enough that it
caused us to read out of bounds of the array.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:19 -07:00
Matt Turner
92233aee47 i965: Replace struct brw_compact_instruction with brw_compact_inst.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:17 -07:00
Matt Turner
eaf78e56af i965: Convert brw_eu_compact.c to the new brw_compact_inst API.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:16 -07:00
Matt Turner
395c759712 i965: Introduce a new brw_compact_inst API.
For now nothing uses this, but we can incrementally convert.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:14 -07:00
Matt Turner
7c79608b5b i965: Replace 'struct brw_instruction' with 'brw_inst'.
Use this an an opportunity to clean up the formatting of some old code
(brw_ADD, for instance).

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:12 -07:00
Matt Turner
290daad497 i965: Throw out guts of struct brw_instruction.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:11 -07:00
Matt Turner
a375092f5c i965: Convert brw_gs_emit.c to the new brw_inst API.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:05 -07:00
Matt Turner
bfbe6a7210 i965: Convert brw_disasm.c to the new brw_inst API.
v2: (by Kenneth Graunke)
 - Fix disassembly of Gen4-5 SEND messages to print base MRF correctly.
 - Only print URB opcode on Gen5+, to match previous output (besides,
   there is only one opcode AFAICT.)
 - Only print the low 3 bits of msg_control, to match previous output.
   (We probably should decode all the fields, but hadn't previously due
   to the brw_instruction structure definition splitting out bits 4/5
   for last_render_target and slot_group_select.)
 - Fix 3-source MRF/GRF file decoding on Sandybridge.
 - Fix compression code to use qtr_control rather than cmpt_control
   (which is compaction, not compression).

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v2]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:46:01 -07:00
Matt Turner
1149eedffc i965: Pass brw rather than gen to brw_disassemble_inst().
We will need it in order to use the new brw_inst API.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:45:58 -07:00
Matt Turner
9cbf899a7d i965: Convert brw_eu_compact.c to the new brw_inst API.
v2: Use brw_inst_bits rather than pulling out individual fields and
    reassembling them.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:45:50 -07:00
Kenneth Graunke
5e6818faa5 i965: Extend is_haswell checks to gen >= 8 in Gen4-7 generators.
We're going to use fs_generator/vec4_generator for Gen8+ code soon,
thanks to the new brw_instruction API.  When we do, we'll generally
want to take the Haswell paths on Gen8+ as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:47 -07:00
Kenneth Graunke
45cc9ddcc1 i965: Convert test_eu_compact.c to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:46 -07:00
Kenneth Graunke
4362631d7b i965: Convert vec4_generator to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:44 -07:00
Kenneth Graunke
a041eb4030 i965: Convert fs_generator to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:42 -07:00
Kenneth Graunke
eedc5bbc69 i965: Convert Gen4-5 clipping code to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:40 -07:00
Kenneth Graunke
7213e1ddc7 i965: Convert brw_sf_emit.c to the new brw_inst API.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:45:38 -07:00
Kenneth Graunke
829aac4b67 i965: Convert brw_eu_emit.c to the new brw_inst API.
v2:
 - Fix IF -> ELSE patching on Sandybridge.
 - Don't set base_mrf on Gen6+ in OWord Block Read functions.  (Although
 - the old code did this universally, it shouldn't have - the field
 - doesn't exist on Gen6+ and just got overwritten by the SFID anyway.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:51 -07:00
Kenneth Graunke
607f5eb381 i965: Convert brw_eu.[ch] to use the new brw_inst API.
v2: Don't set flag_reg_nr prior to Gen7 (as it doesn't exist).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:43 -07:00
Kenneth Graunke
d49a9ca8c2 i965: Introduce a new brw_inst API.
This is similar to gen8_instruction, and will eventually replace it.

For now nothing uses this, but we can incrementally convert.
The new API takes the existing brw_instruction pointers to ease
conversion; when done, we can simply drop the old structure and rename
struct brw_instruction -> brw_inst.

v2: (by Matt Turner) Make JIP/UIP functions take a signed argument.
v3: (by Kenneth Graunke)
 - Make Gen4-6 jump target functions take a signed argument.
 - Fix indirect align1 AddrImm bits on Gen4-7.
 - Fix SFID on Sandybridge to use bits 27:24.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v1, v3+]
Signed-off-by: Matt Turner <mattst88@gmail.com> [v2]
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:24 -07:00
Kenneth Graunke
05040d6f8f i965: Pass brw into next_offset().
The new brw_inst API is going to require a brw pointer in order
to access fields (so it can do generation checks).  Plumb it in now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-26 11:44:22 -07:00
Greg Hunt
890287b96b i965: Remove unneeded VS workaround stalls on Baytrail.
According to the workarounds list, these stalls aren't needed on
production Baytrail systems.  Piglit confirms that as well.

These cause a small slowdown when we are sending a large number of small
batches to the GPU.  Removing these improves performance by up to 5% on
some CPU bound SynMark tests (Batch[4-7], DrvState1, HdrBloom,
Multithread, ShMapPcf).

Signed-off-by: Gregory Hunt <greg.hunt@mobica.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 11:31:28 -07:00
Kenneth Graunke
05126b9bb5 i965: Include marketing names for Broadwell GPUs.
Intel would like us to include the marketing names.  Developers
additionally want "Broadwell GT1/2/3" because it makes it easier
to identify what hardware users have when they request assistance
or report issues.

Including both makes it easy for everyone to map between the names.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-26 11:31:27 -07:00
Roland Scheidegger
b1c1c7d31b softpipe: use last_level from sampler view, not from the resource
The last_level from the sampler view may be limited by the state tracker
to a value lower than what the base texture provides.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-26 16:57:12 +02:00
Emil Velikov
f3a97c0381 targets/automake.inc: s/GALLIUM_VIDEO_CFLAGS/GALLIUM_TARGET_CFLAGS/
The flags are not specific to the video targets plus
we can reuse them for targets/xa and targets/gbm.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
f6723392e3 auxiliary/vl: Remove no longer used SPLIT_TARGETS
Required for the conversion stage of all VL targets to
a single library per API (static/shared pipe-drivers).

No longer required as per last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
11bce6a94e targets/radeonsi/omx: convert to static/shared pipe-drivers
The radeonsi counterpart of previous commit - now libomx-radeonsi is
built into the libomx-mesa library. Providing a single library per API.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

This patch concludes the unification. Now libomx-mesa will be used
for all hardware - r600, radeonsi and nouveau.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
d23497c256 targets/r600/omx: convert to static/shared pipe-drivers
The r600 counterpart of previous commit - now the libomx-r600 is
built into the libomx-mesa library. Providing a single library per API.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

If you have more than one omx library (libomx-radeonsi, libomx-r600),
make sure to temporary move the unused one. By the end of the series
there will be only one library that will be used for all hardware -
r600, radeonsi and nouveau.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
b1f4a9681f targets/omx-nouveau: convert to static/shared pipe-drivers
Similar to the vdpau/xvmc targets, we're going to convert the
multiple target libraries into a single one.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

If you have more than one omx library (libomx-radeonsi, libomx-r600),
make sure to temporary move the unused one. By the end of the series
there will be only one library that will be used for all hardware -
r600, radeonsi and nouveau.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:13 +01:00
Emil Velikov
c35cf3400f st/omx: avoid using dynamic vid_(enc|dec)_base and avc_(name|role)
Strictly speaking we should not have done this in the
first place, as all of the above should be static across
the system.

Currently this may cause some minor issues, which will be
resolved in the following patches, by providing a single
library for the OMX api.

Cleanup a few unneeded strcpy cases while we're around.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio

If you have more than one omx library (libomx-radeonsi, libomx-r600),
make sure to temporary move the unused one. By the end of the series
there will be only one library that will be used for all hardware -
r600, radeonsi and nouveau.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:12 +01:00
Emil Velikov
9a9742f92c st/omx: provide constant number of components
The number of components and their names/roles should
be kept constant as all of that information cached.

Note: Make sure to rebuild the .omxregister file, by executing
   $ omxregister-bellagio.

Cc: Leo Liu <leo.liu@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-26 14:05:12 +01:00
Juha-Pekka Heikkila
2670d0f91d glx: Added missing null check in GetDrawableAttribute()
For GLX_BACK_BUFFER_AGE_EXT query added extra null check.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
0f7958aac2 mesa/main: In register_surface() verify gl_texture_object was found
Verify _mesa_lookup_texture() returned valid pointer before using it.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
cc5abf0460 mesa/main: Verify calloc return value in register_surface()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
568c545b7e glsl: Add missing null check in push_back()
Report memory error on realloc failure and don't leak any memory.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
088da3720f glsl: check _mesa_hash_table_create return value in link_uniform_blocks
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
db081b497e i965/fs: Check variable_storage return value in fs_visitor::visit
check variable_storage() found the requested fs_reg.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
78a89d6fa0 i965: Handle miptree creation failure in intel_alloc_texture_storage()
Check intel_miptree_create() return value before using it as
a pointer.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Juha-Pekka Heikkila
375943bc0a i965: Check calloc return value in gather_statistics_results()
Check calloc return value and report on error, also later skip
results handling if there was no memory to store results to.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-26 15:37:14 +03:00
Matt Turner
9a8acafa47 i965/vec4: Try constant propagate after copy propagate made progress.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:57 -07:00
Matt Turner
d5432e3f45 i965/vec4: Make try_copy_propagate() static.
Now that can_do_source_mods() isn't part of the visitor, this doesn't
need to be either.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:56 -07:00
Matt Turner
7526df70ea i965/vec4: Rename try_copy/constant_propagat{ion,e} to match the fs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:55 -07:00
Matt Turner
7192207de1 i965/vec4: Constant propagate into 2-src math instructions on Gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:54 -07:00
Matt Turner
038eb649b3 i965/fs: Constant propagate into 2-src math instructions on Gen8.
total instructions in shared programs: 1878133 -> 1876986 (-0.06%)
instructions in affected programs:     153007 -> 151860 (-0.75%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:53 -07:00
Matt Turner
aca4a951ea i965/fs: Make try_constant_propagate() static.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:51 -07:00
Matt Turner
46659d46a8 i965: Make can_do_source_mods() a member of the instruction classes.
Pretty nonsensical to have it as a method of the visitor just for access
to brw.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-25 13:00:48 -07:00
Chris Forbes
b4ef7c596b glsl: Treat an interface block specifier as a level of struct nesting
Fixes the piglit test:

   spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block-instanced.vert

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 07:58:32 +12:00
Chris Forbes
91b8ecbe1c glsl: Disallow primitive type layout qualifier on variables.
This only makes any sense on the GS input or output layout declaration,
nowhere else.

Fixes the piglit tests:

  * spec/glsl-1.50/compiler/incorrect-in-layout-qualifiers-with-variable-declarations.geom
  * spec/glsl-1.50/compiler/incorrect-out-layout-qualifiers-with-variable-declarations.geom
  * spec/glsl-1.50/compiler/layout-fs-no-output.frag
  * spec/glsl-1.50/compiler/layout-vs-no-input.vert
  * spec/glsl-1.50/compiler/layout-vs-no-output.vert

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 07:58:25 +12:00
Chris Forbes
d4703f9446 glsl: Relax combinations of layout qualifiers with other qualifiers.
Previously we disallowed any combination of layout with interpolation,
invariant, or precise qualifiers. There is very little spec guidance on
exactly which combinations should be allowed, but with ARB_sso it's
useful to allow these qualifiers with rendezvous-by-location.

Since it's unclear exactly where the layout qualifier should appear when
combined with other qualifiers, we will allow it anywhere before the
auxiliary storage qualifier.

This allows enough flexibility for all examples I've seen, while keeping
the auxiliary-storage-qualifier / storage-qualifier pair together (as
they are a single qualifier in the spec prior to
ARB_shading_language_420pack)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-26 07:58:01 +12:00
Ian Romanick
316dafa27d glsl: Don't convert reductions of ivec to a dot-product
Mesa has an optimization that converts expressions like "v.x + v.y + v.z
+ v.w" into dot(v, 1.0).  And therein lies the rub: the other operand to
the dot-product is always a float... even if the vector is an ivec or
uvec.  This results in an assertion failure in ir_builder.

If the base type of the operand is not float, don't try the
optimization.  Dot-product is not valid on integer data.

Fixes piglit vs-integer-reduction.shader_test and OpenGL ES conformance
test ES2-CTS.gtf.GL2Tests.glGetUniform.glGetUniform.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>
2014-06-25 10:56:32 -07:00
Carl Worth
4ccbbbdd74 docs: Import 10.2.2 release notes, add news item 2014-06-24 21:49:38 -07:00
Carl Worth
4076cbceaf docs: Import 10.1.6 release notes, add news item 2014-06-24 21:40:15 -07:00
Takashi Iwai
6b8b17153a llvmpipe: Fix zero-division in llvmpipe_texture_layout()
Fix the crash of "gnome-control-center info" invocation on QEMU where
zero height is passed at init.

(sroland: simplify logic by eliminating the div altogether, using 64bit mul.)

Fixes: https://bugzilla.novell.com/show_bug.cgi?id=879462

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-25 02:15:49 +02:00
Matt Turner
48f1143c64 i965/fs: Don't fix_math_operand() on Gen >= 8.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-24 11:51:54 -07:00
Matt Turner
b24e1cc604 i965/vec4: Don't fix_math_operand() on Gen >= 8.
The emit_math?_gen? functions serve to implement workarounds for the
math instruction, none of which exist on Gen8+.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-24 11:51:54 -07:00
Matt Turner
0e800dfe75 i965/vec4: Don't return void from a void function.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-24 11:51:54 -07:00
Bruno Jiménez
c997007f66 r600g/compute: Defer the creation of the temporary resource
For the first use of a buffer, we will only need the temporary
resource in the case that a user wants to write/map to this buffer.

But in the cases where the user creates a buffer to act as an
output of a kernel, then we were creating an unneeded resource,
because it will contain garbage, and would be copied to the pool,
and destroyed when promoting.

This patch avoids the creation and copies of resources in
this case.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-24 12:37:36 -04:00
Jan Vesely
fec2a08eae r600g/compute: Handle failures in compute_memory_pool_finalize
Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-06-24 12:37:30 -04:00
Jan Vesely
9575225e12 r600g/compute: Fix possible endless loop in compute_memory_pool allocations.
The important part is the change of the condition to <= 0. Otherwise the loop
gets stuck never actually growing the pool.

The change in the aux-need calculation guarantees max 2 iterations, and
avoids wasting memory in case a smaller item can't fit into a relatively larger
pool.

Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-06-24 12:36:55 -04:00
Jan Vesely
0c181cdc6c r600: Fix use after free in compute_memory_promote_item.
The dst pointer needs to be initialized after any calls to
 compute_memory_grow_pool, as the function might change the pool->vbo pointer.

This fixes crashes and assertion failures in two gegl tests.

Reviewed-by: Bruno Jiménez <brunojimen@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-06-24 12:04:54 -04:00
Ilia Mirkin
a59f2bb17b nouveau: dup fd before passing it to device
nouveau screens are reused for the same device node. However in the
scenario where we create screen 1, screen 2, and then delete screen 1,
the surrounding code might also close the original device node. To
protect against this, dup the fd and use the dup'd fd in the
nouveau_device. Also tell the nouveau_device that it is the owner of the
fd so that it will be closed on destruction.

Also make sure to free the nouveau_device in case of any failure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79823
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2014-06-24 09:30:25 -04:00
Fredrik Höglund
41d759d076 mesa: Don't use derived vertex state in api_arrayelt.c
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-24 07:15:30 +02:00
Ilia Mirkin
ea91d629df nvc0: allow VIEWPORT_INDEX and LAYER to be used as input semantics
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-23 19:23:16 -04:00
Ilia Mirkin
a91a556c81 mesa/st: handle gl_Layer input semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-06-23 19:23:16 -04:00
Tobias Klausmann
98a86f61a8 nv50/ir: allow gl_ViewportIndex to work on non-provoking vertices
Previously, if we had something like:

  gl_ViewportIndex = idx;
  for(int i = 0; i < gl_in.length(); i++) {
     gl_Position = gl_in[i].gl_Position;
     EmitVertex();
  }
  EndPrimitive();

The right viewport index would not be set on the primitive because the
last vertex is the provoking one. However blob drivers appear to move
the gl_ViewportIndex write into the for loop, allowing the application
to be ignorant of this detail.

While the application is technically wrong here, because the blob does
it and other drivers appear to implicitly work this way as well, we add
a buffer register that viewport index writes go into, which is then
exported before every EmitVertex() call.

This fixes the remaining piglit tests in ARB_viewport_array for nv50/nvc0.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-23 19:23:16 -04:00
Roland Scheidegger
604e54de78 draw: (trivial) fix clamping of viewport index
The old logic would let all negative values go through unclamped, with
potentially disastrous results (probably trying to fetch viewport values
from random memory locations). GL has undefined rendering for vp indices
outside valid range but that's a bit too undefined...
(The logic is now the same as in llvmpipe.)

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-24 00:37:52 +02:00
Kenneth Graunke
f6a99d1167 i965: Don't emit SURFACE_STATEs for gather workarounds on Broadwell.
As far as I can tell, Broadwell doesn't need any of the SURFACE_STATE
workarounds for textureGather() bugs, so there's no need to emit
a second set of identical copies.

To keep things simple, just point the gather surface index base to the
same place as the texture surface index base.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-23 13:29:39 -07:00
Emil Velikov
2442d3553f targets/(vdpau|xvmc): hardlink against the installed library
With commit 11e46a32ae and f9ebb1ea77 we resolved the symlink
generation required by the versioning of the library.
Although they incorrectly changed the way hardlinks are created by
linking to the ones from the build tree. If the device used for
building differs from the one set as destination linking will fail.

Reported-by: Andy Furniss <adf.lists@gmail.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-23 20:57:01 +01:00
Neil Roberts
5f11b10f2c i965: Allow the blorp blit between BGR and RGB
Previously the blorp blitter would only be used if the format is identical or
there is only a difference between whether there is an alpha component or not.
This patch makes it also allow the blorp blitter if the only difference is the
ordering of the RGB components (ie, RGB or BGR).

This is particularly useful since commit 61e264f4fc because Mesa now
prefers RGB ordering for textures but the window system buffers are still
created as BGR. That means that the blorp blitter won't be used for the
(probably) common case of blitting from a texture to the window system buffer.

This doesn't cause any regressions in the FBO piglit tests on Haswell. On
Sandybridge it causes the fbo-blit-stretch test to fail but that is only
because it was failing anyway before the above commit and that commit hid the
problem.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68365
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-23 19:59:40 +01:00
Ian Romanick
3552aa7c1c glsl: Silence many unused parameter warnings
In file included from ../../src/glsl/builtin_functions.cpp:61:0:
../../src/glsl/glsl_parser_extras.h:154:9: warning: unused parameter 'var' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-06-23 11:24:25 -07:00
Emil Velikov
f9ebb1ea77 targets/xvmc: correctly generate the symlinks
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-23 15:54:36 +01:00
Emil Velikov
11e46a32ae targets/vdpau: correctly generate the symlinks
Reported-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-23 15:53:26 +01:00
Ville Syrjälä
ca55a1aaa7 i915: Fix gen2 texblend setup
Fix an off by one in the texture unit walk during texblend
setup on gen2. This caused the last enabled texunit to be
skipped resulting in totally messed up texturing.

This is a regression introduced here:
 commit 1ad443ecdd
 Author: Eric Anholt <eric@anholt.net>
 Date:   Wed Apr 23 15:35:27 2014 -0700

    i915: Redo texture unit walking on i830.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-06-23 12:42:00 +03:00
Iago Toral Quiroga
c822db6a05 mesa: Make Geom.UsesEndPrimitive a bool instead of a GLboolean 2014-06-23 07:55:51 +02:00
Emil Velikov
df71b39f5c targets/r600/xvmc: convert to static/shared pipe-drivers
The r600 equivalent of previous commit.

v2: Correctly include the radeon winsys/radeon_common.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:07 +01:00
Emil Velikov
dc01ca44a7 targets/xvmc-nouveau: convert to static/shared pipe-drivers
Similar to vdpau targets, we're going to convert the individual
target libraries into a single one.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:04 +01:00
Emil Velikov
291d70210d targets/radeonsi/vdpau: convert to static/shared pipe-drivers
Similar to previous commits, this allows us to minimise some
of the duplication by compacting all vdpau targets into a
single library.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:01 +01:00
Emil Velikov
f85e7ce057 targets/r600/vdpau: convert to static/shared pipe-drivers
Similar to previous commit, this allows us to minimise some
of the duplication by compacting all vdpau targets into a
single library.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:05:58 +01:00
Emil Velikov
9df2c4956b targets/vdpau-nouveau: convert to static/shared pipe-drivers
Create a single library (for the vdpau api) thus reducing
the overall size of mesa. Current commit converts
vdpau-nouveau, with upcomming commits handling the rest.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Add SPLIT_TARGETS to guard the other VL targets.

Note: symlink handling is rather ugly and will need an
update to work with BSD and other non-linux platforms.

v2: Split the conversion into per-target basis.

Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:05:49 +01:00
Chris Forbes
8b2e0ddf8a Partially revert "glsl: Add builtin define for ARB_fragment_layer_viewport"
This partially reverts commit cc18b1ec21,
which dropped some unrelated code due to a fumbled rebase.
2014-06-22 23:54:21 +12:00
Rob Clark
1f3ca56b76 freedreno: use util_copy_framebuffer_state()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-22 07:28:17 -04:00
Rob Clark
c63450e829 freedreno/a3xx: WFI fixes/cleanup
Blob driver seems to need WFI in some cases after CP_EVENT_WRITE,
implying that this is asynchronous and should reset needs_wfi.
Also, CP_INVALIDATE_STATE seems to need WFI.  But CP_LOAD_STATE
does not.

The blob driver also puts WFIs before writing GRAS_CL_VPORT registers.
The latter may be a work-around, as these registers should be banked/
context registers.  I haven't yet found a lockup that this averts, but
I expect viewport to change infrequently so out of paranoia I will
keep these for now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-22 07:25:43 -04:00
Chris Forbes
b2c1f3a019 glsl: Add gl_Layer and gl_ViewportIndex builtins to fragment shader
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:19 +12:00
Chris Forbes
cc18b1ec21 glsl: Add builtin define for ARB_fragment_layer_viewport
The spec doesn't actually mention adding this, but this is the usual
pattern so I'm assuming it's a spec bug.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:17 +12:00
Chris Forbes
fcc9b4c15e glsl: Add extension plumbing for ARB_fragment_layer_viewport
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:15 +12:00
Chris Forbes
51c82bddef mesa: Add extension plumbing for ARB_fragment_layer_viewport
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:13 +12:00
Chris Forbes
22448c819d glapi: Add (empty) api section for ARB_fragment_layer_viewport
This extension is purely GLSL -- there are no new GL API elements.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:51:29 +12:00
Kenneth Graunke
a20994d616 i965: Save meta stencil blit programs in the context.
When the last context in a share group is destroyed, the hash table
containing all of the shader programs (ctx->Shared->ShaderObjects) is
destroyed, throwing away all of the shader programs.

Using a static variable to store program IDs ends up holding on to them
after this, so we think we still have a compiled program, when it
actually got destroyed.  _mesa_UseProgram then hits GL errors, since no
program by that ID exists.

Instead, store the program IDs in the context, so we know to recompile
if our context gets destroyed and the application creates another one.

Fixes es3conform tests when run without -minfmt (where it creates
separate contexts for testing each visual).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77865
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-21 10:47:47 -07:00
Emil Velikov
dfaf6116c9 scons: avoid building any piece of i915
Leftover from commit c21fca8bf2.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2014-06-21 16:43:10 +01:00
Aaron Watry
564821c917 gallivm: Fix build after LLVM commit 211259
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 19:49:18 -05:00
Daniel Manjarres
86bd2196b4 glx: Don't crash on swap event for a Window (non-GLXWindow)
Prior to GLX 1.3 there was the glxMakeCurrent() function that took a
single drawable handle. The Drawable could be either a bare XID for a
Window or an XID for a glxpixmap.

GLX 1.3 added glxMakeContextCurrent that takes 2 handles: one for
reading, one for writing. Nowadays the old glxMakeCurrent call is
implemented as a call to glxMakeContextCurrent with the single handle
duplicated.

Because of this it is allowed to use a plain-old Window ID as an
argument to glxMakeContextCurrent, although nobody really documents this
sort of thing. The manpage for the NEW call specifies the arguments as
GLXPixmaps, but the actual code accepts Window XIDs too, and handles
them correctly.

Similarly, the glxSelectEvents function can also take a bare Window XID.

The "piglit" tests all use GLXWindows and/or GLXPixmaps. You never
tested swap events with a bare Window XID. That is what my app was
doing.

The swap_events code worked with Window XIDs in mesa 7.x.y. The new code
added in versions 8, 9, and 10 assumes that all buffer swap events have
a GLXPixmap associated with them. Because of the historical quirks
above, this is not true. Swap events for bare Window XIDs do NOT have a
glxpixmap resulting in a segfault.

Any app that uses the old school glxMakeCurrent call with a Window XID
while trying to use swap_events will crash when the libs try to lookup
the nonexistent GLXPixmap associated with the incoming swap event.

I believe that the people who wrote the spec overlooked this, because
the "sbc" field comes from the OML_sync extension that is defined in
terms of glxpixmaps only.

v2 (idr): Formatting changes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54372
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-20 11:04:04 -07:00
Bruno Jiménez
2d2af4cd2c r600g/compute: Use gallium util functions for double lists
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:12 -04:00
Bruno Jiménez
257d697fb9 r600g/compute: Map only against intermediate buffers
With this we can assure that mapped buffers will never change
its position when relocating the pool.

This patch should finally solve the mapping bug.

v2: Use the new is_item_in_pool util function,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:08 -04:00
Bruno Jiménez
9b933b73a9 r600g/compute: Implement compute_memory_demote_item
This function will be used when we want to map an item
that it's already in the pool.

v2: Use temporary variables to avoid so many castings in functions,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:04 -04:00
Bruno Jiménez
0b8c29915b r600g/compute: Avoid problems when promoting items mapped for reading
Acording to the OpenCL spec, it is possible to have a buffer mapped
for reading and at read from it using commands or buffers.

With this we can keep the mapping (that exists against the
temporary item) and read with a kernel (from the item we have
just added to the pool) without problems.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:00 -04:00
Bruno Jiménez
3da1b17555 r600g/compute: Only move to the pool the buffers marked for promoting
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:57 -04:00
Bruno Jiménez
4d1e4429e6 r600g/compute: divide the item list in two
Now we will have a list with the items that are in the pool
(item_list) and the items that are outside it (unallocated_list)

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:54 -04:00
Bruno Jiménez
e3dfe3f7b2 r600g/compute: Add statuses to the compute_memory_items
These statuses will help track whether the items are mapped
or if they should be promoted to or demoted from the pool

v2: Use the new is_item_in_pool util function,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:50 -04:00
Bruno Jiménez
9e491eb5d7 r600g/compute: Add an util function to know if an item is in the pool
Every item that has been placed in the pool must have start_in_dw
different from -1.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:46 -04:00
Bruno Jiménez
0038402753 r600g/compute: Add an intermediate resource for OpenCL buffers
This patch changes completely the way buffers are added to the
compute_memory_pool. Before this, whenever we were going to
map a buffer or write to or read from it, it would get placed
into the pool. Now, every unallocated buffer has its own
r600_resource until it is allocated in the pool.

NOTE: This patch also increase the GPU memory usage at the moment
of putting every buffer in it's place. More or less, the memory
usage is ~2x(sum of every buffer size)

v2: Cleanup

v3: Use temporary variables to avoid so many castings in functions,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:28 -04:00
Iago Toral Quiroga
96a95f48ea mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-20 09:50:54 +02:00
Iago Toral Quiroga
ec712bf469 mesa: Init Geom.UsesEndPrimitive in shader programs.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-20 09:50:54 +02:00
Matt Turner
e974781301 glsl: Optimize (v.x + v.y) + (v.z + v.w) into dot(v, 1.0).
Cuts five instructions out of SynMark's Gl32VSInstancing benchmark.
2014-06-19 16:11:52 -07:00
Matt Turner
f043971097 glsl: Pass in options to do_algebraic().
Will be used in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-19 16:11:51 -07:00
Matt Turner
1d9f74eda7 glsl: Rebalance expression trees that are reduction operations.
The intention of this pass was to give us better instruction scheduling
opportunities, but it unexpectedly reduced some instruction counts as
well:

total instructions in shared programs: 1666639 -> 1666073 (-0.03%)
instructions in affected programs:     54612 -> 54046 (-1.04%)
(and trades 4 SIMD16 programs in SS3)
2014-06-19 16:11:51 -07:00
Emil Velikov
d300f3f51a automake: include the libdeps in the correct order
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80254
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 22:53:56 +01:00
Francisco Jerez
4a39e5073a clover: Calculate the serialized size of a module efficiently.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-19 20:17:19 +02:00
Francisco Jerez
ab023c27a3 clover: Optimize module serialization for vectors of fundamental types.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-19 20:17:08 +02:00
Roland Scheidegger
cad60420d5 gallivm: set mcpu when initializing llvm execution engine
Previously llvm detected cpu features automatically when the execution engine
was created (based on host cpu). This is no longer the case, which meant llvm
was then not able to emit some of the intrinsics we used as we didn't specify
any sse attributes (only on avx supporting systems this was not a problem since
despite at least some llvm versions enabling it anyway we always set this
manually). So, instead of trying to figure out which MAttrs to set just set
MCPU.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=77493.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2014-06-19 16:58:00 +02:00
Tom Stellard
4aa128a123 clover: Don't use llvm's global context
An LLVMContext should only be accessed by a single and using the global
context was causing crashes in multi-threaded environments.  Now we use
a separate context for each compile.

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

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 10:41:10 -04:00
Tom Stellard
0cc391f013 clover: Prevent Clang from printing number of errors and warnings to stderr.
https://bugs.freedesktop.org/show_bug.cgi?id=78581

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 10:18:26 -04:00
Michel Dänzer
93b6b1fa83 radeon/llvm: Adapt to AMDGPU.rsq intrinsic change in LLVM 3.5
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 09:58:03 -04:00
Emil Velikov
949beb0b84 configure: add HAVE_GALLIUM_STATIC_TARGETS
Will be used to control the linking mode of pipe-drivers
in gallium targets.

Keep this hardcoded to static, as the pipe-drivers bare
an unstable interface which we do not want to expose to
the normal user.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:46:19 +01:00
Emil Velikov
d22b39e4db targets: use GALLIUM_PIPE_LOADER_WINSYS_LIB_DEPS
Drop ~50 lines of buildsystem mayhem.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov
571b2467ca automake: introduce helper variable
- gallium_pipe_loader_winsys_libs

Will be used in upcomming commits to reduce duplication
in the build.

v2: Drop the megadriver/static_target variables.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov
86c30c6c5b target-helpers: add dd_configuration(), dd_driver_name()
Add a couple of helpers to be used by the dri targets when
built with static pipe-drivers. Both functions provide
functionality required by the dri state-tracker.

With this patch ilo, nouveau and r300 gain support for
throttle dri configuration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov
573b55e302 target-helpers: add dd_create_screen() helper
Will be used by gallium targets that statically link the
pipe-drivers in the final library. Provides identical
functionality to device_descriptor.create_screan.

v2:
 - Don't sw_screen_wrap the i915/svga screen.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:39:50 +01:00
Emil Velikov
1e414faa5e target-helpers: add a note about debug wrappers
If memory serves me right, at least one debug wrapper does
not return the base screen on failure.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:15 +01:00
Emil Velikov
665a4d9d9b targets/pipe-loader: add driver specific drm_configuration
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov
36ff20027c pipe-loader: add pipe_loader_ops::configuration()
Required for the dri state-tracker. Will be used to retrieve
driver specific configuration parameters:
 - share_fd (dmabuf) capability
 - throttle

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov
7f00611d78 pipe-loader: note that we leak pipe_loader_drm_device->base->driver_name
The string is malloc'd (strdup) in loader_get_driver_for_fd().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov
6984e8db91 automake: stop building i915-sw and drop explicit linking to softpipe
Unused and possibly broken. Will be completely removed in
upcomming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Ilia Mirkin
25182e249e nv30: hack to avoid errors on unexpected color/zeta combinations
This is just a hack, it should be possible to create a temporary zeta
surface and render to that instead. However that's more complicated and
this avoids the render being entirely broken and errors being reported
by the card.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
e1fe1435b1 nv30: tidy screen caps, add missing ones
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
c092c46b27 nv30: avoid dangling references to deleted contexts
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
5af80f6268 nv30: plug some memory leaks on screen destroy and shader compile
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
22e9551af0 nv50: organize screen caps
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
b03be4b0ee nvc0: organize screen caps
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin
7e7097a4f4 nvc0: remove vport_int hack and instead use the usual state validation
Commit ad4dc772 fixed an issue with the viewport not being restored
correctly. However it's rather hackish and confusing. Instead just mark
the viewport dirty and let the viewport validation take care of it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
David Heidelberger
8658fe3e4c r300g: don't advertize PIPE_FORMAT_B10G10R10X2_UNORM on < r500
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-19 01:43:09 +02:00
Marek Olšák
57f3da997a radeonsi: implement ARB_texture_query_lod
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 00:18:17 +02:00
Marek Olšák
6a2b38381e radeonsi: pass ARB_conservative_depth parameters to the hardware
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 00:17:36 +02:00
Marek Olšák
1df7199fc9 gallium: implement ARB_texture_query_levels
The extension is always supported if GLSL 1.30 is supported.

Softpipe and llvmpipe support is also added (trivial).
Radeon and nouveau support is already done.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:36 +02:00
Marek Olšák
552c70a837 st/mesa: set sampler_view::last_level correctly
It was set to pipe_resource::last_level and _MaxLevel was embedded in max_lod,
that's why it worked for ordinary texturing. However, min_lod doesn't have
any effect on texelFetch and textureQueryLevels, so we must still set
last_level correctly.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:09 +02:00
Dave Airlie
c530282bbc st/mesa: handle array textures in st_texture_image_copy
Marek: also handle cube arrays

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:09 +02:00
Marek Olšák
6818e117ce radeonsi: cosmetic changes in si_shader.c
reviewed by Michel Dänzer
2014-06-19 00:17:09 +02:00
Marek Olšák
c7b5a5c4a3 radeonsi: implement ARB_texture_gather and Gather functions from GLSL 4.00
All ARB_texture_gather and gather-related ARB_gpu_shader5 piglit tests pass.

reviewed by Michel Dänzer
2014-06-19 00:17:09 +02:00
Marek Olšák
0df3551bf4 st/mesa: fix geometry shader max texture limit in state validation
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-19 00:14:00 +02:00
Marek Olšák
bb867e2f2f r600g: fix the max vertex shader input limit 2014-06-19 00:14:00 +02:00
Ian Romanick
cc219d1d65 meta: Respect the driver's maximum number of draw buffers
Commit c1c1cf5f9 added infrastructure for saving and restoring draw
buffer state.  However, it universially used MAX_DRAW_BUFFERS, but many
drivers support far fewer than that at limit.  For example, the radeon
and i915 drivers only support 1.  Using MAX_DRAW_BUFFERS causes meta to
generate GL errors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80115
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org> [on Broadwell]
Tested-by: jpsinthemix@verizon.net
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-18 14:45:25 -07:00
Roland Scheidegger
56335b4441 gallivm: fix SCALED -> NORM conversions
Such conversions (which are most likely rather pointless in practice) were
resulting in shifts with negative shift counts and shifts with counts the same
as the bit width. This was always undefined in llvm, the code generated was
rather horrendous but happened to work.
So make sure such shifts are filtered out and replaced with something that
works (the generated code is still just as horrendous as before).

This fixes lp_test_format, https://bugs.freedesktop.org/show_bug.cgi?id=73846.

v2: prettify by using build context shift helpers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-18 19:52:57 +02:00
Kristian Høgsberg
7928b946ad mesa: Remove glClear optimization based on drawable size
A drawable size of 0x0 means that we don't have buffers for a drawable yet,
not that we have a zero-sized buffer.  Core mesa shouldn't be optimizing out
drawing based on buffer size, since the draw call could be what triggers
the driver to go and get buffers.  As discussed in the referenced bug report,
the optimization was added as part of a scatter-shot attempt to fix a
different problem.  There's no other example in mesa core of using the
buffer size in this way.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74005
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-18 10:15:03 -07:00
Juha-Pekka Heikkila
fe5224b16a mesa: In emit_texenv() type mismatch was forced with typecast
Type mismatch caused random memory to be copied when casted
memory area was smaller than expected type.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-18 16:15:51 +03:00
Grigori Goronzy
6cd30f5d73 radeon/uvd: disable VC-1 simple/main on UVD 2.x
It's about as broken as on later UVD revisions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66452
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:58:52 +02:00
Grigori Goronzy
cf05f9bf01 radeonsi: add sampling of 4:2:2 subsampled textures
This makes 4:2:2 video surfaces work in VDPAU.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-06-18 13:58:37 +02:00
Grigori Goronzy
f5dafc156a util/u_format: move utility function from r600g
We need this for radeonsi, and it might be useful for other drivers,
too.
2014-06-18 13:58:19 +02:00
Leo Liu
700100d94b radeon/vce: set number of cpbs based on level
v2: add error check for cpb size 0

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:27 +02:00
Leo Liu
0796483282 radeon/vce: implement h264 level support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:23 +02:00
Leo Liu
e2db7c10d6 st/omx/enc: implement h264 level support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:20 +02:00
Leo Liu
4fca06a902 vl: add level interface
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:53:17 +02:00
Leo Liu
cb9fcc5c44 st/st/omx: fix switch-case indentation in vid_enc.c
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:52:54 +02:00
Jon TURNEY
83821ece79 glx: Add an error message when a direct renderer's createScreen() routine fails
because no matching fbConfigs or visuals could be found.

Nearly all the error cases in *createScreen() issue an error message to diagnose
the failure to initialize before branching to handle_error.  The few remaining
error cases which don't should probably do the same.

(At the moment, it seems this can be triggered in drisw with an X server which
reports definite values for MAX_PBUFFFER_(WIDTH|HEIGHT|SIZE), because those
attributes are checked for an exact match against 0.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-18 09:55:45 +01:00
Chia-I Wu
88b887faa9 i965/vec4: unit test for copy propagation and writemask
This unit test demonstrates a subtle bug fixed by
4ddf51db6a.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-18 13:43:05 +08:00
Matt Turner
6c2d815d64 i965/vec4/gs: Silence warning about unused 'success' in release build.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:41 -07:00
Matt Turner
17f2dd7274 i965/disasm: Mark three_source_reg_encoding[] static.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:39 -07:00
Matt Turner
9f7b5fa2c8 i965/blorp: Remove unused 'brw' member.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:38 -07:00
Matt Turner
73ab06f9c5 i965/blorp: Mark branch unreachable to silence uninitialized var warning.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:36 -07:00
Matt Turner
f3aecefa99 i965: Silence warning about unused brw in release builds.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:34 -07:00
Matt Turner
836f4299e8 i965: Mark backend_instruction and bblock_t as structs.
They have to be marked as structs for C code elsewhere. bblock_t is
already defined as a struct, and all of backend_instruction's fields are
public anyway.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:33 -07:00
Matt Turner
83649587c6 i965: Use standard SSE intrinsics instead of gcc built-ins.
Let's this file compile with clang.

Reviewed-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:20 -07:00
Matt Turner
52a4065493 mesa: Remove unused functions from perfomance query code.
Perhaps useful for debugging? Never used otherwise. Added by commit
8cf5bdad.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:18 -07:00
Matt Turner
7f3f9b1a68 mesa: Remove unused extra_EXT_texture_integer.
Unused since commit b6475f94.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:17 -07:00
Matt Turner
9f4e776433 mesa: Mark default case unreachable to silence warning.
Warned about 'coord' being undefined in the default case, which is
unreachable.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:14 -07:00
Matt Turner
6ac5adce63 egl: Remove unused variable dri_driver_path.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:12 -07:00
Matt Turner
d2458a4710 swrast: Remove unused solve_plane_recip().
Unused since commit 9e8a961d.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:11 -07:00
Matt Turner
db650d9ec1 glsl: Remove 'struct' from ir_variable declaration.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-17 10:18:06 -07:00
Matt Turner
ebc7524503 Revert "i965: Add 'wait' instruction support"
This reverts commit 20be3ff576.

No evidence of ever being used.
2014-06-17 10:16:23 -07:00
Matt Turner
fab92fa1cb i965/fs: Optimize SEL with the same sources into a MOV.
instructions in affected programs:     474 -> 462 (-2.53%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-17 09:40:31 -07:00
Matt Turner
35bc02dee8 i965/fs: Perform CSE on texture operations.
Helps Unigine Tropics and some (old) gstreamer shaders in shader-db.

instructions in affected programs:     792 -> 744 (-6.06%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-17 09:40:31 -07:00
Matt Turner
18372a7100 i965/fs: Copy propagate from load_payload.
But only into non-load_payload instructions. Otherwise we would prevent
register coalescing from combining identical payloads.
2014-06-17 09:40:30 -07:00
Matt Turner
31ae9c25ff i965/fs: Perform CSE on load_payload instructions if it's not a copy.
Since CSE creates instructions, if we let CSE generate things register
coalescing can't remove, bad things will happen. Only let CSE combine
non-copy load_payloads.

E.g., allow CSE to handle this

   load_payload vgrf4+0, vgrf5, vgrf6

but not this

   load_payload vgrf4+0, vgrf5+0, vgrf5+1
2014-06-17 09:40:30 -07:00
Matt Turner
8f4e324be2 i965/fs: Support register coalescing on LOAD_PAYLOAD operands. 2014-06-17 09:40:07 -07:00
Matt Turner
4b7bca8979 i965/fs: Emit load_payload instead of multiple MOVs for large VGRFs. 2014-06-17 09:40:07 -07:00
Matt Turner
68b7b03429 i965/fs: Only consider real sources when comparing instructions. 2014-06-17 09:38:06 -07:00
Matt Turner
856860db4a i965/fs: Apply cube map array fixup and restore the payload.
So that we don't have partial writes to a large VGRF. Will be cleaned up
by register coalescing.
2014-06-17 09:38:06 -07:00
Matt Turner
15b6ab04e2 i965/fs: Use LOAD_PAYLOAD in emit_texture_gen7(). 2014-06-17 09:38:06 -07:00
Matt Turner
138905d728 i965/fs: Lower LOAD_PAYLOAD and clean up.
Clean up with with register_coalesce()/dead_code_eliminate().
2014-06-17 09:38:05 -07:00
Matt Turner
b996216384 i965/fs: Add SHADER_OPCODE_LOAD_PAYLOAD.
Will be used to simplify the handling of large virtual GRFs in SSA form.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-06-17 09:38:05 -07:00
Tapani Pälli
39cdf1621e glsl: type check between switch init-expression and case
Patch adds a type check between switch init-expression and case label
and performs a implicit signed->unsigned type conversion when possible.

v2: add GLSL spec reference, do implicit conversion if possible (Matt)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79724
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-17 08:13:28 +03:00
Tobias Klausmann
5357c14da4 nv50/ir: Remove NV50_SEMANTIC_VIEWPORTINDEX
Use TGSI_SEMANTIC_VIEWPORT_INDEX for the last consumer.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-16 23:08:32 -04:00
Tobias Klausmann
cd01e1667a docs: update GL3.txt, relnotes: mark GL_ARB_viewport_array as done for nvc0
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-16 23:08:32 -04:00
Tobias Klausmann
a2cb3a4a4f nvc0: implement multiple viewports/scissors, enable ARB_viewport_array
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
[imirkin: mark things dirty on ctx switch, 3d blit]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-16 23:08:03 -04:00
Ilia Mirkin
af05270ccf nv50: make sure to mark first scissor dirty after blit
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-16 23:08:03 -04:00
Kenneth Graunke
49659ad90c i965: Use 8x4 aligned rectangles for HiZ operations on Broadwell.
Like on Haswell, we need to use 8x4 aligned rectangle primitives for
hierarchical depth buffer resolves and depth clears.  See the comments
in brw_blorp.cpp's brw_hiz_op_params() constructor.  (The Broadwell
documentation confirms that this is still necessary.)

This patch makes the Broadwell code follow the same behavior as Chad and
Jordan's Gen7 BLORP code.  Based on a patch by Topi Pohjolainen.

This fixes es3conform's framebuffer_blit_functionality_scissor_blit
test, with no Piglit regressions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-16 17:23:21 -07:00
Kenneth Graunke
fa35b272a0 i965: Make INTEL_DEBUG=mip print out whether HiZ is enabled.
We only enable HiZ for miplevels which are aligned on 8x4 blocks.  When
debugging HiZ failures, it's useful to know whether a particular
miplevel is using HiZ or not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-16 17:22:29 -07:00
Jordan Justen
380dd3be02 glsl/cs: Fix local_size_y and local_size_z
flags.q.local_size has 3 bits. One each for x, y and z.

Fixes piglit's:
* spec/ARB_compute_shader/linker/mismatched_local_work_sizes
* spec/ARB_compute_shader/compiler/default_local_size.comp
* spec/ARB_compute_shader/compiler/work_group_size_too_large
* spec/ARB_compute_shader/compiler/gl_WorkGroupSize_matches_layout.comp

This was regressed in 738c9c3c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-16 09:54:52 -07:00
Jordan Justen
539cd92476 main/extensions: Only parse MESA_EXTENSION_OVERRIDE once
Previously, we would parse MESA_EXTENSION_OVERRIDE each time a context
was created. Now we will save the results of that parsing and use it
during context initialization.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
ac3e2efeff main/extensions: Build list of extensions that can't be disabled
This will allow us to utilize the early MESA_EXTENSION_OVERRIDE
parsing at the later extension string initialization step.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
863f57ee1b main/extensions: Create extra extensions override string
This will allow us to utilize the early MESA_EXTENSION_OVERRIDE
parsing at the later extension string initialization step.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
10e03b4401 i965/cs: Use override structure rather than separate env var
In 25268b93, we added a new environment variable
(INTEL_COMPUTE_SHADER) to allow some constant values to be upgraded
for the ARB_compute_shader extension.

Now, we can look to see if the extension was enabled via the
MESA_EXTENSION_OVERRIDE environment variable.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
f5ca8c1972 main/extensions: Add early extension override structures
During the early one_time_init phase of context creation, we
initialize two global gl_extensions structures.

We read the MESA_EXTENSION_OVERRIDE environment variable, and store
positive and negative overrides in two structures:
* struct gl_extensions _mesa_extension_override_enables
* struct gl_extensions _mesa_extension_override_disables

These are filled before the driver initializes extensions and
constants, therefore the driver can make adjustments based on the
desired overrides.

This can be useful during development of a new extension where the
extension is only partially ready. The driver can't actually advertise
support for the extension, but if it sees that the override is set for
the extension, then it can expose more supported parts of the
extension, such as upgrading context constants.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
8be64fb570 main/extensions: Create a context-less set_extensions function
We will add new gl_extensions structures that capture the environment
variable extension overrides and are available early in context
creation.

This will allow a driver to take actions during its initialization
based on the extension overrides.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Jordan Justen
f2280eeba5 main/extensions: Don't advertise unknown extensions overrides with (-)
Previously setting:
MESA_EXTENSION_OVERRIDE=-GL_MESA_ham_sandwich

Would cause Mesa to advertise support for the GL_MESA_ham_sandwich
extension, even though the override specifically asked for it to be
disabled.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-06-16 09:54:52 -07:00
Marek Olšák
41060a6095 radeonsi: fixup sizes of shader resource and sampler arrays
This was wrong for a very long time. I wonder if the array size has any
effect on anything.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-16 16:55:57 +02:00
José Fonseca
7889469663 scons: Link libGL.so against xcb-dri2.
Fixing undefined xcb_dri2_* symbols.

Trivial.
2014-06-16 11:24:21 +01:00
Michel Dänzer
d6fd8a9771 r600g/radeonsi: Remove default case from PIPE_COMPUTE_CAP_* switch
This way, the compiler warns about unhandled caps.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-06-16 15:56:29 +09:00
Tapani Pälli
5cb8fdb397 docs: update ARB_explicit_uniform_location status
+ modify release notes for 10.3

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
f3750a2c86 Enable GL_ARB_explicit_uniform_location in the drivers.
v2: enable also for i915 (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
e8fb8b1bb3 glsl: parser changes for GL_ARB_explicit_uniform_location
Patch adds a preprocessor define for the extension and stores explicit
location data for uniforms during AST->HIR conversion. It also sets
layout token to be available when having the extension in place.

v2: change parser check to require GLSL 330 or enabling
    GL_ARB_explicit_attrib_location (Ian)
v3: fix the check and comment in AST->HIR (Petri)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
8381f0f0c3 glsl: add enable bit for ARB_explicit_uniform_location
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
73f7c8636d mesa: support inactive uniforms in glUniform* functions
Support inactive uniforms that have explicit location set in
glUniform* functions.

v2: remove unnecessary extension check, use new define (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
dd2a6519b9 glsl/linker: assign explicit uniform locations
Patch refactors the existing uniform processing so explicit locations
are taken in to account during variable processing. These locations
are temporarily stored in gl_uniform_storage before actual locations
are set.

UNMAPPED_UNIFORM_LOC marks unset location so that we can use 0 as a
valid explicit location.

When locations are set, UniformRemapTable is first populated with
uniforms that have explicit location set (inactive and active ones),
rest are put after explicit location slots.

v2: introduce define for locations that have not been set yet (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
eca9d16048 glsl/linker: initialize explicit uniform locations
Patch initializes the UniformRemapTable for explicit locations. This
needs to happen before optimizations to make sure all inactive uniforms
get their explicit locations correctly.

v2: fix initialization bug, introduce define for inactive uniforms (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
dadc3d04f0 glsl: add glsl_type::uniform_locations() helper function
This function calculates the number of unique values from
glGetUniformLocation for the elements of the type.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
bfe42ddd99 mesa: add new enum MAX_UNIFORM_LOCATIONS
Patch adds new implementation dependent value required by the
GL_ARB_explicit_uniform_location extension. Default value for user
assignable locations is calculated as sum of MaxUniformComponents
for each stage.

v2: fix descriptor in get_hash_params.py (Petri)
v3: simpler formula for calculating initial value (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
d1a64aad16 mesa: add enable bit for ARB_explicit_uniform_location
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Tapani Pälli
bd5f1202fb glapi: add GL_ARB_explicit_uniform_location
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-16 06:49:59 +03:00
Kenneth Graunke
5d8e246ac8 i965/vec4: Use the sampler for pull constant loads on Broadwell.
We've used the LD sampler message for pull constant loads on earlier
hardware for some time, and also were already using it for the FS on
Broadwell.  This patch makes us use it for Broadwell VS/GS as well.

I believe that when I wrote this code in 2012, we still used the data
port in some cases, and I somehow neglected to convert it while
rebasing.

Improves performance in GLBenchmark 2.7 Egypt by 416.978% +/- 2.25821%
(n = 17).  Many other applications should benefit similarly: this speeds
up uniform array access in the VS, which is commonly used for skinning
shaders, among other things.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Ben Widawsky <ben@bwidawsk.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
847abaccc0 i965: Add missing newlines to a few perf_debug messages.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
d053a05ef3 i965: Drop Broadwell perf_debugs about missing MOCS that aren't missing.
I actually added MOCS support for these things, but forgot to delete the
corresponding perf_debug() warnings.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
7f256c1c70 i965: Add missing MOCS setup for 3DSTATE_INDEX_BUFFER on Broadwell.
Somehow I missed this when adding all of the other MOCS values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-15 16:51:05 -07:00
Kenneth Graunke
d0575d98fc i965/vec4: Fix dead code elimination for VGRFs of size > 1.
When faced with code such as:

    mov vgrf31.0:UD, 960D
    mov vgrf31.1:UD, vgrf30.xxxx:UD

The dead code eliminator didn't consider reg_offsets, so it decided that
the second instruction was writing was writing to the same register as
the first one, and eliminated the first one.  But they're actually
different registers.

This fixes INTEL_DEBUG=shader_time for vertex shaders.  In the above
code, vgrf31.0 represents the offset into the shader_time buffer where
the data should be written, and vgrf31.1 represents the actual time
data.  With a completely undefined offset, results were...unexpected.

I think this is probably one of the few cases (maybe only case) where we
generate multiple MOVs to a large VGRF.  Normally, we just use them as
texturing results; the other SEND-from-GRF uses a size 1 VGRF.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79029
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-06-15 16:51:05 -07:00
Kenneth Graunke
d6a7a2606e i965: Add SHADER_OPCODE_SHADER_TIME_ADD to dump_instructions() decode.
"shader_time_add" is a lot more informative than "op152".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-15 16:51:04 -07:00
Vinson Lee
4133c7126c glsl: Fix clang mismatched-tags warnings with glsl_type.
Fix clang mismatched-tags warnings introduced with commit
4f5445a45d.

./glsl_symbol_table.h:37:1: warning: class 'glsl_type' was previously declared as a struct [-Wmismatched-tags]
class glsl_type;
^
./glsl_types.h:86:8: note: previous use is here
struct glsl_type {
       ^
./glsl_symbol_table.h:37:1: note: did you mean struct here?
class glsl_type;
^~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-15 13:34:18 -07:00
Vinson Lee
32c5544860 mesa/drivers: Fix clang constant-logical-operand warnings.
This patch fixes several clang constant-logical-operand warnings such as
the following.

../../../../../src/mesa/tnl_dd/t_dd_tritmp.h:130:32: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
   if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL)
                               ^  ~~~~~~~~~~~
../../../../../src/mesa/tnl_dd/t_dd_tritmp.h:130:32: note: use '|' for a bitwise operation
   if (DO_TWOSIDE || DO_OFFSET || DO_UNFILLED || DO_TWOSTENCIL)
                               ^~
                               |

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-14 23:21:43 -07:00
Chris Forbes
4191cc4861 glsl: Correct more typos
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-15 12:55:16 +12:00
Tom Stellard
ac26a562ed radeon/compute: Always report at least 1 compute unit
Some apps will abort if they detect 0 compute units.  This fixes
crashes in some OpenCV tests.
2014-06-13 21:32:34 -04:00
Jason Ekstrand
ffe609cc69 meta_blit: properly compute texture width for the CopyTexSubImage fallback
Cc: "10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-13 13:09:21 -07:00
Rob Clark
06e9536e5f freedreno/a3xx: vtx formats
Add support for more vertex buffer formats.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Rob Clark
ba6a490bbc freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Rob Clark
3394900dd3 freedreno: try for more squarish tile dimensions
Worth about ~0.5fps in xonotic, for example.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Rob Clark
6aeeb706d2 freedreno: fix for null textures
Some apps seem to give us a null sampler/view for texture slots which
come before the last used texture slot.  In particular 0ad triggers
this.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-13 15:20:34 -04:00
Roland Scheidegger
2ea8e2fccf llvmpipe: increase number of queries which can be binned simultaneously to 64
Gallium (but not OpenGL) does allow nesting of queries, but there's no
limit specified (d3d10 has no limit neither). Nevertheless, for practical
purposes we need some limit in llvmpipe, otherwise we'd need more complex
handling of queries as we need to keep track of all binned queries (this
only affects queries which gather data past setup). A limit of 16 is too
small though, while 64 would suffice.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-13 20:08:39 +02:00
Bruno Jiménez
03aab2af16 radeon/compute: Implement PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS
v2:
    Add RADEON_INFO_ACTIVE_CU_COUNT as a define, as suggested by
    Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-13 10:59:30 -04:00
Neil Roberts
b8d15ca5e8 Remove _mesa_is_type_integer and _mesa_is_enum_format_or_type_integer
The comment for _mesa_is_type_integer is confusing because it says that it
returns whether the type is an “integer (non-normalized)” format. I don't
think it makes sense to say whether a type is normalized or not because it
depends on what format it is used with. For example, GL_RGBA+GL_UNSIGNED_BYTE
is normalized but GL_RGBA_INTEGER+GL_UNSIGNED_BYTE isn't. If the normalized
comment is just a mistake then it still doesn't make much sense because it is
missing the packed-pixel types such as GL_UNSIGNED_INT_5_6_5. If those were
added then it effectively just returns type != GL_FLOAT.

That function was only used in _mesa_is_enum_format_or_type_integer. This
function effectively checks whether the format is non-normalized or the type
is an integer. I can't think of any situation where that check would make
sense.

As far as I can tell neither of these functions have ever been used anywhere
so we should just remove them to avoid confusion.

These functions were added in 9ad8f431b2.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-13 15:54:46 +01:00
Bruno Jiménez
2a0dffa0c9 clover: query driver for the max number of compute units
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-06-12 19:09:32 -04:00
Bruno Jiménez
8f4d37889c gallium: Add PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-06-12 19:08:06 -04:00
Bruno Jiménez
4f70d83089 r600g/compute: solve a bug introduced by 2e01b8b440
That commit made possible that the items could be one just
after the other when their size was a multiple of ITEM_ALIGNMENT.
But compute_memory_prealloc_chunk still looked to leave a gap
between items. Resulting in that we got an infinite loop when
trying to add an item which would left no space between itself and
the next item.

Fixes piglit test: cl-custom-r600-create-release-buffer-bug
And the test for alignment I have just sent:
http://lists.freedesktop.org/archives/piglit/2014-June/011135.html

Sorry about this.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-12 15:52:08 -04:00
Niels Ole Salscheider
607bc89970 egl/gallium: Set defines for supported APIs when using automake
This fixes automake builds which are broken since
b52a530ce2.

v2: This patch also adds the FEATURE_* defines back to targets/egl-static for
Android and Scons that have been removed in the mentioned commit.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79885
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-12 18:07:20 +01:00
Emil Velikov
816d392b58 configure: correctly autodetect xvmc/vdpau/omx
Commit e62b7d38a1 (configure: autodetect video state-trackers
when non swrast driver is present) added a check that caused
the autodetection to be omitted when we have the swrast gallium
driver. Whereas it should have skipped the VL targets when only
swrast was selected.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79907
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-12 18:07:20 +01:00
Courtney Goeltzenleuchter
0406f59eeb mesa: glx: Reduce error log level
The code that parses LIBGL_DRIVERS_PATH was printing an
error for every attempted dlopen. It's not an error to
have to check multiple items in the path, only an error if
no suitable library is found. Reduced the load error to
a warning to match behavior of dynamic linker.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-12 10:19:00 -06:00
Brian Paul
33f273778b cso: fix stream-out clean up in cso_release_all()
Use the has_streamout flag as we do elsewhere to check if we need
to call pipe->set_stream_output_targets().  The driver might implement
the set_stream_output_targets() function, but not for all hardware
configurations.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-12 13:23:56 +01:00
Neil Roberts
765efeef88 i965: Set the fast clear color value for texture surfaces
When a multisampled texture is used for sampling the fast clear color value
needs to be programmed into the surface state. This was being left as all
zeroes so if the surface was cleared to a value other than black then it
wouldn't work properly. This doesn't matter for single-sample textures because
in that case the MCS buffer is resolved before it is used as a texture source.

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

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-12 11:24:04 +01:00
Chris Forbes
2c79aa8272 glsl: Fix typo in comment.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-12 21:19:24 +12:00
Kenneth Graunke
3e71258023 i965: Fix disassembly of BLORP clear programs.
Too many levels of indirection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-12 00:56:08 -07:00
Kenneth Graunke
b207caf9bc i965/fs: Move FB write default state mashing in a level.
We only need to alter the default state if we're emitting MOVs for
header related fields.  So, we can simply move the push/pop of state in
to the if (header_present) block, bypassing it in the common case.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79903
2014-06-12 00:56:08 -07:00
Kenneth Graunke
a2ad771671 i965: Fix Haswell discard regressions since Gen4-5 line AA fix.
In commit dc2d3a7f5c, Iago accidentally
moved fire_fb_write() above the brw_pop_insn_state(), which caused the
SEND to lose its predication and change from WE_normal to WE_all.
Haswell uses predicated SENDs for discards, so this broke Piglit's
tests for discards.

We want the Gen4-5 MOV to be uncompressed, unpredicated, and unmasked,
but the actual FB write itself should respect those.  So, pop state
first, and force it again around the single MOV.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79903
2014-06-12 00:56:08 -07:00
Michel Dänzer
be5e5b6c93 gbm: Remove 64x64 restriction from GBM_BO_USE_CURSOR
GBM_BO_USE_CURSOR_64X64 is kept so that existing users of GBM continue to
build, but it no longer rejects widths or heights other than 64.

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

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-12 16:13:39 +09:00
Matt Turner
2c8520c03d i965: Use brw->gen in some generation checks.
Will simplify the automated conversion if we want to allow compiling the
driver for a single generation.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-06-11 20:57:10 -07:00
Matt Turner
f51a7e00da i965/fs: Clean up tabs in brw_fs_cse.cpp.
I'm adding vec4 CSE, and I want to diff the files.
2014-06-11 20:09:22 -07:00
Matt Turner
4bb9d16fd3 configure.ac: Simplify DUSE_EXTERNAL_DXTN_LIB logic.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-11 20:09:22 -07:00
Matt Turner
026d1fe986 configure.ac: Alphabetize AC_CONFIG_FILES.
This isn't supposed to be difficult.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-11 20:09:22 -07:00
Matt Turner
180e60df65 configure.ac: Remove single quotes to fix syntax highlighting.
Please stop adding them.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-11 20:09:22 -07:00
Robert Bragg
c6f118484c meta: save and restore swizzle for _GenerateMipmap
This makes sure to use a no-op swizzle while iteratively rendering each
level of a mipmap otherwise we may loose components and effectively
apply the swizzle twice by the time these levels are sampled.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-11 21:38:01 +01:00
Ian Romanick
63117ac329 i965/vec4: Emit smarter code for b2f of a comparison
Previously we would emit the comparison, emit an AND to mask off extra
bits from the comparison result, then convert the result to float.  Now,
do the comparison, then use a cleverly constructed SEL to pick either
0.0f or 1.0f.

No piglit regressions on Ivybridge.

total instructions in shared programs: 1642311 -> 1639449 (-0.17%)
instructions in affected programs:     136533 -> 133671 (-2.10%)
GAINED:                                0
LOST:                                  0

Programs that are affected appear to save between 1 and 5 instuctions
(just by skimming the output from shader-db report.py.

v2: s/b2i/b2f/ in commit subject (noticed by Chris Forbes).  Remove
extraneous fix_3src_operand (suggested by Matt).  The latter change
required swapping the order of the operands and using predicate_inverse.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-11 12:00:24 -07:00
Ian Romanick
be0452b049 i965/vec4: Silence a couple unused parameter warnings
brw_vec4_visitor.cpp:2717:1: warning: unused parameter 'ir' [-Wunused-parameter]
brw_vec4_visitor.cpp:2723:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-11 12:00:20 -07:00
Ian Romanick
014d45f137 glsl: Store gl_uniform_driver_storage::format as the actual type
And delete the incorrect comment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2014-06-11 11:26:05 -07:00
Dave Airlie
0d89448662 softpipe: fix pt->resource assert placement
oops meant to move this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 14:03:11 +10:00
Dave Airlie
9bc12ef241 softpipe: enable AMD_vertex_shader_layer.
This passes tests now on softpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:21 +10:00
Dave Airlie
8dede2fa6c softpipe: enable GLSL 3.30 support.
This enables GL3.3 on softpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:17 +10:00
Dave Airlie
c82d227edd softpipe: bump the softpipe geometry limits
This just aligns the limits with llvmpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:08 +10:00
Dave Airlie
7ea04f089b tgsi_exec: use defines for max inputs/outputs
This fixes the limits for GL 3.2, and subsequently fixes
some segfaults in some varying packing tests and max varying tests
after the limits bumped.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:21:04 +10:00
Dave Airlie
740d5bed77 softpipe: add layered rendering support.
This adds support for GL 3.2 layered rendering to softpipe.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:20:30 +10:00
Dave Airlie
dc8fc39ada softpipe: add layering to the surface tile cache.
This adds the layer info to the tile cache.

This changes clear_flags to be dynamically allocated as
MAX_LAYERS seems like a too big step.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:20:30 +10:00
Dave Airlie
5a57248541 softpipe: add depth clamping support. (v2)
This passes the piglit depth clamp tests.

this is required for GL 3.2.

v2: move min/max up one level, could go further, thanks
to Roland for suggestion.

v1: Reviewed-by: Brian Paul <brianp@vmware.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:20:07 +10:00
Dave Airlie
a4670de0a0 tgsi/gs: bound max output vertices in shader
This limits the number of emitted vertices to the shaders max output
vertices, and avoids us writing things into memory that isn't big
enough for it.

Reviewed-by: Zack Rusin <zackr@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-06-11 12:19:37 +10:00
Jon Ashburn
10e8d55799 i965: Add GPU BLIT of texture image to PBO in Intel driver
Add Intel driver hook for glGetTexImage to accelerate the case of reading
texture image into a PBO.  This case gets huge performance gains by using
GPU BLIT directly to PBO rather than GPU BLIT to temporary texture followed
by memcpy.

No regressions on Piglit tests  with Intel driver.
Performance gain (1280 x 800 FBO, Ivybridge):
glGetTexImage + glMapBufferRange  with patch 1.45 msec
glGetTexImage + glMapBufferRange without patch 4.68 msec

v3: (by Kenneth Graunke)
 - Fix compile after Eric's change to drop the tiling argument
   to intel_miptree_create_for_bo.
 - Add GL_TEXTURE_3D to blacklisted texture targets to prevent Piglit
   regressions.
 - Squash in several whitespace and coding style fixes.
2014-06-10 18:36:44 -07:00
Kenneth Graunke
237aac39b1 i965: Invalidate live intervals when inserting Gen4 SEND workarounds.
We need to invalidate the live intervals when inserting new
instructions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-06-10 16:38:27 -07:00
Kenneth Graunke
ecc78eab11 i965: Don't use the head sentinel as an fs_inst in Gen4 workaround code.
When walking backwards, we want to stop at the head sentinel, which is
where scan_inst->prev->prev == NULL, not scan_inst->prev == NULL.

Fixes random crashes, as well as valgrind errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2014-06-10 16:38:27 -07:00
Kenneth Graunke
fc19c4aaf1 meta: Label the meta GLSL clear program.
Giving the meta clear program a meaningful name makes it easier to find
in output such as INTEL_DEBUG=fs or INTEL_DEBUG=shader_time.  We already
did so for integer programs, but neglected to label the primary program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-10 16:38:27 -07:00
Kenneth Graunke
2bcd24c9f0 i965/fs: Combine generate_math[12]_gen6 methods.
These used to call different math emitters (brw_math vs. brw_math2).
Now that they both call gen6_math, they're virtually identical.

When unrolling SIMD16 to multiple SIMD8 operations, we should take care
not to apply sechalf to brw_null_reg for src1.  Otherwise, we'd end up
with BRW_ARF_NULL + 1 as the register number, and I'm not sure if that's
valid.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:27 -07:00
Kenneth Graunke
35e48bd618 i965/fs: Drop the generate_math[12]_gen7 methods.
These functions are basically identical, so we should combine them.
However, they're so trivial, we may as well just fold them into their
only call sites.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
f3ddd71f28 i965/vec4: Combine generate_math[12]_gen6 methods.
These are trivial to combine: we should just avoid checking the second
operand if it's brw_null_reg.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
5260a26e92 i965/vec4: Drop the generate_math2_gen7() method.
It's now a single line of code, so we may as well fold it into the
caller.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
b003fc265f i965: Rename brw_math to gen4_math.
Usually, I try to use "brw" for functions that apply to all generations,
and "gen4" for dead end/legacy code that is only used on Gen4-5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
de65ec2fde i965: Split Gen4-5 and Gen6+ MATH instruction emitters.
Our existing functions, brw_math and brw_math2, had unclear roles:

Gen4-5 used brw_math for both unary and binary math functions; it never
used brw_math2.  Since operands are already in message registers, this
is reasonable.

Gen6+ used brw_math for unary math functions, and brw_math2 for binary
math functions, duplicating a lot of code.  The only real difference was
that brw_math used brw_null_reg() for src1.

This patch improves brw_math2's assertions to allow both unary and
binary operations, renames it to gen6_math(), and drops the Gen6+ code
out of brw_math().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
7b9cf79790 i965: Make src_reg::equals() take a constant reference, not a pointer.
This is more typical C++ style.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
000f4a33c0 i965: Don't set the "switch" flag on control flow instructions on Gen6+.
Thread switching on control flow instructions is a documented workaround
for Gen4-5 errata.  As far as I can tell, it hasn't been needed since
Sandybridge.  Thread switching is not free, so in theory this may help
performance slightly.

Flow control instructions with the "switch" flag cannot be compacted, so
removing it will make these instructions compactable.  (Of course, we
still have to implement compaction for flow control instructions...)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-10 16:38:26 -07:00
Kenneth Graunke
3a439534de i965/fs: Allow CSE on math opcodes on Gen6+.
total instructions in shared programs: 2081469 -> 2081248 (-0.01%)
instructions in affected programs:     22606 -> 22385 (-0.98%)
No programs were hurt by this patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-10 16:38:25 -07:00
Thomas Helland
2c9a1518a1 glsl: Remove unused include in expr.flatt.
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:52 -07:00
Thomas Helland
10e00611c2 glsl: Remove unused include in ir.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
8e1e68119c glsl: Remove unused include from ir_constant_expression.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
068d30655c glsl: Remove unused include from ir_basic_block.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
b6e68fc9fb glsl: Remove unused include from hir_field_selection.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
4f5445a45d glsl: Remove unused include from glsl_symbol_table.h
Only function-defs use glsl_type so forward declare instead.
Compile-tested on my Ivy-bridge system.

IWYU also suggests removing #include <new>, and this compiles fine.
I'm not familiar enough with memory management in C/C++ that I feel
comfortable removing this. Insights would be appreciated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
38ffbf459b glsl: Remove unused include from glsl_types.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.
Added comment about core.h being used for MAX2.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
22f5a0b277 glsl: Remove unused include from builtin_variables.cpp
Found with IWYU. Compile-tested on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
6f385d9371 glsl: Remove unused include in ast_to_hir.cpp
Found with IWYU. Comment says it's for struct gl_extensions.
Grepping for gl_extensions shows no uses.
Tested by compiling on my Ivy-bridge system.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
5b83d5e2f9 glsl: Remove unused includes in link_uniform_block_active_visitor.h
Found with IWYU, compile-tested on my Ivy-bridge system.
This is not used in the header, and is included in the source.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Thomas Helland
eac09a4e1d glsl: Remove unused includes in link_uniform_init.
Found with IWYU, confirmed with grepping for "hash" and "symbol".
No negative effects on compilation.

IWYU also reported core.h and linker.h could be removed,
but I'm unsure if those are false positives.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2014-06-10 13:05:51 -07:00
Matt Turner
4787c25a60 i965: Replace open-coded linked list with exec_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
1951418038 glsl: Add an exec_node_init() function, usable from C.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
b123c6e96d glsl: Make foreach macros usable from C by adding struct keyword.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
d4ce0109de glsl: Make exec_list members just wrap the C API.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
b10ad648a1 glsl: Make exec_node members just wrap the C API.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:51 -07:00
Matt Turner
d691f0de72 glsl: Add C API for exec_list.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner
47a77ba839 glsl: Add C API for exec_node.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner
5f90f2ee59 glsl: Move definition of exec_list member functions out of the struct.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Matt Turner
cb5a0e59cf glsl: Move definition of exec_node member functions out of the struct.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 13:05:50 -07:00
Bruno Jiménez
112c1b14ed r600g/compute: Use %u as the unsigned format
This fixes an issue when running cl-program-bitcoin-phatk
piglit test where some of the inputs have negative values

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
2e01b8b440 r600g/compute: align items correctly
Now, items whose size is a multiple of 1024 dw won't leave
1024 dw between itself and the following item

The rest of the cases is left as it was

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
df1dd8bf22 r600g/compute: Cleanup of compute_memory_pool.h
Removed compute_memory_defrag declaration because it seems
to be unimplemented.

I think that this function would have been the one that solves
the problem with fragmentation that compute_memory_finalize_pending has.

Also removed comments that are already at compute_memory_pool.c

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
1d6384318e r600g/compute: Tidy a bit compute_memory_finalize_pending
Explanation of the changes, as requested by Tom Stellard:

Let's take need after is calculated as
item->size_in_dw+2048 - (pool->size_in_dw - allocated)

BEFORE:
If need is positive or 0:
    we calculate need += 1024 - (need % 1024), which is like
        cealing to the nearest multiple of 1024, for example
        0 goes to 1024, 512 goes to 1024 as well, 1025 goes
        to 2048 and so on. So now need is always possitive,
        we do compute_memory_grow_pool, check its output
        and continue.

If need is negative:
    we calculate need += 1024 - (need % 1024), in this case
        we will have negative numbers, and if need is
        [-1024:-1] 0, so now we take the else, recalculate
        need as need = pool->size_in_dw / 10 and
        need += 1024 - (need % 1024), we do
        compute_memory_grow_pool, check its output and continue.

AFTER:
If need is positive or 0:
    we jump the if, calculate need += 1024 - (need % 1024)
        compute_memory_grow_pool, check its output and continue.

If need is negative:
    we enter the if, and need is now pool->size_in_dw / 10.
        Now we calculate need += 1024 - (need % 1024)
        compute_memory_grow_pool, check its output and continue.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
39bd08efdd r600g/compute: Add more NULL checks
In this case, NULL checks are added to compute_memory_grow_pool,
so it returns -1 when it fails. This makes necesary
to handle such cases in compute_memory_finalize_pending
when it is needed to grow the pool

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
833b550773 r600g/compute: Adding checks for NULL after CALLOC
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:57 -04:00
Bruno Jiménez
fd943fa6c2 r600g/compute: Fixing a typo and some indentation
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-10 15:29:56 -04:00
Cody Northrop
3eef571cbc mesa: Fix substitution of large shaders
Signed-off-by: Cody Northrop <cody@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-10 10:45:31 -06:00
Michel Dänzer
2d399bb183 configure: Only check for OpenCL without LLVM when the latter is certain
LLVM is enabled by default for some architectures, but the test was failing
before that.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-10 10:56:58 -04:00
David Heidelberger
b0fd54900c r600g,radeonsi: implement PIPE_QUERY_TIMESTAMP_DISJOINT
v2 Marek: set the query result correctly

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-10 13:20:13 +02:00
Jon TURNEY
bd526ec9e1 configure: Always default to --enable-driglx-direct
Always default to --enable-driglx-direct, now that will build driswrast, but
won't try to use dri[123] on platforms which don't have that.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-10 10:32:56 +01:00
Jon TURNEY
f647a722da glx: Fix build in GLX_DIRECT_RENDERING !GLX_USE_APPLEGL !GLX_USE_DRM case
Some untangling to fix building in the dri_platform=none, --enable-driglx-direct
case, where only driswast can be used.

Turn the test for including the glXGetScreenDriver()/glXGetScreenDriver()
interface used by xdriinfo from !GLX_USE_APPLEGL into a positive form, as it is
only useful when dri_platform=drm

Add additional GLX_USE_DRM tests so DRI[123] renderers are only used when
dri_platform=drm

Note that swrast and indirect must still be disabled in the APPLEGL case at the
moment, which makes things more complex than they need to be.  More untangling
is needed to allow that

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-10 10:32:22 +01:00
Kristian Høgsberg
7a45274477 i965: Make gen7_pi field of brw_instruction use unsigned instead of GLuint
Nothing else uses GL-types here.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-09 21:17:19 -07:00
Kristian Høgsberg
cefa265761 i965: Don't include mtypes.h in brw_disasm.c
It's not used.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-09 21:17:19 -07:00
Matt Turner
8e115b03cf i965/fs: initialize src as reg_undef for texture opcodes on Gen4.
Untested.
2014-06-09 21:08:05 -07:00
Tapani Pälli
198204c9c5 i965/fs: initialize src as reg_undef for texture opcodes on Gen5/6.
Commit 07af0ab changed fs_inst to have 0 sources for texture opcodes
in emit_texture_gen5 (Ironlake, Sandybrige) while fs_generator still
uses a single source from brw_reg struct. Patch sets src as reg_undef
which matches the behavior before the constructor got changed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79534
2014-06-09 21:08:05 -07:00
Emil Velikov
5cb1cad0ae egl/dri2: do not leak dri2_dpy->driver_name
Originally all hardware drivers duplicate the driver_name string
from an external source, while for the software rasterizer we set
it to "swrast". Follow the example set by hw drivers this way
we can free the string at dri2_terminate().

v2: Use strdup over strndup. Suggested by Ilia Mirkin.
v3: Handle platform_drm in a similar manner. Cleanup swrast
driver_name in error path.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-09 22:56:00 +01:00
Emil Velikov
c153b1f39b egl/dri2/x11: use standard strndup function
Using a custom version of the function brings no benefit.

Cc: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-09 22:55:51 +01:00
Adrian Negreanu
357a8b6f33 android, dricore: undefined reference to _mesa_streaming_load_memcpy
_mesa_streaming_load_memcpy is defined in main/streaming-load-memcpy.c
I'm adding it to the dricore lib

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:51:44 +01:00
Adrian Negreanu
6eb3888c86 android, mesa_gen_matypes: pull in timespec POSIX definition
This fixes:
  include/c11/threads_posix.h: In function 'cnd_timedwait':
  include/c11/threads_posix.h:140:21: error: storage size of 'abs_time' isn't known

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:51:34 +01:00
Adrian Negreanu
6980cae6ae android, egl: typo dri2_fallback_pixmap_surface -> dri2_fallback_create_pixmap_surface
I used commit bc8b07a6 as reference, and only the droid_display_vtbl had this issue.

This fixes:
src/egl/drivers/dri2/platform_android.c:641:29:
  error: 'dri2_fallback_pixmap_surface' undeclared here (not in a function)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:51:17 +01:00
Adrian Negreanu
4dc5545eff android, egl: add correct drm include for libmesa_egl_dri2
Fixes:
  src/egl/drivers/dri2/platform_android.c:38:
  include/GL/internal/dri_interface.h:51:17:
    fatal error: drm.h: No such file or directory

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:51:10 +01:00
Adrian Negreanu
0048483f73 android: add src/gallium/auxiliary as include path for libmesa_dricore
This fixes:
In file included from
/home/adrian/workspace/mesa/mesa-master.git/src/mesa/vbo/vbo_exec_api.c:445:0:
/home/adrian/workspace/mesa/mesa-master.git/src/mesa/vbo/vbo_attrib_tmp.h:28:38:
fatal error: util/u_format_r11g11b10f.h: No such file or directory

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:51:02 +01:00
Adrian Negreanu
a49ebfab1d android: add libloader to libGLES_mesa and libmesa_egl_dri2
This fixes
  src/egl/drivers/dri2/platform_android.c:664: error: undefined reference to 'loader_set_logger'
  src/egl/drivers/dri2/platform_android.c:678: error: undefined reference to 'loader_get_driver_for_fd'

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:50:53 +01:00
Adrian Negreanu
aba0f152be android: adapt to the megadriver mechanism
Fixes linker error:
  ld:
  .../libmesa_dri_common_intermediates/libmesa_dri_common.a(dri_util.o):
    in function globalDriverAPI:dri_util.c(.data.rel+0x0): error:
    undefined reference to 'driDriverAPI'

As an example, you can see that mesa_dri_drivers
also uses common/libmegadriver_stub (src/mesa/drivers/dri/Makefile.am)

The _stub part might be confusing, but
it actually provides the dri-driver shared lib constructor,
megadriver_stub_init, which will later on load the real
platform dependent part and call
l __driDriverGetExtensions_<platform>

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:50:41 +01:00
Adrian Negreanu
eb3f80dbba add megadriver_stub_FILES
So that android part can also use $(megadriver_stub_FILES)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-09 22:49:54 +01:00
Emil Velikov
c21fca8bf2 scons: remove dri-i915 build target
Unmaintained and broken.

Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2014-06-09 22:46:17 +01:00
Emil Velikov
93257a56b5 configure: error out when building opencl without LLVM
Cc: Tom Stellard <thomas.stellard@amd.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-09 22:45:05 +01:00
Abdiel Janulgue
6f9f916b9b i965/disasm: Properly debug negate source modifier for logical instructions
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-06-09 11:19:50 -07:00
Abdiel Janulgue
c17db7537f i965/vec4: skip copy-propate for logical instructions with negated src entries
The negation source modifier on src registers has changed meaning in Broadwell when
used with logical operations. Don't copy propagate when negate src modifier is set
and when the destination instruction is a logical op.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-06-09 11:19:48 -07:00
Abdiel Janulgue
609d00e13e i965/fs: skip copy-propate for logical instructions with negated src entries
The negation source modifier on src registers has changed meaning in Broadwell when
used with logical operations. Don't copy propagate when negate src modifier is set
and when the destination instruction is a logical op.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-06-09 11:19:45 -07:00
Abdiel Janulgue
a66660d2b7 i965/fs: Refactor check for potential copy propagated instructions.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2014-06-09 11:19:39 -07:00
Brian Paul
1e150ca696 docs: add link to 10.1.5 on news page 2014-06-09 06:13:41 -07:00
Brian Paul
c53550586e docs: fix version number in 10.2.1 release notes 2014-06-09 06:10:35 -07:00
Brian Paul
bedeb5433b docs: import the 10.1.5 release notes 2014-06-09 06:10:18 -07:00
Chris Forbes
5bbb028ef3 glsl: Validate aux storage qualifier combination with other qualifiers.
We've been allowing `centroid` and `sample` in all kinds of weird places
where they're not valid.

Insist that `sample` is combined with `in` or `out`;
and that `centroid` is combined with `in`, `out`, or the deprecated
`varying`.

V2: Validate this in a more sensible place. This does require an extra
case for uniform blocks members and struct members, though, since they
don't go through the normal path.

V3: Improve error message wording; eliminate redundant error generation
for inputs in VS or outputs in FS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-10 10:09:31 +12:00
Iago Toral Quiroga
c75f827f12 i965: Ensure that we end instruction streams properly.
Threads must terminate with a SEND message to a particular shared function,
such as a URB write or FB write, so the instruction stream really shouldn't
ever end in an IF/ELSE/ENDIF or similar block structure.

However, if the instruction stream (incorrectly) ends in a block structure
the last block's end pointer will not be set, leading to a crash later on in
fs_live_variables::setup_def_use(). It is better to detect this earlier, so
assert on that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-09 12:00:04 +02:00
Iago Toral Quiroga
dc2d3a7f5c i965/fs: Add Gen < 6 runtime checks for line antialiasing.
In Gen < 6 the hardware generates a runtime bit that indicates whether AA data
has to be sent as part of the framebuffer write SEND message. This affects the
specific case where we have setup antialiased line rendering and we render
polygons which have one face setup in GL_LINE mode (line antialiasing
will be used) and the other one in GL_FILL mode (no line antialiasing needed).

Currently we are not doing this runtime test and instead we always send AA
data, which produces incorrect rendering of the GL_FILL face of the polygon in
in the aforementioned scenario (verified in ironlake and gm45).

In Gen4 this is, likely, a regression introduced with commit 098acf6c84. In
Gen5 this has never worked properly. Gen > 5 are not affected by this.

The patch fixes the problem by adding the appropriate runtime check and
adjusting the framebuffer write message accordingly in the conflictive
scenario.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-09 11:48:49 +02:00
Iago Toral Quiroga
6e61892aea i965/fs: Let the gen < 8 generator know about runtime_check_aads_emit
In gen < 6 we need to produce conditional code based on this flag when doing
framebuffer writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-09 11:47:38 +02:00
Chris Forbes
be1b5724ab docs: Mark off ARB_compressed_texture_pixel_storage
.. and add to release notes for 10.3

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
8a1a4855cf mesa: Add extension enable for ARB_compressed_texture_pixel_storage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
b57138b57a mesa: Add pixel storage support for GetCompressedTexImage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
be30766f56 mesa: Compute proper strides for compressed texture pixel storage.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:45 +12:00
Chris Forbes
8d29569c25 mesa: Extract computation of compressed pixel store params
This logic is reusable across CompressedTex*Image* and
GetCompressedTexImage; the strides calculated will also be needed
in the PBO validation functions to ensure that the referenced range of
bytes is valid.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:44 +12:00
Chris Forbes
d6e60cb504 mesa: Emit errors for inconsistent compressed pixel store state
V2: Use bool rather than GLboolean for internal function

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:42:44 +12:00
Chris Forbes
75a5823749 mesa: Add new pixel pack/unpack state for
ARB_compressed_texture_pixel_storage

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:42 +12:00
Chris Forbes
1fca84e7a0 tests: Add new enum strings for ARB_compressed_texture_pixel_storage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:40 +12:00
Chris Forbes
cef3f9b909 glapi: Add XML infrastructure for ARB_compressed_texture_pixel_storage
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:38 +12:00
Chris Forbes
8f63559c93 mesa: Make CompressedTexSubImage errors more consistent
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:36 +12:00
Chris Forbes
4119b0eaee mesa: Trim down PixelStorei implementation
Move _mesa_error call for INVALID_VALUE to one place.
Remove checks for previous value matching -- this was important when we
were flushing vertices before the update, but that hasn't happened for a
long time now.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-10 07:38:27 +12:00
José Fonseca
eb58aa9cf0 mesa/main: Prevent sefgault on glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING).
A recent ApiTrace change, that tries to dump more buffer state
causes Mesa from my distro (10.1.4) to segfaults here.

I haven't actually confirm this fixes it (I can't repro on master),
but it seems a good idea to be defensive here anyway.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-08 09:43:14 +01:00
Iago Toral Quiroga
8873120f9f Revert "i965: Move brw_land_fwd_jump() to compilation unit of its use."
This reverts commit f3cb2e6ed7.

brw_land_fwd_jump() is convenient wherever we produce JMPI instructions
and we will use JMPI to implement framebuffer writes that involve line
antialiasing in gen < 6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-07 21:32:35 -07:00
Kenneth Graunke
220e208329 i965: Fix else and brace placement in brw_eu_emit.c.
I'm making a lot of changes to this area, and I figured I may as well
not conflate these trivial changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-07 21:30:03 -07:00
Kenneth Graunke
1f3735bff0 i965: Drop the remaining default predication whacking.
With my earlier cleaning in place (see git log brw_eu_emit.c), nothing
relies on the instruction emitters for IF/WHILE/JMPI disabling
predication.  Drop it in favor of making callers do the right thing
explicitly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-07 21:30:03 -07:00
Kenneth Graunke
8a314a784c i965/sf: Use brw_set_default_predicate_control().
This is a bit tidier than poking at p->current directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-07 21:30:03 -07:00
Ilia Mirkin
bd7dd3ed06 gk110/ir: fix bfind emission
There is a short-immediate version as well, but it should never end up
getting used since it would have gotten folded earlier.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-07 16:39:19 -04:00
Ian Romanick
40500ebb20 docs: Add MD5 checksum, etc. for 10.2.1 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 70ce1031e7)
2014-06-06 23:30:58 -07:00
Ian Romanick
3581e5ef89 docs: Add initial 10.2.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 8c4845d29b)
2014-06-06 23:30:17 -07:00
Vinson Lee
82c577acfa configure.ac: Do not use Pthreads with MinGW.
Match the behavior of the SCons MinGW build.

This patch also fixes these build errors.

  CC       glapi_entrypoint.lo
glapi_entrypoint.c: In function 'init_glapi_relocs_once':
glapi_entrypoint.c:341:4: error: unknown type name 'pthread_once_t'
    static pthread_once_t once_control = PTHREAD_ONCE_INIT;
    ^
glapi_entrypoint.c:341:41: error: 'PTHREAD_ONCE_INIT' undeclared (first use in this function)
    static pthread_once_t once_control = PTHREAD_ONCE_INIT;
                                         ^
glapi_entrypoint.c:341:41: note: each undeclared identifier is reported only once for each function it appears in
glapi_entrypoint.c:342:4: error: implicit declaration of function 'pthread_once' [-Werror=implicit-function-declaration]
    pthread_once( & once_control, init_glapi_relocs );
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-06 22:25:13 -07:00
Ilia Mirkin
7a67318794 gk110/ir: fix emitting constbuf file index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-07 00:30:22 -04:00
Ian Romanick
637132645a docs: Add MD5 checksum, etc. for 10.1 release
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 28d41e409d)
2014-06-06 21:19:27 -07:00
Ilia Mirkin
4a3a71a183 gk110/ir: emit saturate flag on fadd when needed
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 23:32:29 -04:00
Ilia Mirkin
9fef8b3d81 gk110/ir: fix slct emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 22:54:21 -04:00
Timothy Arceri
1454f894ff st/mesa: remove extra calculation of sampler count
This code was originally introduced to fix https://bugs.freedesktop.org/show_bug.cgi?id=53617. The comment says you need to pass NULL in order to unref old views however cso_set_sampler_views() already takes care of old views with the second for loop. Also as of 2355a64414 cso_set_sampler_views() passes the max of the old and new views to the driver for all state trackers making this code obsolete.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-07 12:21:19 +10:00
Ilia Mirkin
d588a4919b gk110/ir: fix interp mode emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 20:33:06 -04:00
Ilia Mirkin
ed1b9e5721 gk110/ir: fix ISAD emission with register args
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 19:52:49 -04:00
Ilia Mirkin
6e046508a1 gk110/ir: fix quadon opcode emission
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 19:27:28 -04:00
Ilia Mirkin
ca65fc418f nvc0: don't bother trying to set up compute for gk110+
The nouveau fw currently prints a bunch of errors. No point in seeing
those all the time, esp since compute doesn't really work in the first
place.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 18:25:35 -04:00
Ilia Mirkin
b9ec766bd0 gk110: add in forgotten code for gk110 isa
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 18:25:32 -04:00
Ilia Mirkin
73eec47ef8 gk110/ir: emit texbar the same way that the blob does
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 18:25:16 -04:00
José Fonseca
b6956aef74 scons: Search only for mingw-w64 cross-compilers.
Some distros still ship the non-mingw-w64 cross-compilers, but they are
can't build Mesa properly, as Jakob pointed out.
2014-06-06 13:15:37 +01:00
Stéphane Marchesin
1751a9ba26 i915g: Remove 4444 and 5551 formats
They don't seem to work 100%, I need to investigate but in the
meantime let's remove them.
2014-06-05 21:44:35 -07:00
Tobias Klausmann
4f4e9ba166 nvc0/ir: Handle OP_POPCNT when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
[imirkin: make sure to only fold 1-arg popcnt in opnd]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-06 00:05:11 -04:00
Tobias Klausmann
fdc1d96b0f nvc0/ir: Handle OP_BFIND when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-06 00:00:26 -04:00
Tobias Klausmann
4674343e8f nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-06 00:00:26 -04:00
Tobias Klausmann
3164bfc734 nv50/ir: clear subop when folding constant expressions
Some operations (e.g. OP_MUL/OP_MAD/OP_EXTBF) might have a subop set.
After folding, make sure that it is cleared

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-06 00:00:26 -04:00
Kenneth Graunke
221169693b i965: Support GL_CLAMP natively on Broadwell.
The new hardware actually supports this OpenGL 1.x feature natively,
so we can finally drop our shader workarounds.

Not many applications use GL_CLAMP, and most use it unintentionally, but
it's trivial to do right, so we should.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-05 01:26:05 -07:00
Kenneth Graunke
7f3d64a77b i965: Pass brw to translate_wrap_mode().
This lets us do generation checks.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-05 01:25:56 -07:00
Tapani Pälli
cf29913aa1 i965: use _mesa_align_malloc in intel_miptree_map_movntdqa
This fixes case where we have 1x1 size buffer and misalignment is 0.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79616
2014-06-05 09:00:17 +03:00
Chris Forbes
3c77d2a113 i965/fs: Allow array dereference of HW_REG.
When dereferencing an element of gl_SampleMaskIn[], the source register
here will be a HW_REG rather than a VGRF because the payload slot is
now exposed directly.

Fixes an assertion failure in the Piglit test:

   tests/spec/arb_gpu_shader5/execution/samplemaskin-basic

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-05 06:53:43 +12:00
Leo Liu
3642ee846a st/omx/enc: enable b frames
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:42 +02:00
Leo Liu
e074f8200e radeon/vce: implement h264 profile support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:42 +02:00
Leo Liu
f588b80bba st/omx/enc: implement h264 profile support
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:41 +02:00
Leo Liu
4722c326ce vl: add more avc profiles
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-04 17:24:41 +02:00
José Fonseca
122e232495 wgl: Disable CRT message boxes when Windows system error messages boxes are disabled.
At least on MSVC we statically link against the CRT, so we must disable
the CRT message boxes if we want unattended testing.

The messages are convenient when running manually, so let them be if the
system error message boxes are not disabled.
2014-06-04 10:25:08 +01:00
Chris Forbes
7e0dd80f11 glapi: Note apparent gap in numbering from ARB_multi_draw_indirect
This is defined in the same included file as ARB_draw_indirect.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-04 20:25:39 +12:00
Chris Forbes
7bf768b484 docs: Mark off gs5/overload resolution
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-04 20:12:58 +12:00
Chris Forbes
b18b4c7d74 glsl: Implement overload resolution for ARB_gpu_shader5
V3: Move spec citation into the code.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 20:10:27 +12:00
Chris Forbes
c1ceadfc32 glsl: Add support for comparing function parameter conversions
The ARB_gpu_shader5 spec says:

"To determine whether the conversion for a single argument in one match is
better than that for another match, the following rules are applied, in
order:

  1. An exact match is better than a match involving any implicit
     conversion.

  2. A match involving an implicit conversion from float to double is
     better than a match involving any other implicit conversion.

  3. A match involving an implicit conversion from either int or uint to
     float is better than a match involving an implicit conversion from
     either int or uint to double.

If none of the rules above apply to a particular pair of conversions,
neither conversion is considered better than the other."

V3: Add spec citation, including oddball difference between gs5 and GLSL
4.0; comment a bit better as per Jordan's suggestions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 20:03:08 +12:00
Chris Forbes
59dd444cac glsl: Build a list of inexact function matches
This will facilitate GLSL 4.0 / ARB_gpu_shader5's enhanced overload
resolution rules, and also possibly better error reporting for ambiguous
function calls.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 19:49:34 +12:00
Chris Forbes
4312e973f2 docs: Mark off gs5/implicit conversions
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-06-04 19:36:02 +12:00
Chris Forbes
6ae787584d glsl: Allow int -> uint implicit conversions on function parameters
V2: Fix crashes during linking, where the parse state is NULL. In this
case, all required checks have already been done, so we assume the
extension is enabled.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:59 +12:00
Chris Forbes
f17428a276 glsl: Pass parse state to can_implicitly_convert_to()
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:57 +12:00
Chris Forbes
a78c663c22 glsl: Pass parse state to parameter_lists_match()
The available implicit conversions depend on the GLSL version we're
compiling.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:54 +12:00
Chris Forbes
240974e93f glsl: Add support for int -> uint implicit conversions
This is required for ARB_gpu_shader5.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:51 +12:00
Chris Forbes
1ace51f091 glsl: Clean up apply_implicit_conversion
We're about to add new implicit conversions, first for ARB_gpu_shader5,
and then later for ARB_gpu_shader_fp64. Pull out the opcode
determination into its own function, and get rid of the bool -> float
case that could never be hit anyway [since it fails the is_numeric()
check].

V2: Retain the vector width mangling. It turns out this is necessary for
the conversions done (and then thrown away) when determining the return
type of arithmetic operators.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-04 19:35:47 +12:00
Chris Forbes
9578bb21d0 docs: Update precise qualifier status in GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:11 +12:00
Chris Forbes
345034869e glsl: Allow precise as a parameter qualifier
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:09 +12:00
Chris Forbes
d0495c6db8 glsl: Disallow precise redeclarations of vars from outer scopes
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:08 +12:00
Chris Forbes
5ecffe5a3a glsl: Add support for precise redeclarations
This works like glsl-1.20+'s invariant redeclarations, but with fewer
restrictions, since `precise` is allowed on pretty much anything.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:05 +12:00
Chris Forbes
4b756b20c4 glsl: add support for precise in type_qualifier
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:56:03 +12:00
Chris Forbes
37ab3ddbf8 glsl: remove outdated comment, move sample to correct block
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-06-04 18:55:49 +12:00
Kenneth Graunke
7913b4b97b i965: Fix copy and pasted values in Broadwell code.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-03 18:19:54 -07:00
Matt Turner
ac25cf55af glsl: Make most ir_instruction::as_subclass() functions non-virtual.
There are several common ways to check whether an object is a particular
subclass: dynamic_cast<>, the as_subclass() pattern, or explicit enum
tags.  We originally used the virtual as_subclass methods, but later
added enum tags as they are much nicer for debugging.

Since we have the enum tags, we don't necessarily need to use virtual
functions to implement the as_subclass() methods.  We can just check the
tag and return the pointer or NULL.

This saves 18 entries in the vtable, and instead of two pointer
dereferences per as_subclass() call most are only three inline
instructions.

Compile time of sam3/112.frag (the longest compile in a recent shader-db
run) is reduced by 5% from 348 to 329 ms (n=500).

perf stat of this workload shows:
   24.14% reduction in iTLB-loads:       285,543 -> 216,606
   42.55% reduction in iTLB-load-misses:  18,785 ->  10,792

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Matt Turner
773544f0e9 glsl: Move ir_type_unset to end of enumeration.
Now that the constructors set a type, ir_type_unset is not very useful.
Move it to the end of the enum (specifically out of position 0) so that
enums checks for dereferences and rvalues can save an instruction.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Matt Turner
943cc7ff17 glsl: Reorder ir_type_* enum for easier comparisons.
Makes checking whether an object is an ir_dereference, an ir_rvalue, or
an ir_jump simpler. Since ir_dereference is a subclass or ir_rvalue,
list its subtypes first so that they can both generate nice code.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Matt Turner
3540b5eb55 glsl: Remove useless call to as_rvalue().
The type returned by hir() is already an ir_rvalue pointer.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-06-03 17:58:34 -07:00
Ian Romanick
963bd99f03 glsl: Set ir_instruction::ir_type in the base class constructor
This has the added perk that if you forget to set ir_type in the
constructor of a new subclass (or a new constructor of an existing
subclass) the compiler will tell you... instead of relying on
ir_validate or similar run-time detection.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-03 17:58:34 -07:00
Sinclair Yeh
91ff0d4c65 egl: Check for NULL native_window in eglCreateWindowSurface
We have customers using NULL as a way to test the robustness of the API.
Without this check, EGL will segfault trying to dereference
dri2_surf->wl_win->private because wl_win is NULL.

This fix adds a check and sets EGL_BAD_NATIVE_WINDOW

v2: Incorporated feedback from idr - moved the check to a higher level
function.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-03 17:28:30 -07:00
Marek Olšák
d226191820 r600g,radeonsi: don't use hardware MSAA resolve if dst is fast-cleared
It doesn't work and our docs say so too.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-03 13:33:14 +02:00
Marek Olšák
0423513c61 radeonsi: BlitFramebuffer should follow render condition
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-03 13:33:14 +02:00
Marek Olšák
3a92fc1bdd r600g: BlitFramebuffer should follow render condition 2014-06-03 13:33:14 +02:00
Marek Olšák
d929a30e9a r300g: BlitFramebuffer should follow render condition 2014-06-03 13:33:14 +02:00
Marek Olšák
bf701a84eb r600g,radeonsi: disable fast clear if render condition is on
For some reason, CP DMA doesn't follow the predicate bit if I enable it,
so this is the only option.

This fixes piglit: spec/NV_conditional_render/clear

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-03 13:33:14 +02:00
José Fonseca
e3e13d6b85 mesa: Make glGetIntegerv(GL_*_ARRAY_SIZE) return GL_BGRA.
Same as b026b6bbfe, but
COLOR_ARRAY_SIZE/SECONDARY_COLOR_ARRAY_SIZE.

Ideally we wouldn't munge the incoming state, so that we wouldn't need
to unmunge it back on glGet*.  But the array size state is copied and
referred in many places, many of which couldn't take an GLenum like
GL_BGRA instead of a plain integer.  So just hack around on glGet*,
to ensure there is no risk of introducing regressions elsewhere.

This bug causes problems to Apitrace, resulting in wrong traces.  See
https://github.com/apitrace/apitrace/issues/261 for details.

Tested with piglit arb_vertex_array_bgra-get, which was created for this
purpose.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-03 12:20:53 +01:00
José Fonseca
53468dee03 mesa/main: Make get_hash.c values constant.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-03 12:20:50 +01:00
Vinson Lee
dad22cc590 i965: Add _default_ name changes to test_eu_compact.c.
These were missed in commit e374809819.

Fixes 'make check'.

  CC       test_eu_compact.o
test_eu_compact.c: In function ‘gen_f0_0_MOV_GRF_GRF’:
test_eu_compact.c:222:4: error: implicit declaration of function ‘brw_set_predicate_control’ [-Werror=implicit-function-declaration]
    brw_set_predicate_control(p, true);
    ^
test_eu_compact.c: In function ‘run_tests’:
test_eu_compact.c:270:6: error: implicit declaration of function ‘brw_set_access_mode’ [-Werror=implicit-function-declaration]
      brw_set_access_mode(p, BRW_ALIGN_16);
      ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-06-02 23:44:21 -07:00
Matt Turner
328e959317 i965/gen8: Print number of instructions directly.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:30 -07:00
Matt Turner
757d7ddf01 i965: Emit compaction stats without walking the assembly.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:29 -07:00
Matt Turner
6fdfe3f2dc i965: Move program header printing to end of generate_code().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:29 -07:00
Matt Turner
92b055625d i965: Move annotation info into generate code.
Suggested by Ken as a way to cut down lines of code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-02 15:17:29 -07:00
Kenneth Graunke
e374809819 i965: Put '_default_' in the name of functions that set default state.
Eventually we're going to use functions to set bits on an instruction.
Putting 'default' in the name of functions that alter default state will
help distinguins them.

This patch was generated entirely mechanically, by the following:

for file in brw*.{cpp,c,h}; do
   sed -i \
   -e 's/brw_set_mask_control/brw_set_default_mask_control/g' \
   -e 's/brw_set_saturate/brw_set_default_saturate/g' \
   -e 's/brw_set_access_mode/brw_set_default_access_mode/g' \
   -e 's/brw_set_compression_control/brw_set_default_compression_control/g' \
   -e 's/brw_set_predicate_control/brw_set_default_predicate_control/g' \
   -e 's/brw_set_predicate_inverse/brw_set_default_predicate_inverse/g' \
   -e 's/brw_set_flag_reg/brw_set_default_flag_reg/g' \
   -e 's/brw_set_acc_write_control/brw_set_default_acc_write_control/g' \
   $file;
done

No manual changes were done after running that command.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:36 -07:00
Kenneth Graunke
76d7160c6c i965: Delete brw_set_conditionalmod.
This removes the ability to set the default conditional modifier on all
future instructions.  Nothing uses it, and it's not really a sensible
thing to do anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:35 -07:00
Kenneth Graunke
fea7b97742 i965: Eliminate brw_set_conditionalmod from the Gen4-5 compilers.
With the predication changes eliminated, all this does is set the
conditional modifier on a single instruction.  Doing that directly is
easy, and avoids mucking about with default state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:33 -07:00
Kenneth Graunke
776ad51165 i965: Don't use brw_set_conditionalmod in the FS and vec4 compilers.
brw_set_conditionalmod and brw_next_insn work together to set the
conditional modifier for the next instruction, then turn it off.
The Gen8+ generators don't implement this: we just set it for all future
instructions, and whack it for each fs_inst/vec4_instruction.

Both approaches work out because we only set conditional_mod on
IR instructions like CMP, AND, and so on, which correspond to exactly
one assembly instruction.  The Gen8 generators would break if we had
an IR instruction that generated multiple instructions, and the Gen4-7
EU emit layer would do...something.

To safeguard against this, assert that we only generated one instruction
if conditional_mod is set, and just set the flag directly on that
instruction rather than altering default state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:30 -07:00
Kenneth Graunke
ff340ce3c3 i965: Stop setting predication from brw_set_conditionalmod.
brw_set_conditionalmod has traditionally been complex: it causes
conditionalmod to be set for the next instruction, and then predication
to be set on all future instructions after that.

We may want to generate a flag condition and not use it immediately,
due to instruction scheduling or the like.  Even if not, it's easy
to set things explicitly, and that's clearer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:29 -07:00
Kenneth Graunke
0985da5423 i965: Drop unnecessary brw_set_conditionalmod() before brw_CMP().
brw_CMP already takes a conditional modifier as a parameter, and sets it
accordingly.  brw_set_conditionalmod() also makes everything after the
next instruction predicated, but we don't need that: we always emit an
IF instruction after load_clip_distance(), and that's already
predicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:26 -07:00
Kenneth Graunke
0bfac24caf i965/clip: Use the new brw_last_inst macro instead of temporaries.
It wasn't too bad before, but the macro is going to be nicer once I
start modifying a lot more instructions in this pattern.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:25 -07:00
Kenneth Graunke
42c292006c i965: Create a "brw_last_inst" convenience macro.
Often times, we want to emit an instruction, then set one field on it,
such as predication or a conditional modifier.  Normally, we'd have to
declare "struct brw_instruction *inst;" and then use "inst =
brw_FOO(...)" to emit the instruction, which can hurt readability.

The new "brw_last_inst" macro refers to the most recently emitted
instruction, so you can just do:

    brw_ADD(...)
    brw_last_inst->header.predicate_control = BRW_PREDICATE_NORMAL;

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:23 -07:00
Kenneth Graunke
8deb91b2e7 i965: Make brw_JMPI set predicate_control based on a parameter.
We use both predicated and unconditional JMPI instructions.  But in each
case, it's clear which we want.  It's simpler to just specify it as a
parameter, rather than relying on default state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:21 -07:00
Kenneth Graunke
3769a2d51f i965: Remove the dst and src0 parameters from brw_JMPI.
In all cases, we set both dst and src0 to brw_ip_reg().  This is no
accident: according to the ISA reference, both are required to be the IP
register.  So, we may as well drop the parameters.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-06-02 15:09:12 -07:00
Beren Minor
0ca0d5743f egl/main: Fix eglMakeCurrent when releasing context from current thread.
EGL 1.4 Specification says that
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)
can be used to release the current thread's ownership on the surfaces
and context.

MESA's egl implementation was only accepting the parameters when the
KHR_surfaceless_context extension is supported.

[chadv] Add quote from the EGL 1.4 spec.
Cc: "10,1, 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-06-02 12:16:50 -07:00
Marek Olšák
f98a7d89be radeonsi: enable ARB_sample_shading 2014-06-02 13:01:27 +02:00
Marek Olšák
d0e8b65aed radeonsi: implement SAMPLEMASK fragment shader output 2014-06-02 12:58:22 +02:00
Marek Olšák
99df120e00 radeonsi: interpolate varyings at sample when full sample shading is enabled 2014-06-02 12:58:22 +02:00
Marek Olšák
99d9d7c0d6 radeonsi: implement SAMPLEPOS fragment shader input
The sample positions are read from a constant buffer.
2014-06-02 12:58:22 +02:00
Marek Olšák
5b06fc376d radeonsi: implement SAMPLEID fragment shader input 2014-06-02 12:58:22 +02:00
Marek Olšák
501fee2511 radeonsi: implement set_min_samples
This is how per-sample shading is enabled.
2014-06-02 12:58:22 +02:00
Marek Olšák
fe98bfb261 radeon: add basic register setup for per-sample shading
Only for Cayman, SI, CIK.
2014-06-02 12:58:22 +02:00
Marek Olšák
3aed75c859 radeon: split cayman_emit_msaa_state into 2 functions
The other function will be split up from the framebuffer state.
2014-06-02 12:58:22 +02:00
Marek Olšák
0d5ec2c615 Revert "glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload"
This reverts commit e3cc0d90e1.

It breaks too many apps and completely breaks my desktop too.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79469

We'll probably need to re-release all stable versions after this is committed.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-02 12:56:12 +02:00
Christoph Bumiller
b206f5951c r600g: use TGSI_PROPERTY to disable viewport and clipping
v2 get rid of magic value, use DEFINES
v3 update clip_disable together with vs_position_window_space

Big thanks to Marek Olšák!

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
4b586a26c8 gallium: create TGSI_PROPERTY to disable viewport and clipping
Marek v2: add a cap

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
304f64bb50 r600g: remove assert on draw with count == 0
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
476aaf8b8e r600g: HW bug workaround for TGSI_OPCODE_BREAKC
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
6544a4a342 r600g: implement TGSI_OPCODE_BREAKC
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
822ac96802 r600g: support all channels of TGSI_FILE_ADDRESS
It's allowed in SM3.

v2: fix multi-component tgsi_r600_arl (FLT_TO_INT is trans-only)

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
04eb8b85ea r600g: check for PIPE_BIND_BLENDABLE in is_format_supported
v2: added !util_format_is_depth_or_stencil(format)

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:03 +02:00
Christoph Bumiller
04de3234ee r600g: handle PIPE_QUERY_GPU_FINISHED
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-02 12:49:02 +02:00
Matt Turner
84e0a5c406 i965/fs: Add fs_inst constructor that takes a list of sources.
Also add an emit() function that calls it.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
521f9b9a48 i965/fs: Add a function to resize fs_inst's sources array.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
07af0abef0 i965/fs: Clean up fs_inst constructors.
In a fashion suggested by Ken.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
b1dcdcde2e i965/fs: Loop from 0 to inst->sources, not 0 to 3.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:24 -07:00
Matt Turner
27e12a8ea9 i965/fs: Store the number of sources an fs_inst has.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
1b60391ed4 i965/fs: ralloc fs_inst's fs_reg sources.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
a391e99b23 i965/fs: Disable fs_inst assignment operator.
The fs_reg src array is going to turn into a pointer and we'd rather not
consider the implications of shallow copying fs_insts.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
6d3a15223a i965/fs: Add and use an fs_inst copy constructor.
Will get more complicated when fs_reg src becomes a pointer.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:29:23 -07:00
Matt Turner
bfcf6a665b i965: Skip IR annotations with INTEL_DEBUG=noann.
Running shader-db with INTEL_DEBUG=noann reduces the runtime
from ~90 to ~80 seconds on my machine. It also reduces the disk space
consumed by the .out files from 660 MB (676 on disk) to 343 MB (358 on
disk).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
55bd8b8b66 i965/fs: Debug the optimization passes by dumping instr to file.
With INTEL_DEBUG=optimizer, write the output of dump_instructions() to a
file each time an optimization pass makes progress. This lets you easily
diff successive files to see what an optimization pass did.

Example filenames written when running glxgears:
   fs8-0000-00-start
   fs8-0000-01-04-opt_copy_propagate
   fs8-0000-01-06-dead_code_eliminate
   fs8-0000-01-12-compute_to_mrf
   fs8-0000-02-06-dead_code_eliminate
        |   |  |   |
        |   |  |   `-- optimization pass name
        |   |  |
        |   |  `-- optimization pass number in the loop
        |   |
        |   `-- optimization loop interation
        |
        `-- shader program number

Note that with INTEL_DEBUG=optimizer, we disable compact_virtual_grfs,
so that we can diff instruction lists across loop interations without
the register numbers being changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
e9bf1662b0 i965: Give dump_instructions() a filename argument.
This will allow debugging code to dump the IR after an optimization pass
makes progress (the next patch). Only let it open and write to a file if
the effective user isn't root.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
56d6dcf4f7 i965: Give dump_instruction() a FILE* argument.
Use function overloading rather than default arguments, since gdb
doesn't know about default arguments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Matt Turner
08c2acd8d9 i965: Add envvar to debug the optimization passes.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-06-01 13:18:52 -07:00
Roland Scheidegger
3fc72f2ec6 llvmpipe: (trivial) drop "unswizzled" from some function names
This made sense when swizzled storage layout was used for rendering to tiles.
But nowadays the name just adds confusion (and makes for long lines).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
576868140b llvmpipe: fix crash when not all attachments are populated in a fb
Framebuffers can have NULL attachments since a while. llvmpipe handled
that properly for lp_rast_shade_quads_mask but it seems the change didn't
make it to lp_rast_shade_tile.
This fixes piglit fbo-drawbuffers-none test (though I need to increase
the FB_SIZE from 32 to 256 so the tris cover some tiles fully).
https://bugs.freedesktop.org/show_bug.cgi?id=79421

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
98d8ba2776 softpipe: honor the render_condition_enable bit in blits.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
c90b5884bd llvmpipe: honor the render_condition_enable bit in blits.
This fixes piglit nv_conditional_render-blitframebuffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Roland Scheidegger
f49e201df9 gallium/docs: improve documentation of render condition wrt blits.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-31 22:05:14 +02:00
Brian Paul
3b66029dd3 svga: use svga_shader_too_large() in compile_vs()
And rework the dummy shader code to match the fragment shader case.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:36 -06:00
Brian Paul
3bb18eab72 svga: use svga_shader_too_large() in compile_fs()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:35 -06:00
Brian Paul
7b2ff54417 svga: added svga_shader_too_large() helper
To check if a shader bytcode exceeds the device limit.  There's no
limit when using GBS.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:35 -06:00
Jeremy Huddleston Sequoia
b4f34241ec darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context
https://xquartz.macosforge.org/trac/ticket/650

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-31 03:44:51 -07:00
Vinson Lee
83bba8f146 util: Do not use __builtin_clrsb with Intel C++ Compiler.
This patch fixes this build error with icc 14.0.2.

In file included from state_tracker/st_glsl_to_tgsi.cpp(63):
../../src/gallium/auxiliary/util/u_math.h(583): error: identifier "__builtin_clrsb" is undefined
     return 31 - __builtin_clrsb(i);
                 ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-30 19:47:35 -07:00
Lubomir Rintel
90b5747856 i915: add a missing NULL pointer check
mesaVisual can be NULL with configless context since this commit:

    commit 551d459af4
    Author: Neil Roberts <neil@linux.intel.com>
    Date:   Fri Mar 7 18:05:47 2014 +0000

    Add the EGL_MESA_configless_context extension
...
    Previously the i965 and i915 drivers were explicitly creating a zeroed visual
    whenever 0 is passed for the EGLConfig.

We attempt to dereference the visual in i915 and now we don't create a
zeroed-out one one it crashes, breaking at least weston in an i915. There's
no point in doing so as it would be zero anyway.

v2: Fixed a typo in commit message.  Added some tags.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1100967
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 17:10:08 -07:00
Ian Romanick
7b1aeec9cd glapi: Duplicate GLES1 prototypes in glapi_dispatch.c
These prototypes are necessary because GLES1 library builds will create
dispatch functions for them.  We can't directly include GLES/gl.h
because it would conflict the previously-included GL/gl.h.  Since GLES1
ABI is not expected to every add more functions, the path of least
resistance is to just duplicate the prototypes for the functions that
aren't already in desktop OpenGL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79294
Acked-by: Matt Turner <mattst88@gmail.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-30 16:33:34 -07:00
Matt Turner
65bccff800 i965/vec4: Allow writemasking on math instructions on Gen7+.
The math instruction was Align1-only on Gen6 and we never updated this
to let it use Align16 features like writemasking on newer platforms.

total instructions in shared programs: 1686120 -> 1685507 (-0.04%)
instructions in affected programs:     48593 -> 47980 (-1.26%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-30 12:20:45 -07:00
Pavel Popov
d292d40207 i965: Fix Line Stipple enable bit in 3DSTATE_SF for Haswell.
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
2014-05-30 12:20:18 -07:00
Brian Paul
ebf229a436 st/wgl: use _debug_printf() instead of fprintf()
This should print output both for debug and release builds.
Suggested by Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
4b05e3cb0f st/wgl: formatting fixes in stw_framebuffer.c
And remove some unneeded #includes and INLINE qualifiers.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
f9595e21bc st/wgl: make stw_lookup_context_locked() an inline function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
bd36cbfa5a st/wgl: fix implementation of wglCreateContextAttribsARB()
wglCreateContextAttribsARB() didn't work previously since it returned
a context ID that wasn't allocated by OPENGL32.DLL.  So if that context
ID was later passed to wglMakeCurrent(), etc. it was rejected.

Now when wglCreateContextAttribsARB() is called we actually call
wglCreateContext() in order to get a valid context ID.  Then we
replace the context data which was created with new context data
which reflects the arguments passed to wglCreateContextAttribsARB().

If there were a DrvCreateContextAttribs() function in the ICD this
work-around wouldn't be necessary.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>

Conflicts:
	src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c
	src/gallium/state_trackers/wgl/stw_getprocaddress.c
2014-05-30 18:52:39 +01:00
Brian Paul
fa55c2402c st/wgl: add debug code to check that pixel format initialization worked
If the assertion fails, it means something is really broken.  Before,
if this happened we reverted to the GDI renderer without any warning.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul
e4a5165562 st/wgl: change PFD_SWAP_COPY to PFD_SWAP_EXCHANGE.
To reflect our actual SwapBuffers implementation.  See
stw_st_swap_framebuffer_locked().  This fixes various rendering issues
with SolidEdge.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-30 18:52:39 +01:00
José Fonseca
76bf4bd3c5 docs: Document how to replace Windows built-in OpenGL software rasterizer with llvmpipe.
Just happened to stumble across this registry key while debugging
something else.

This technique is much neater than trying to override opengl32.dll.

Also a few minors cleanups.
2014-05-30 18:52:39 +01:00
Tapani Pälli
56bdffe8c1 scons: add common.c as part of glcpp build
to have _mesa_error_no_memory function available

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79440
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-30 10:11:44 +03:00
Juha-Pekka Heikkila
fb7baafbbf mesa: Add missing null checks into prog_hash_table.c
Check calloc return values in hash_table_insert() and
hash_table_replace()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 09:22:34 +03:00
Tapani Pälli
c692581ae8 glcpp: link with tests/common.c
So that prog_hash_table can use _mesa_error_no_memory function.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-30 09:22:24 +03:00
Juha-Pekka Heikkila
7bfe94694c mesa/main: Add missing null check in _mesa_CreatePerfQueryINTEL()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-05-30 07:22:01 +03:00
Juha-Pekka Heikkila
5c9056d37f mesa/drivers: Add extra null check in blitframebuffer_texture()
If texObj == NULL here it mean there is already GL_INVALID_VALUE
or GL_OUT_OF_MEMORY error set to context.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:21:39 +03:00
Juha-Pekka Heikkila
19f1d137f8 glsl: Add null check in loop_analysis.cpp
Check return value from hash_table_find before using it as a pointer

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:21:12 +03:00
Juha-Pekka Heikkila
77a00c71bb mesa: add missing null check in _mesa_NewHashTable()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:20:53 +03:00
Gary Wong
85b6f36ca5 loader: add optional /sys filesystem method for PCI identification.
Introduce a simple PCI identification method of looking up the answer
the /sys filesystem (available on Linux).  Attempted after libudev, but
before DRM.

Disabled by default (available only when the --enable-sysfs configure
option is specified).

Signed-off-by: Gary Wong <gtw@gnu.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:25:37 -06:00
Gary Wong
090c772b8a loader: allow attempting more than one method of PCI identification.
loader_get_pci_id_for_fd() and loader_get_device_name_for_fd() now attempt
all available strategies to identify the hardware, instead of conditionally
compiling in a single test.  The existing libudev and DRM approaches have
been retained, attempting first libudev (if available) and then DRM (if
necessary).

Signed-off-by: Gary Wong <gtw@gnu.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:25:37 -06:00
Emil Velikov
febec73147 st/egl: do not link against libloader
Move the link to the final targets, like any other place in
mesa/gallium. This allows better visibilty and will prevent
us from including the library archive twice.

Resolves multiple definition of `loader_get_pci_id_for_fd'

multiple definition of `loader_get_pci_id_for_fd'

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79263
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79382
Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-29 20:01:33 +01:00
Emil Velikov
6638c55838 egl_dri2: fix wayland_platform when drm_platform is not set
The build fails with implicit delaration of drmGetCap (xf86drm.h)
Were we're including the header only when building the DRM_PLATFORM.

Wayland backend can operate without DRM_PLATFORM so replace the
guard, and fold in drmGetCap() usage to silence compiler warnings.

Cc: Chad Versace <chad.versace@linux.intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:01:03 +01:00
Matt Turner
dfd117b857 i965/fs: Set correct number of regs_written for MCS fetches.
regs_written is in units of virtual GRFs.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-29 10:42:25 -07:00
Jerome Glisse
e3cc0d90e1 glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload
There is no reason anymore to load with RTLD_GLOBAL and for some driver
this even result in dlclose failing to unload leading to catastrophic
failure with swrast fallback.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
2014-05-29 13:32:21 -04:00
Stéphane Marchesin
c0bd206a14 i915g: Support B5G5R5A1 render targets and textures 2014-05-28 19:53:58 -07:00
Stéphane Marchesin
569c026520 i915g: Support R4G4B4A4 render targets and textures 2014-05-28 19:53:55 -07:00
Stéphane Marchesin
9e59c91a73 i915g: Fix copy region code
This fixes a few issues with it, also cleans up the code.
2014-05-28 19:53:51 -07:00
Connor Abbott
fc7e7cfabc glsl/tests: remove generated tests from the repo
They were made unneccesary by the last commit.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:07:07 -07:00
Connor Abbott
a1d8322fbb glsl/tests: call create_test_cases.py in optimization-test
This way, when someone modifies create_test_cases.py and forgets to
commit their changes again, people will notice.

v2: make sure we parse the right directories and check for existance the
right way.

v3 (Ken): Use $PYTHON2 instead of calling python directly.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:06:45 -07:00
Connor Abbott
6e24111b9c glsl/tests/lower_jumps: fix generated sexpr's for loops
In 088494aa (as well as other commits in the series) Paul Berry modified
the tests for lower_jumps to account for the fact that the s-expression
for the loop IR instruction changed from
(loop () () () () (statements...)) to (loop (statements...)), but he
forgot to update create_test_cases.py which he used to create the tests.
Fix that, so that now create_test_cases.py is synced with the generated
tests.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:06:16 -07:00
Connor Abbott
bbaec0f76c glsl: be more consistent about printing constants
Make sure that we print the same number of digits when printing 0.0 as
any other floating-point number. This will make generating expected
output files for tests easier. To avoid breaking "make check," update
the generated tests for lower_jumps before the next commit which will
bring create_test_cases.py in line with them.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:05:59 -07:00
Brian Paul
a7aca3919b glsl: replace strncmp("gl_") calls with new is_gl_identifier() helper
Makes things a little easier to read.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-28 15:06:07 -06:00
Brian Paul
f9cecca7a6 glsl: fix use-after free bug/crash in ast_declarator_list::hir()
The call to get_variable_being_redeclared() may delete 'var' so we
can't reference var->name afterward.  We fix that by examining the
var's name before making that call.

Fixes valgrind warnings and possible crash when running the piglit
tests/spec/glsl-1.30/execution/clipping/vs-clip-distance-in-param.shader_test
test (and probably others).

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

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-28 15:06:07 -06:00
Kenneth Graunke
bb9623a1a8 i965: Fix repeated usage of rectangle texture coordinate scaling.
Previously, we set up new entries in the params[] array on every access
of a rectangle texture.  Unfortunately, we only reserve space for
(2 * MaxTextureImageUnits) extra entries, so programs which accessed
rectangle textures more times than that would write off the end of the
array and likely crash.

We don't really have a decent mapping between the index returned by
_mesa_add_state_reference and our index into the params array, so we
have to manually search for it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78691
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
2014-05-28 13:12:10 -07:00
José Fonseca
9ec7cb8aa0 egl-static: Fix undefined reference to `loader_*'
Trivial.  Better than a broken build.
2014-05-28 10:33:33 +01:00
Topi Pohjolainen
a6022e5405 meta/blit: Use gl_FragColor also in the msaa blit shader
Fixes framebuffer_blit_functionality_multisampled_to_singlesampled_blit
es3 cts test on bdw. Also fixes this on ivb when ivb is forced to use
the meta path.

No piglit regressions on IVB.

Further input from Ken:

 "Unfortunately, this doesn't fix MRT for integer data.

  In the single-sampled case, since we're directly copying data, we were
  read/copy/write data as "float" values, which actually contained the
  integer bits.  Here, we can't do that since we need to process the
  actual integer data.

  I do wonder if we could use intBitsToFloat/uintBitsToFloat to stuff the
  integer bits in the float gl_FragColor output.  Just a crazy idea.

  In the long term (post 10.2), I think we should draft an extension that
  allows you to do "layout(location = all)" on user-defined fragment
  shader outputs.  (Or some similar syntax.)"

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-05-28 10:32:29 +03:00
Alexandre Courbot
ecee4c4229 nvc0/ir: use SM35 ISA with GK20A
GK20A is mostly compatible with GK104, but uses the SM35 ISA. Use
the GK110 path when this chip is detected.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-27 22:12:40 -04:00
Alexandre Courbot
1973d79e27 nvc0: add GK20A 3D class
GK20A is mostly compatible with GK104, but features a new 3D
class. Add it to the relevant header and use it when GK20A is
detected.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-27 22:12:40 -04:00
Kenneth Graunke
4b846e231e i965/sf: Replace push/pop in brw_emit_anyprim_setup.
Each of the subroutine emitters alter the predication state, but
otherwise don't change anything (or put it back when they do).
Resetting predication at the end makes these functions idempotent with
regard to the default instruction state - which is a nice property.

With that in place, push/pop is no longer necessary.

v2: Improve whitespace (requested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke
471bff4c62 i965/sf: Drop unnecessary push/pop in copy_z_inv_w.
brw_MOV doesn't alter the default instruction state, so this does
nothing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke
0f9eeae878 i965/sf: Drop unnecessary push/pop in flatshading code.
brw_JMPI sets predicate_control to BRW_PREDICATE_NONE, but that's
already the value coming in.  Otherwise, nothing changes state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke
d9cac44a14 i965/sf: Move brw_compile::flag_value to brw_sf_compile.
This field is only used to track the current value of the flag register
during the SF compile.  It has no place in the common compiler code.

While we're changing every call, drop the 'brw' prefix from the function
since it's static.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
e287f5937f i965/sf: Move brw_set_predicate_control_flag_value to brw_sf_emit.c.
Only the Gen4-5 SF program compiler actually uses this function; move
it there.  Soon the fields will be moved out of brw_compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
41afb3ade4 i965/sf: Drop useless push/pop state from flag register mashing code.
There's no point in pushing and popping the default state; the code
between the two stack operations doesn't alter anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
2747f6a1f9 i965/sf: Drop unnecessary push/pop in do_twoside_color.
None of the assembly emitters called between push and pop actually
change the state.  So, we can drop these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
09655bb81b i965: Don't implicitly set predicate default state in brw_CMP.
Previously, brw_CMP with a null destination implicitly set the default
state to make future instructions predicated.  This is messy and
confusing - emitting a CMP that populates the flag register and later
using it to predicate instructions are logically separate.  With the
main compiler, we may even schedule instructions between the CMP and the
user of the flag value.

This patch simplifies brw_CMP to just emit a CMP instruction, and not
mess with predication.  It also updates all necessary callers.  These
mostly fell into two patterns:

1. brw_CMP followed by brw_IF.

   We don't need to do anything special here; brw_IF already sets up
   predication appropriately.

2. brw_CMP followed by a single predicated instruction.

   The old model was to call brw_CMP, emit the next (predicated)
   instruction, then disable predication for any instructions beyond
   that.  Instead, just explicitly set predicate_control on the single
   instruction we want to predicate.  It's no more code, and requires
   less cross-module knowledge.

This drops setting flag_value to 0xff as well, which is a field only
used by the SF compile.  There is only one brw_CMP call in the SF code,
which is in do_twoside_caller, and called at the start of
brw_emit_tri_setup, where flag_value is already 0xff.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
b07c4b1d9d i965: Drop unnecessary predication default state resets in clip code.
Presumably, this was to reset the default state of predication_control
from brw_CMP.  But brw_CMP only sets that if dst is ARF null, which it
isn't here.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke
a5bb24d769 i965/sf: Reset flag_value to 0xff before emitting SF subroutines.
When compiling any of the SF program variants, flag_value starts off as
0xff and will be modified when generating code.

brw_emit_anyprim_setup emits several subroutines, saving and restoring
flag_value across each of them.  Since it starts out as 0xff, this is
equivalent to simply setting it to 0xff at the start of each subroutine.

Resetting the value makes more logical sense; each subroutine doesn't
know whether one of the others even executed, much less what it did
to the flag register.

This also lets us to drop the brw_set_predicate_control_flag_value call
from brw_init_compile: predicate is already initialized to
BRW_PREDICATE_NONE by the memset, and the value of flag_value is
irrelevant (as it's only used by the SF compiler).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:00 -07:00
Leo Liu
b3ad853a2c st/omx/enc: implement restricted b frames pattern
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-27 16:56:55 +02:00
Leo Liu
cc6c76e8f6 radeon/vce: implement non-referenced frames
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-27 16:56:52 +02:00
Leo Liu
8e0eae4c3d vl: add interface for non-referenced frames
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-27 16:56:32 +02:00
Topi Pohjolainen
57730d67f6 i965/meta: Store stencil texturing mode
Meta path needs to keep the current texture object's state. Fixes
the following gles3 cts tests on bdw:

framebuffer_blit_functionality_negative_width_blit.test: fail
framebuffer_blit_functionality_all_buffer_blit.test: fail
framebuffer_blit_functionality_negative_height_blit.test: fail
framebuffer_blit_functionality_missing_buffers_blit.test: fail
framebuffer_blit_functionality_negative_dimensions_blit.test: fail
framebuffer_blit_functionality_minifying_blit.test: fail
framebuffer_blit_functionality_magnifying_blit.test: fail

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-27 09:31:27 +03:00
Topi Pohjolainen
c246828c4d meta/blit: Add stencil texturing mode save and restore
v2 (Ken): Only restore the mode if it has changed.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-27 09:31:07 +03:00
Stéphane Marchesin
328e7e7742 i915g: Fix shader disasm code
This broke when I separated declarations/shader.
2014-05-26 23:08:49 -07:00
Stéphane Marchesin
82a76e61e7 i915g: Fallback to sw for npot copies
i915g's npot support is incomplete, so let's not use it for copies.
This fixes a bunch of piglit tests.
2014-05-26 23:08:49 -07:00
Stéphane Marchesin
b419ca937a i915g: handle more formats in copy
We can handle depth, luminance,... copies by simply replacing the
format with a known format of the same bpp.
2014-05-26 23:08:49 -07:00
Tobias Klausmann
a26e2bc2e3 nvc0: implement clear_buffer
Provide an accelerated path for ARB_clear_buffer_object

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-26 21:17:14 -04:00
Matt Turner
4c7bf8a704 i965: Switch types D->UD when possible to allow compaction.
Number of compacted instructions: 827404 -> 833045 (0.68%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-26 13:58:58 -07:00
Matt Turner
0d3f83f4ad Revert "i965: Don't make instructions with a null dest a barrier to scheduling."
This reverts commit 42a26cb5e4.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78648
2014-05-26 11:47:15 -07:00
Matt Turner
a39428cf5c Revert "i965/fs: Simplify interference scan in register coalescing."
This reverts commit 5ff1e446d4.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77704
2014-05-26 11:47:13 -07:00
Matt Turner
fc025a6719 Revert "i965/fs: Give up in interference check if we see a WHILE."
This reverts commit 55de1c035c.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-26 11:47:04 -07:00
Matt Turner
ccb1ea8a15 Revert "i965/fs: Reduce restrictions on interference in register coalescing."
This reverts commit f770123f58.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78692
2014-05-26 11:46:52 -07:00
Ilia Mirkin
0d699530ff nvc0: revert mistaken logic to collapse color outputs to the beginning
In commit af38ef907, I added a "fix" to color outputs not being assigned
correctly when sample mask was being output. This was totally wrong --
the color indices (i.e. "si" values) were the ones that were wrong. Undo
that hunk.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-26 14:53:26 -04:00
Ilia Mirkin
ab7bd7093d mesa/st: fix color outputs in presence of sample mask output
Commit c5d822dad9 added support for sample mask incorrectly. It became
treated as a color output, and messed up the color output indices.
Revert the hunk that did that, and add explicit support just like for
depth/stencil writes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-05-26 14:00:11 -04:00
Rob Clark
aa78c4586d freedreno/a3xx: texture fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-26 09:03:09 -04:00
Rob Clark
2456be63e9 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-26 08:58:17 -04:00
Rob Clark
286863939f freedreno: few caps fixes
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-26 08:56:27 -04:00
Vinson Lee
f0748b5014 mesa/x86: Fix build with clang <= 3.3.
clang <= 3.3 cpuid.h does not define contants for feature bits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79095
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-25 21:39:30 -07:00
Matt Turner
6148e94e26 i965: Don't treat HW_REGs as barriers if they're immediates.
We had a handful of cases where we'd used brw_imm_*() to generate an
immediate, rather than fs_reg(). We shouldn't do that but we shouldn't
limit scheduling flexibility on account of immediate arguments either.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-25 20:16:46 -07:00
Matt Turner
c938be8ad2 i965/fs: Don't use brw_imm_* unnecessarily.
Using brw_imm_* creates a source with file=HW_REG, and the scheduler
inserts barrier dependencies when it sees HW_REG. None of these are
hardware-registers in the sense that they're special and scheduling
shouldn't touch them. A few of the modified cases already have HW_REGs
for other sources, so it won't allow extra flexibility in some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-25 20:16:41 -07:00
Emil Velikov
7a63bd960c automake: correctly append the version-script
Turns out that the AC conditional did not include the
the version-scripts as expected. Rather it truncated
the remaining linker flags.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-05-25 23:21:47 +01:00
Emil Velikov
239df5b654 targets/libgl-xlib: hide all the exported symbol mayhem
Leave only the gl/glx and mangled gl symbols.
XMesa* was never an official interface and the only
user of it was mesa-demos, while they were still in
the same repo as mesa.

v2: Conditionally use the version-script.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:47 +01:00
Emil Velikov
7e613f4683 targets/osmesa: include mangled gl symbols
Missed out with commit d4c3968c25

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Emil Velikov
a75baba2f1 targets/xa: limit the amount of exported symbols
In the presence of LLVM the final library exports every symbol from
the llvm namespace. Resolve this by using a version script (w/o the
version/name tag).

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

v2: Conditionally include the version-script.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Emil Velikov
ce12bbd107 dri_util: keep __dri2ConfigOptions symbol private
The symbol was added with commit 45e2b51c853(DRI2/GLX: check for
vblank_mode in DRI2 GLX code) but was never used as such according
to git log.

Possibly it was marked as public due to confusion with
__driConfigOptions which was used for dri1 drivers.

Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Kai Wasserbäch
97aa256b19 targets/opencl: Fix (static) linking with LLVM (v2)
Without this, I get linking failures (static linking).

The static linking is sort of required for me, because otherwise Steam and
applications using the Steam runtime regularily fail because my LLVM was
compiled and linked against a newer libgcc_s, libstdc++, etc. and uses
features from those newer versions. And instead of Steam just not
starting, my X starts crashing, whenever libGL fails to load a (32 bit)
driver.

Since I hate crashes of X and I don't think Valve/Steam will behave like
a proper distribution soon (rebuilds versus current Debian Testing, since
they base their Steam OS off that), I need a radeonsi which carries its
own LLVM within and doesn't care about what the runtime sets. This means
linking Mesa statically.

v1 → v2: Move logic to configure.ac

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2014-05-25 23:21:46 +01:00
Emil Velikov
eb2241f8a9 glx: do not leak dri3Display
v2: Do not wrap the code in ifdef HAVE_DRI3 (suggested by Keith)

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Emil Velikov
b52a530ce2 gallium/egl: st_profiles are build time decision, treat them as such
The profiles are present depending on the defines at build time.
Drop the extra functions and feed the defines directly into the
state-tracker at build time.

v2: Drop unused variable i.

Acked-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-25 23:21:46 +01:00
Emil Velikov
a9afdcc3a1 dri_util: set implemented version of the DRI_CORE extension
... rather than the one defined in our internal interface (dri_interface.h)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-05-25 23:21:45 +01:00
Matt Turner
c9fd68408b i965/fs: Don't modify ann_count if not debugging.
If we make ann_count non-zero, annotation_finalize() won't bail.

Not modifying it seems to make the code more clear than would modifying
annotation_finalize().
2014-05-25 10:32:35 -07:00
Matt Turner
c2c639ecf6 Revert "i965/fs: Change fs_visitor::emit_lrp to use MAC for gen<6"
This reverts commit a6860100b8.

Why this code didn't work in all circumstances is unknown and without a
working Ironlake simulator (which uses a different AUB format) we'll
probably never know, short of a lot of experimentation, and spending a
bunch of time to try to optimize a few instructions on Ironlake is not
time well spent.

Moreover, for mix(vec4, vec4, vec4) using the accumulator introduces a
dependence between the otherwise independent per-component calculations.
Not using the accumulator, even if it means an extra instruction per
component might be preferable. We don't know, we don't have data, and
we don't have the necessary register on Ironlake for shader_time to tell
us.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77707
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
db42dd8952 Revert "i965/vec4: Change vec4_visitor::emit_lrp to use MAC for gen<6"
This reverts commit 2dfbbeca50 with the
comment about MAC and implicit accumulator removed.

Why this code didn't work in all circumstances is unknown and without a
working Ironlake simulator (which uses a different AUB format) we'll
probably never know, short of a lot of experimentation, and spending a
bunch of time to try to optimize a few instructions on Ironlake is not
time well spent.

Moreover, for mix(vec4, vec4, vec4) using the accumulator introduces a
dependence between the otherwise independent per-component calculations.
Not using the accumulator, even if it means an extra instruction per
component might be preferable. We don't know, we don't have data, and
we don't have the necessary register on Ironlake for shader_time to tell
us.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77703
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
492af22fb4 i965: Remove useless typo'd debugging messages.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
f3cb2e6ed7 i965: Move brw_land_fwd_jump() to compilation unit of its use.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
424303db7f i965/fs: Use next_insn_offset rather than nr_insn.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-24 23:03:24 -07:00
Matt Turner
99af02fb17 i965: Emit 0.0:F sources with type VF instead.
Number of compacted instructions: 817752 -> 827404 (1.18%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:24 -07:00
Matt Turner
fb977c90d1 i965: Emit ARF:UD for non-present src1 on Gen6+.
Enables the next commits to compact more instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:24 -07:00
Matt Turner
1acb3a290e i965: Support compacted instructions with immediate sources.
Note the weirdness with src1 subregs. The compacted immediate fields are
uncompacted to bits [127:96] and the high five bits of the subreg
mapping maps to bits [100:96].

Number of compacted instructions: 790085 -> 817752 (3.50%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:24 -07:00
Matt Turner
8942f44c8d i965: Use next_offset() in instruction compaction code.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
392cbc2f93 i965: Move next_offset() to brw_eu.h for use elsewhere.
Also perform arithmetic on char* rather than void* since the latter is a
GNU C extension not available in C++.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
e32e69cc27 i965: Rename next_ip() -> next_offset().
That we were comparing its return value with offsets should have been a
clue. :)

Make it take a void *store in preparation for making the function useful
elsewhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
f0f7fb181f i965: Print disassembly after compaction.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
b5fd762474 i965/fs: Make patch_discard_jumps_to_fb_writes return bool.
... to tell us whether it emitted any code. Will be used to determine
whether we need to skip an annotation for it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-24 23:03:23 -07:00
Matt Turner
a35b9cb625 i965: Add annotation data structure and support code.
Will be used to print disassembly after jump targets are set and
instructions are compacted, while still retaining higher-level IR
annotations and basic block information.

An array of 'struct annotation' will live along side the generated
assembly. The generators will populate the array with their IR
annotations, and basic block pointers if the instructions began or ended
a basic block pointer.

We'll then update the instruction offset when we compact instructions
and then using the annotations print the disassembly.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
59f4e80d53 i965/fs+blorp: Remove left over dump_file arguments.
Were used by the blorp unit test programs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-24 23:03:23 -07:00
Matt Turner
cd1c1d302b i965/fs: Don't hardcode DEBUG_WM in generic fs code.
Similar to Paul's commit e9fa3a944 except brw_fs_generator's debug_flag
is for DEBUG_WM and DEBUG_BLORP.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:23 -07:00
Matt Turner
9976294e86 i965: Pass in start_offset to brw_compact_instructions().
Let's us avoid recompacting the SIMD8 instructions when we compact the
SIMD16 program.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:22 -07:00
Matt Turner
2afdd2f40b i965: Delete unused brw_blorp_blit_test_compile(). 2014-05-24 23:03:22 -07:00
Matt Turner
dd0e1c3aff i965/cfg: Make DO instruction begin a basic block.
The DO instruction doesn't exist on Gen6+. Since before this commit, DO
always ended a basic block, if it also happened to start one (e.g., a
while loop inside an if statement) the block containing only the DO
would actually contain no hardware instructions.

Pre-Gen6's WHILE instructions jumps to the instruction following the DO,
so strictly speaking we won't be modeling that properly, but I claim
there is actually no functional difference.

This will simplify an upcoming change where we want to mark the first
hardware instruction in the loop as beginning a block, and the last
instruction before the loop as ending one.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-24 23:03:22 -07:00
Jeremy Huddleston Sequoia
04ce3be401 darwin: Guard Core Profile usage behind a testing envvar
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-24 20:41:38 -07:00
Jeremy Huddleston Sequoia
9eb1d36c97 darwin: Write errors in choosing the pixel format to the crash log
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-24 20:41:35 -07:00
Joakim Sindholt
404387ecd7 nv50: count wrapped textures towards the tex_obj count
But don't count their size towards the allocated memory, since that
belongs to whoever created it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
caa34a7a64 nvc0: assert that we have vertex elements state
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
2595682689 nvc0: use PRIxPTR for sizeof()
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
7669e362ab nv50,nvc0: allow 15,16,30 bpp display formats
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
b9142c246d nv50,nvc0: handle guard band defines
[imirkin: moved default case out of switch]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
d479713d25 nv50/ir/tgsi: optimize KIL
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:39 -04:00
Christoph Bumiller
452a4151aa nv50/ir: fix lowering of predicated instructions (without defs)
Note that predicated instructions with defs are still not supported
because transformation to SSA doesn't handle them yet.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
3b0867f35b nv50/ir/opt: fix constant folding with saturate modifier
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
2f2d1b3d9b nv50/ir/tgsi: TGSI_OPCODE_POW replicates its result
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
49eccef06b nv50,nvc0: set constbufs dirty on pipe context switch
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
200382be85 nv50: setup scissors on clear_render_target/depth_stencil
[imirkin: add logic to also clear the "regular" scissors]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:38 -04:00
Christoph Bumiller
7d11b761f2 nv50,nvc0: always pull out bufctx on context destruction
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 12:34:38 -04:00
Pavel Popov
8dc4a98c44 i965: Properly return *RESET* status in glGetGraphicsResetStatusARB
The glGetGraphicsResetStatusARB from ARB_robustness extension always
returns GUILTY_CONTEXT_RESET_ARB and never returns NO_ERROR for guilty
context with LOSE_CONTEXT_ON_RESET_ARB strategy.  This is because Mesa
returns GUILTY_CONTEXT_RESET_ARB if batch_active !=0 whereas kernel
driver never reset batch_active and this variable always > 0 for guilty
context.  The same behaviour also can be observed for batch_pending and
INNOCENT_CONTEXT_RESET_ARB.

But ARB_robustness spec says:

  If a reset status other than NO_ERROR is returned and subsequent calls
  return NO_ERROR, the context reset was encountered and completed. If a
  reset status is repeatedly returned, the context may be in the process
  of resetting.

  8. How should the application react to a reset context event?
  RESOLVED: For this extension, the application is expected to query the
  reset status until NO_ERROR is returned. If a reset is encountered, at
  least one *RESET* status will be returned. Once NO_ERROR is
  encountered, the application can safely destroy the old context and
  create a new one.

The main problem is the context may be in the process of resetting and
in this case a reset status should be repeatedly returned.  But looks
like the kernel driver returns nonzero active/pending only if the
context reset has already been encountered and completed.  For this
reason the *RESET* status cannot be repeatedly returned and should be
returned only once.

The reset_count and brw->reset_count variables can be used to control
that glGetGraphicsResetStatusARB returns *RESET* status only once for
each context.  Note the i915 triggers reset_count twice which allows to
return correct reset count immediately after active/pending have been
incremented.

v2 (idr): Trivial reformatting of comments.

Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 09:25:04 -07:00
Jon TURNEY
002a3a7427 appleglx: Improve error reporting if CGLChoosePixelFormat() didn't find any matching pixel formats.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-23 15:24:09 +01:00
Jon TURNEY
5a459a036e Fix build of appleglx
Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to
use the applegl direct renderer

Convert src/glx/apple/Makefile to automake

Since the applegl libGL is now built by linking libappleglx into libGL, rather
than by linking selected files into a special libGL:

- Remove duplicate code in apple/glxreply.c and apple/apple_glx.c.  This makes
apple/glxreply.c empty, so remove it

- Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we
need to add those guards to indirect_glx.c, indirect_init.c (via it's
generator), render2.c and vertarr.c so they don't generate anything

Fix and update various includes

glapi_gentable.c (which is only used on darwin), should be included in shared
glapi as well, to provide _glapi_create_table_from_handle()

Note that neither swrast nor indirect is supported in the APPLEGL path at the
moment, which makes things more complex than they need to be.  More untangling
is needed to allow that

v2: Correct apple/Makefile.am for srcdir != builddir

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:07 +01:00
Jon TURNEY
45f9aae004 Make DRI dependencies and build depend on the target
- Don't require xcb-dri[23] etc. if we aren't building for a target with DRM, as
we won't be using dri[23]

- Enable a more fine-grained control of what DRI code is built, so that a libGL
using direct swrast can be built on targets which don't have DRM.

The HAVE_DRI automake conditional is retired in favour of a number of other
conditionals:

HAVE_DRI2 enables building of code using the DRI2 interface (and possibly DRI3
with HAVE_DRI3)

HAVE_DRISW enables building of DRI swrast

HAVE_DRICOMMON enables building of target-independent DRI code, and also enables
some makefile cases where a more detailled decision is made at a lower level.

HAVE_APPLEDRI enables building of an Apple-specific direct rendering interface,
still which requires additional fixing up to build properly.

v2:
Place xfont.c and drisw_glx.c into correct categories.
Update 'make check' as well

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:04 +01:00
Jon TURNEY
ff90a8784c Fix build for darwin
Fix build for darwin, when ./configured --disable-driglx-direct

- darwin ld doesn't support -Bsymbolic or --version-script, so check if ld
supports those options before using them
- define GLX_ALIAS_UNSUPPORTED as config/darwin used to, as aliasing of non-weak
symbols isn't supported
- default to -with-dri-drivers=swrast

v2:
Use -Wl,-Bsymbolic, as before, not -Bsymbolic
Test that ld --version-script works, rather than just looking for it in ld --help
Don't use -Wl,--no-undefined on darwin, either

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:01 +01:00
Emil Velikov
e0372239a5 targets/egl-static: add missing line break in ldflags
Accidently omitted by commit 7b7944ee1c.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-05-23 15:23:59 +01:00
James Legg
846c715abb mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT
glFramebufferRender(..., GL_DEPTH_STENCIL_ATTACHMENT, ..., 0) only
detached the depth buffer and not the stencil buffer.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=79115
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 08:06:02 -06:00
Emil Velikov
d4c3968c25 targets/osmesa: limit the amount of exported symbols
src/gallium/targets/osmesa/Makefile.am |  1 +
src/gallium/targets/osmesa/osmesa.sym  | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 src/gallium/targets/osmesa/osmesa.sym
2014-05-23 07:40:24 -06:00
José Fonseca
172ef0c5a5 gallivm: Disable workaround for PR12833 on LLVM 3.2+.
Fixed upstream.
2014-05-23 11:37:47 +01:00
José Fonseca
2c02f34fcc gallivm: Support MCJIT on Windows.
It works fine, though it requires using ELF objects.

With this change there is nothing preventing us to switch exclusively
to MCJIT, everywhere.  It's still off though.
2014-05-23 11:37:47 +01:00
José Fonseca
94dbc16dc4 mesa/x86: Fix build with clang 3.4.
It defines bit_SSE41 instead of bit_SSE4_1.

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

Trivial.
2014-05-23 11:37:47 +01:00
José Fonseca
c98b704128 mesa: Move declaration to top of block.
To fix MSVC build.  Trivial.
2014-05-23 11:37:47 +01:00
Jordan Justen
57876fee38 meta blit: Set Z texcoord during meta blit to sample the correct layer
If the source renderbuffer has a depth > 0, then send a Z texcoord
which is set to the source attachment Z offset.

This fixes piglit's gl-3.2-layered-rendering-gl-layer-render with the
GL_TEXTURE_2D_MULTISAMPLE_ARRAY case test on i965/gen8.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 00:56:01 -07:00
Kenneth Graunke
746921cbb4 i965: Listen to BRW_NEW_FRAGMENT_PROGRAM for 3DSTATE_PS_BLEND.
brw_color_buffer_write_enabled depends on brw->fragment_program, which
means we have to listen to BRW_NEW_FRAGMENT_PROGRAM.

On most generations, this was only called from a function that already
subscribed.  However, on Broadwell, we failed to listen to the necessary
event in the atom that emits 3DSTATE_PS_BLEND.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 00:42:06 -07:00
Kenneth Graunke
7d3985ca6c i965: Use WE_all for FB write header setup on Broadwell.
I forgot to disable writemasking on the OR and MOV which set the render
target index and "source 0 alpha present to render target" bit.

Using get_element_ud is equivalent and avoids a line-wrap.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-23 00:42:06 -07:00
Tobias Klausmann
f50361cce7 mesa/x86: fix a typos in SSE4.1 detection
Commit a2fb71e23 introduced 32-bit code for SSE4.1. Fix compilation, and
make sure to check ecx for the SSE4.1 bit.

[imirkin: switch sse4.1 to look at ecx]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-22 21:10:08 -04:00
José Fonseca
cfec135de7 mesa: Rely on USE_X86_64_ASM.
This fixes MinGW x64 builds.  We don't use assembly on any of the
Windows builds, to avoid divergence between MSVC and MinGW when testing.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 22:39:46 +01:00
José Fonseca
c59c8f0363 scons: Fix x86_64 build.
x86/common_x86.c is required also for x86_64 builds.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 22:39:42 +01:00
Carl Worth
03a0471832 docs: Import 10.1.4 release notes, add news item. 2014-05-22 11:29:49 -07:00
Matt Turner
a9bc85f3b2 mesa/x86: Brown bag fix for undeclared variable. 2014-05-22 11:02:36 -07:00
Matt Atwood
f935dfc022 i965: Use SSE4.1 runtime detection for intel_miptree_map.
Previous it was a compile-time decision.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 10:17:16 -07:00
Matt Atwood
a2fb71e23b mesa/x86: add SSE4.1 runtime detection.
Add a bit to _mesa_x86_features for SSE 4.1, along with macros to query.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-22 10:17:16 -07:00
Matt Turner
8b9302f2b4 mesa/x86: Support SSE 4.1 detection on x86-64.
Uses the cpuid.h header provided by gcc and clang. Other platforms are
encouraged to switch.
2014-05-22 10:17:16 -07:00
Matt Turner
1a31657a9b mesa: Add uninitialized_vars macro from the Linux kernel. 2014-05-22 10:17:16 -07:00
Vinson Lee
5dd927bbfc configure.ac: Do not enable -Wl,--no-undefined on Mac OS X.
This patch fixes this build error on Mac OS X.

  CCLD     libglapi.la
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-21 22:13:13 -07:00
Alexander von Gluck IV
d4225f803b haiku: Add missing u_memory.h for FREE()
Acked-by: Brian Paul <brianp@vmware.com>
2014-05-21 20:58:06 -04:00
Vinson Lee
8479edf3d7 configure.ac: Remove -fstack-protector-strong from LLVM flags.
-fstack-protector-strong is not supported by clang.

This patch fixes this build error on Fedora 20 with clang.

  CXX      gallivm/lp_bld_debug.lo
clang: error: unknown argument: '-fstack-protector-strong'

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75010
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-21 16:07:00 -07:00
Rob Clark
a4d229b099 freedreno/a3xx: fix blend opcode
Seems the opcodes are slightly different from a2xx.  Resync headers and
move blend_func() helper into hw generation specific code.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-21 17:29:13 -04:00
Timothy Arceri
5a40a00089 mesa: check constant before null check
For most drivers this if statement is always going to fail so check the constant value first.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-22 06:52:03 +10:00
Rob Clark
b81de5352d freedreno/a3xx: fix depth/stencil gmem restore
We already multiply by bytes per pixel for this, so f3ba7611 broke
mem2gmem for depth/stencil.  Drop the now-redundant mutiply by cpp.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-21 16:11:46 -04:00
Eric Anholt
b11d345ab0 i965: Ask the VBO module to actually use VBOs.
Note that this covers the Begin/End rendering path, but not user vertex
arrays (so we can't drop copy_array_to_vbo_array() code).  Improves
performance of isosurf GLVERTEX|TRIANGLES by 16.7506% +/- 4.98934%
(n=20). No difference on openarena (n=10), which was why this was reverted
back in cbde276580.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-21 11:38:55 -07:00
Rob Clark
f3ba761129 freedreno/a3xx: fix depth/stencil GMEM positioning
In cases where there was no color buf bound, there were inconsistancies
in register settings related to position of depth/stencil inside GMEM.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-21 12:06:38 -04:00
Rob Clark
4da8267c36 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-21 12:06:38 -04:00
Rob Clark
0d54904c04 freedreno: use OUT_RELOCW when buffer is written
These aren't buffers we ever read back from CPU, so using incorrect
reloc fxn wasn't really harming anything.  But might as well be correct.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-21 12:06:38 -04:00
Rob Clark
cb9ed57072 rbug: add missing pipe->blit() entrypoint
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-05-21 12:06:38 -04:00
Anuj Phogat
46737cebd3 meta: Use gl_FragColor to output color values to all the draw buffers
_mesa_meta_setup_blit_shader() currently generates a fragment shader
which, irrespective of the number of draw buffers, writes the color
to only one 'out' variable. Current shader rely on an undefined
behavior and possibly works by chance.

From OpenGL 4.0  spec, page 256:
  "If a fragment shader writes to gl_FragColor, DrawBuffers specifies a
   set of draw buffers into which the single fragment color defined by
   gl_FragColor is written. If a fragment shader writes to gl_FragData,
   or a user-defined varying out variable, DrawBuffers specifies a set
   of draw buffers into which each of the multiple output colors defined
   by these variables are separately written. If a fragment shader writes
   to none of gl_FragColor, gl_FragData, nor any user defined varying out
   variables, the values of the fragment colors following shader execution
   are undefined, and may differ for each fragment color."

OpenGL 4.4 spec, page 463, added an additional line in this section:
  "If some, but not all user-defined output variables are written, the
   values of fragment colors corresponding to unwritten variables are
   similarly undefined."

V2: Write color output to gl_FragColor instead of writing to multiple
    'out' variables. This'll avoid recompiling the shader every time
    draw buffers count is updated.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-21 08:43:14 -07:00
Anuj Phogat
bee2915210 meta: Refactor _mesa_meta_setup_blit_shader() to avoid duplicate shader code
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-21 08:43:13 -07:00
Ilia Mirkin
cdeb7004e0 tgsi: add GS_INVOCATIONS to property names array
In commit 4be146b1, I neglected to add the new property to the strings
array. This leads to the string '(null)' to be printed instead when
converting a GS shader to text.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-21 09:31:16 -04:00
Ilia Mirkin
28360fcad7 nv50,nvc0: fix 3d blits with mipmap levels
Make sure to normalize the z coordinates as well as the x/y ones when
there are mipmaps present. Fixes 3d mipmap generation, which now uses
the blit path.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
2014-05-21 09:31:16 -04:00
Ilia Mirkin
d2a3de19c6 nv50/ir: fix constant folding for OP_MUL subop HIGH
These instructions can come in either through IMUL_HI/UMUL_HI TGSI
opcodes, or from OP_DIV constant folding.

Also make sure that the constant foldings which delete the original
instruction still get counted as having done something.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
2014-05-21 09:31:16 -04:00
Ilia Mirkin
d3a5cf052c nv50/ir: fix s32 x s32 -> high s32 multiply logic
Retrieving the high 32 bits of a signed multiply is rather annoying. It
appears that the simplest way to do this is to compute the absolute
value of the arguments, and perform a u32 x u32 -> u64 operation. If the
arguments' signs differ, then negate the result. Since there is no u64
support in the cvt instruction, we have the perform the 2's complement
negation "by hand".

This logic can come into use by the IMUL_HI instruction (very unlikely
to be seen), as well as from constant folding of division by a constant.
Fixes dolphin's divisions by 255.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
2014-05-21 09:31:16 -04:00
Kenneth Graunke
1472584397 i965/fs: Assume fragment color clamping is off when precompiling.
Modern applications frequencly use both UNORM buffers and FLOAT buffers
with color clamping disabled.  (FLOAT with clamping explicitly enabled
and SNORM buffers appear to be less common.)  We don't need to emit
saturates in the fragment shader in either of the common cases.

Mesa sets ctx->Color._ClampFragmentColor to false if all the color
buffers are UNORM.  Also, for GL_FIXED_ONLY mode (the default in
legacy OpenGL), it will be false if any FLOAT buffers are bound.
Since the common case is false, that should be our default.

Thanks to Roland Scheidegger for pointing out some faulty logic
in v1 of this patch (unnecessary code and incorrect explanations).

v2: Drop superfluous code and reword commit message.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-21 00:29:30 -07:00
Sarah Sharp
c524f3ef91 egl: Add EGL_CHROMIUM_sync_control extension.
Chromium defined a new GL extension (that isn't registered with Khronos).
We need to add an EGL extension for it, so we can migrate ChromeOS on
Intel systems to use EGL instead of GLX.

http://git.chromium.org/gitweb/?p=chromium/src/third_party/khronos.git;a=commitdiff;h=27cbfdab35c601f70aa150581ad1448d0401f447

The EGL_CHROMIUM_sync_control extension is similar to the GLX extension
OML_sync_control, but only defines one function,
eglGetSyncValuesCHROMIUM, which is equivalent to glXGetSyncValuesOML.

http://www.opengl.org/registry/specs/OML/glx_sync_control.txt

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jamey Sharp <jamey@minilop.net>
Cc: Ian Romanick <idr@freedesktop.org>
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
2014-05-20 15:19:48 -07:00
Sarah Sharp
f6e50994e1 Import eglextchromium.h from Chromium.
In order to support the (currently unregistered) Chromium-specific EGL
extension eglGetSyncValuesCHROMIUM on Intel systems, we need to import
the Chromium header that defines it.  The file was downloaded from

https://chromium.googlesource.com/chromium/chromium/+/trunk/ui/gl/EGL/eglextchromium.h

It is subject to the license found at

https://chromium.googlesource.com/chromium/chromium/+/trunk/LICENSE

I have imported the header file and added the license text to the top.
The only change was to fix the include guard on the Chromium header to
change the last line from a #define to a #endif, which makes the header
actually compile.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: Jamey Sharp <jamey@minilop.net>
Cc: Ian Romanick <idr@freedesktop.org>
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
2014-05-20 11:31:32 -07:00
Jeremy Huddleston Sequoia
7a109268ab darwin: Fix test for kCGLPFAOpenGLProfile support at runtime
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-20 10:53:43 -07:00
Rob Clark
57e68a91f5 freedreno: don't advertise texture arrays for now
I think a3xx and later should support (it is part of GLES3), but this
isn't needed for the time being and still needs to be reversed.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20 10:52:56 -04:00
Jeremy Huddleston Sequoia
ff5456d1ac glapi: Avoid heap corruption in _glapi_table
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-05-20 01:37:58 -07:00
Rob Clark
52381a7ffb freedreno/a3xx: shadow sampler support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-19 21:17:25 -04:00
Rob Clark
08b9180819 freedreno/a3xx/compiler: refactor trans_samp()
Split it up into some smaller fxns so it doesn't grow into a huge
monster as we add things.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-19 21:17:25 -04:00
Rob Clark
1686a0edc0 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-19 21:17:25 -04:00
Kenneth Graunke
2ecc7268ba meta: Avoid _swrast_BlitFramebuffer in the meta CopyTexSubImage code.
This is a replacement for bd44ac8b5c
that should actually work.

Fixes Piglit's copyteximage-border on swrast, as well as one of
es3conform's packed_pixels_pixelstore test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78546
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-19 17:18:55 -07:00
Kenneth Graunke
54540ea691 meta: Split _swrast_BlitFramebuffer out of the meta blit path.
Separating the software fallbacks from the rest of the meta path (which
is usually hardware accelerated) gives callers better control over their
blitting options.

For example, i965 might want to try meta blit, hardware blits, then
swrast as a last resort.  Splitting it makes that possible.

This updates all callers to maintain the existing behavior (even in the
few cases where it isn't desirable behavior - later patches can change
that).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-19 17:18:55 -07:00
Kenneth Graunke
d89ce333cc meta: Drop unnecessary early returns in _mesa_meta_BlitFramebuffer.
These aren't necessary - all of the following code is predicated on mask
being non-zero, so no code will get executed anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-19 17:18:54 -07:00
Kenneth Graunke
2fa3796bc1 Revert "i965: Don't _swrast_BlitFramebuffer when doing CopyTexSubImage."
This reverts commit bd44ac8b5c.

Fixes:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78842
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78843

Re-breaks:
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705
but that will be fixed properly in a few commits.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-19 17:18:54 -07:00
Brian Paul
75688254d7 docs: update the prerequisites section
SCons is required for Windows.  Add links to flex/bison for Windows.
Reorder items and improve formatting.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-19 16:15:16 -06:00
Topi Pohjolainen
21dddb22c1 i965/fbo: Only try stencil meta blits on gen >= 8
I don't have an ILK at hand but the fix should be trivial.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78872
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-19 11:22:31 -07:00
Kenneth Graunke
0b96d362bf mesa: Disable GL_EXT_framebuffer_multisample_blit_scaled on Broadwell.
It's not properly implemented in the meta code, and we don't have time
to fix it for 10.2.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-19 11:12:30 -07:00
Roland Scheidegger
1e9cbbb1c4 llvmpipe: do IR counting for shader cache management after optimization.
2ea923cf57 had the side effect of IR counting
now being done after IR optimization instead of before. Some quick analysis
shows that there's roughly 1.5 times more IR instructions before optimization
than after, hence the effective shader cache size got quite a bit smaller.
Could counter this with an increase of the instruction limit but it probably
makes more sense to count them after optimizations, so move that code.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-19 17:07:41 +02:00
Vinson Lee
9e74de884a i965: Rename brw_disasm to brw_disassemble_inst.
Fixes build error introduced with commit
4b04152db0.

  CC       test_eu_compact.o
test_eu_compact.c: In function ‘test_compact_instruction’:
test_eu_compact.c:54:3: error: implicit declaration of function ‘brw_disasm’ [-Werror=implicit-function-declaration]
   brw_disasm(stderr, &src, brw->gen, false);
   ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78888
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-19 00:42:18 -07:00
Kenneth Graunke
13edd5f616 i965: Fix a "discards 'const' qualifier" warning.
Trivial.
2014-05-18 23:36:48 -07:00
Kenneth Graunke
09b4f260a7 i965/fs: Finally kill struct brw_wm_compile (better known as 'c').
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
8b994d0f3b i965/fs: Stop copying the program key.
We already have a perfectly good copy of the program key, and nobody is
going to modify it.  The only reason we copied it was because the
brw_wm_compile structure embedded the key rather than pointing to it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
cca6dc9f0f i965/fs: Rip struct brw_wm_compile out of the visitors and generators.
Instead, just pass the key and prog_data as separate parameters.

This moves it up a level - one step further toward getting rid of it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
2d4ac9b5b8 i965/fs: Plumb a mem_ctx all the way through the FS compile.
'c' is going away, but we still need a memory context that lives
for the duration of the compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
25f8fbbf2f i965/fs: Use 'c' as the mem_ctx in fs_visitor.
Previously, the memory context situation was a bit of a mess:

fs_visitor allocated its own memory context, and freed it in the
destructor.  However, some data produced by fs_visitor (such as the list
of instructions) needs to live beyond when fs_visitor is "done", so the
caller can pass it to fs_generator.

Everything worked out because brw_wm_fs_emit's fs_visitor variables
happen to not go out of scope until the end of the function.  But that
meant that moving the declaration of, say, the SIMD16 fs_visitor
instance, could cause everything to explode.

Using a memory context that exists for the duration of the compile is
clearer, and should be equivalent.

Ultimately, we don't want to use 'c', but this matches the behavior of
fs_generator and gen8_fs_generator, so it'll be simple to change later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
81b11bf093 i965/fs: Actually free program data on the error path.
We throw away the data generated during compilation on the success path,
so we really ought to on the failure path as well.  The caller has no
access to it anyway, so it's purely leaked.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:20 -07:00
Kenneth Graunke
c96fdeb723 i965/fs: Replace c->key with a direct reference in the generators.
'c' is going away.  This is also a bit shorter.

Marking the key pointer as const will also deter people from changing
it in these classes, as that's absolutely not OK.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
65b2df3ec8 i965/fs: Replace c->key with a direct reference in fs_visitor.
'c' is going away.  This is also shorter.

Marking the key pointer as const will also deter people from changing
it in fs_visitor, as it's absolutely not OK to modify it there.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
b61d055d66 i965/fs: Replace c->prog_data with a direct reference in the generators.
'c' is going away.  This is also a bit shorter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
8a04e0de8b i965/fs: Replace c->prog_data with a direct reference in fs_visitor.
'c' is going away.  This is also a bit shorter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
55f4e3a06b i965/fs: Move some flags that affect code generation to fs_visitor.
runtime_check_aads_emit isn't actually used currently, but I believe
we should be using it on Gen4-5, so I haven't eliminated it.
See https://bugs.freedesktop.org/show_bug.cgi?id=78679 for details.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
8ef78828fa i965/fs: Move payload register info from brw_wm_compile to fs_visitor.
This data is created by fs_visitor and only used when emitting code,
so keeping it in fs_visitor makes sense.  I decided it would be
reasonable to group these all together in a struct, since they're
highly related.

v2: s/nr_payload_regs/payload.num_regs/ in some comments (chrisf).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:19 -07:00
Kenneth Graunke
c76e6db05f i965/fs: Simplify gl_SampleMaskIn handling.
As far as I can tell, there's no point in allocating an extra register
and generating a MOV---we can just use the copy provided as part of our
thread payload directly.  It's already in the right format.

Of course, there are zero Piglit tests for this.  We don't actually ship
the extension (GL_ARB_gpu_shader5) that exposes this functionality
either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
5cd7cf58e6 i965/fs: Rename c->sample_mask_reg to sample_mask_in_reg.
This is actually for gl_SampleMaskIn, which is quite different than
gl_SampleMask.  Renaming should help avoid confusion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
db9c915abc i965/fs: Move c->last_scratch into fs_visitor.
Nothing outside of fs_visitor uses it, so we may as well keep it
internal.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
7e28bd797d i965/fs: Move total_scratch calculation into fs_visitor::run().
With this one use gone, c->last_scratch is now only used inside
fs_visitor.  The rest of the driver uses prog_data->total_scratch.

We already compute similar prog_data fields in fs_visitor, so this
seems reasonable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
c51163b0cf i965/fs: Move perf_debug about register spilling to a more obvious spot.
The if (!allocated_without_spills) block is an obvious spot for this
performance warning message.

In the Vec4 backend, scratch is also used for indirect access of
temporary arrays.  The FS backend doesn't implement that yet, but
if it did, this message would be inaccurate, since scratch access
wouldn't necessarily mean spilling.  Moving it preemptively fixes that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
db1449b700 i965: Rename brw/gen8_dump_compile to brw/gen8_disassemble.
"Disassemble" is an accurate description of what this function does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:18 -07:00
Kenneth Graunke
4b04152db0 i965: Rename brw_disasm/gen8_disassemble to brw/gen8_disassemble_inst.
We're going to use "disassemble" for the function that disassembles
the whole program.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:17 -07:00
Kenneth Graunke
4a2f0e305c i965: Fix dump_prog_cache to handle compacted instructions.
dump_prog_cache has interpreted compacted instructions as full size
instructions, decoding garbage and complaining about invalid values.

We can just use brw_dump_compile to handle this correctly in less code.
The output format changes slightly, but it's still perfectly acceptable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:17 -07:00
Kenneth Graunke
3285bc97ef i965: Use brw_dump_compile for clip, SF, and old GS programs.
Looping over the instructions and calling brw_disasm doesn't handle
compacted instructions.  In most cases, this hasn't been a problem since
we don't compact prior to Sandybridge.

However, Sandybridge's transform feedback GS program should already be
compacted, and so this ought to fix decoding of that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-18 23:35:17 -07:00
Ilia Mirkin
5b8f1a0f7c nv50/ir: fix integer mul lowering for u32 x u32 -> high u32
UNION appears to expect that all of its sources are conditionally
defined. Otherwise it inserts an unpredicated mov instruction which
overwrites the desired result. This fixes tests that use UMUL_HI, and
much less directly, unsigned integer division by a constant, which uses
this functionality in a peephole pass.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
2014-05-18 17:59:16 -04:00
Ilia Mirkin
4ebaabcccb nv50/ir: make sure that texprep/texquerylod's args get coalesced
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
2014-05-18 17:59:16 -04:00
Rob Clark
acc1651711 freedreno/a3xx: use util_format_compose_swizzles()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 16:05:06 -04:00
Rob Clark
88ba9de917 freedreno/a3xx/compiler: 1D textures
Gallium already gives us height==1 for these, so the texture state is
already setup correctly to emulate 1D textures as a Nx1 2D texture.  We
just need to supply the .y coord.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 15:23:53 -04:00
Rob Clark
6f84f64643 freedreno: fix caps
In particular, we want mesa to emulate primitive restart for us.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 15:22:55 -04:00
Rob Clark
f7debd4a3e freedreno: fix index buffer offset
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-18 15:22:25 -04:00
Rob Clark
5646319f25 freedreno/a3xx: add sRBG texture support
That was easy.  Turns out it is just a matter of setting one bit.
Enable sampling from sRGB texture, and therefore enable GL 2.1 :-)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-16 20:48:40 -04:00
Rob Clark
9227e6c98c freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-16 20:08:09 -04:00
Roland Scheidegger
3bf2d86c09 gallivm: (trivial) fix compilation with llvm 3.1, 3.2
I actually checked the getModuleIdentifier() function exists with 3.1 but
missed that the file moved...
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=78803
2014-05-17 02:03:35 +02:00
Roland Scheidegger
3a1da0abee gallivm: print out how long it takes to optimize shader IR.
Enabled with GALLIVM_DEBUG=perf (which up to now was only used to print
warnings for unoptimized code).

While some unexpectedly long shader compile times for some shaders were fixed
with 8a9f5ecdb1 this should help recognize such
problems in the future. For now though only available in debug builds (which
are not always suitable for such analysis). And since this uses system time,
it might not be all that accurate (even llvmpipe's own rasterization threads
might be running at the same time, or just other tasks).
(llvmpipe also has LP_DEBUG=counters but this only gives an average per shader
and the the total time for all shaders.)
This prints information like this:
optimizing module fs17_variant0 took 1 msec
optimizing module setup_variant_0 took 0 msec
optimizing module draw_llvm_vs_variant0 took 9 msec
optimizing module draw_llvm_vs_variant0 took 12 msec
optimizing module fs17_variant1 took 2 msec

v2: rebase for recent gallivm compilation changes, and print time for whole
modules instead of functions (otherwise it would be very spammy since it would
include all trivial inline sse2 functions), using the shiny new module names,
prying them off LLVM using new helper (not available through C bindings).
Per function timings, while possibly giving more information (if there'd be
a problem only in for instance the partial not the whole function), don't seem
all that useful for now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 22:50:14 +02:00
Roland Scheidegger
26cac02c51 gallivm: give more verbose names to modules
When we had just one module "gallivm" was an appropriate name. But now we have
modules containing all functions for a particular variant, so give it a
corresponding name (this is really just for helping debugging).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 22:50:14 +02:00
Brian Paul
ef6b6658f9 mesa: fix double-freeing of dispatch tables inside glBegin/End.
We allocate dispatch tables for BeginEnd and OutsideBeginEnd.  But
when we destroy the context we were freeing the BeginEnd and Exec
tables.  If Exec==BeginEnd we did a double-free.  This would happen
if the context was destroyed while inside a glBegin/End pair.  Now
free the BeginEnd and OutsideBeginEnd pointers.

Cc: "10.1", "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-16 07:14:57 -06:00
Matt Turner
730bc124c3 i965: Use binary literals counter select.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 23:31:27 -07:00
Michel Dänzer
2bab95973d glsl_to_tgsi: Make sure the 'shader' member is always initialized
Fixes the valgrind report below and random crashes with piglit on radeonsi.

==30005== Conditional jump or move depends on uninitialised value(s)
==30005==    at 0xB13584E: st_translate_program (st_glsl_to_tgsi.cpp:5100)
==30005==    by 0xB14698B: st_translate_fragment_program (st_program.c:747)
==30005==    by 0xB14777D: st_get_fp_variant (st_program.c:824)
==30005==    by 0xB11219C: get_color_fp_variant (st_cb_drawpixels.c:1042)
==30005==    by 0xB1131AE: st_DrawPixels (st_cb_drawpixels.c:1154)
==30005==    by 0xAFF8806: _mesa_DrawPixels (drawpix.c:162)
==30005==    by 0x4EB86DB: stub_glDrawPixels (generated_dispatch.c:6640)
==30005==    by 0x4F1DF08: piglit_visualize_image (piglit-util-gl.c:1574)
==30005==    by 0x40691D: draw_image_to_window_system_fb(int, bool) (draw-buffers-common.cpp:733)
==30005==    by 0x406C8B: draw_reference_image(bool, bool) (draw-buffers-common.cpp:854)
==30005==    by 0x40722A: piglit_display (alpha-to-coverage-dual-src-blend.cpp:117)
==30005==    by 0x4EA7168: run_test (piglit_fbo_framework.c:52)

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

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-16 11:12:45 +09:00
Roland Scheidegger
b416645387 gallivm: remove optimization workaround when not having sse 4.1
This workaround doesn't list any llvm version, but it was introduced
2010-06-10 (e277d5c1f6). It is unlikely
this bug is still present in llvm versions we support (3.1+).
There's no specific test listed, but I ran lp_test_arit (which uses
the mentioned functions) on llvm 3.1 and 3.3 with sse41 disabled and
this pass enabled without issues.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 01:09:34 +02:00
Roland Scheidegger
93731fbeec gallivm: remove workaround for reversing optimization pass order.
32bit code generation and llvm >= 2.7 used a different optimization pass
order - this code was initially introduced (2010-07-23) by
815e79e72c, apparently due to buggy code being
generated with then brand new llvm versions (which was llvm 2.7 plus pre 2.8
devel).
It seems very highly likely that whatever this bug was it has been fixed in
newer llvm versions, though there's no easy way to test this - the mentioned
piglit test has been removed years ago, and even if you'd build it I'm
sceptical the glsl compiler would still produce the required code to trigger
it.
I have no idea what a good order of passes is, but just remove the workaround
and use the same order everywhere.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-16 01:09:34 +02:00
Matt Turner
8a6f7dfc19 i965/gen8: Make disassembly function match brw's signature.
gen8_dump_compile will be called indirectly by code common used by
generations before and after the gen8 instruction format change.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
1ef52d6ab3 i965: Pass brw_context and assembly separately to brw_dump_compile.
brw_dump_compile will be called indirectly by code common used by
generations before and after the gen8 instruction format change.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
74b252d270 i965: Pull brw_compact_instructions() out of brw_get_program().
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
cce3bea2a7 i965/disasm: Align send instruction meta-information with dst.
Has been misaligned since we added instruction offset prefixes.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
e00fe451b8 i965/disasm: Disassemble the compaction control bit.
brw_disasm doesn't disassemble compacted instructions, so we uncompact
before disassembling them which would unset the compaction control bit.
Instead pass it as a separate argument.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:40 -07:00
Matt Turner
58bcf5996d i965/cfg: Embed exec_node in bblock_link.
In order to remove bblock_link's inheritance of exec_node. Also makes
linked list walk code much nicer.

Acked-by: Eric Anholt <eric@anholt.net>
2014-05-15 15:45:40 -07:00
Matt Turner
a77023c992 i965/cfg: Make brw_cfg.h closer to C-includable.
Only bblock_link's inheritance left.

Acked-by: Eric Anholt <eric@anholt.net>
2014-05-15 15:45:40 -07:00
Matt Turner
d4d843e02f i965/cfg: Protect brw_cfg.h from multiple inclusion.
Acked-by: Eric Anholt <eric@anholt.net>
2014-05-15 15:45:39 -07:00
Matt Turner
9b0108ddc1 glsl: Add C-callable fprint_ir function.
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 15:45:39 -07:00
Topi Pohjolainen
d45fadf11a i965/fb: Use meta path for stencil up/downsampling
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
475216a4f0 i965/meta: Stencil blit for miptree updownsampling
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
b18f6b9b86 i965/fb: Use meta path for stencil blits
This is effective only on gen8 for now as previous generations still
go through blorp.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
d1829badf5 i965/meta: Stencil blits
v2: Create the intel renderbuffer with level hardcoded to zero instead
    of overriding it in the surface state configuration. Also moved the
    dimension adjustments for tiling, mip level, msaa into the render
    buffer creation. Finally prepares for another blit path needed for
    miptree updownsampling.
v3 (Ken): Dropped unnecessary memory context for "ralloc_asprintf()"

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
9d752c098c i965: Extend brw_get_rb_for_first_slice() for specified level/layer
v2: Configure stencil directly for final dimensions instead of
    adjusting bit by bit for tiling, mip level and msaa.
v3 (Ken): Used non-static constant for horizontal alignment

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 21:39:33 +03:00
Topi Pohjolainen
36caae48b2 i965/gen8: Surface state overriding for stencil
v2: Allow hardware to offset accesses to individual layers. Also leave
    the mip-level overriding for the creator of the intel renderbuffer
    to handle. Merged with "i965/gen8: Allow stencil buffers to be
    configured as single sampled"

Ken: I left the "_mesa_problem()" still in place. I think it is clearer
     to remove it in a separate patch.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 21:39:32 +03:00
Topi Pohjolainen
6aefaa4eb2 i965/wm: Surface state overrides for configuring w-tiled as y-tiled
v2: Use intel_mipmap_tree::total_width in order to get correct alignment
    automatically. Also use "mt->total_height / mt->physical_depth0" as
    surface height allowing hardware to offset to correct slice.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 21:39:32 +03:00
Jordan Justen
103057b2b7 i965 meta up/downsample: Fix renderbuffer _BaseFormat
mt->format is of type mesa_format, and therefore can't be
used with _mesa_base_fbo_format which requires a GLenum input.

On gen8, this fixes various piglit fbo-depthstencil tests with
samples > 1.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-15 10:49:05 -07:00
Matt Turner
255357f79b i965: Delete current_insn() function. 2014-05-15 10:35:55 -07:00
Matt Turner
006232bcde i965: Remove blorp unit tests.
They've served their purpose (in transitioning blorp to using
fs_generator) and now they just necessitate large amounts of manual
labor to regenerate if the disassembler changes.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-15 10:35:55 -07:00
Emil Velikov
39ae284a69 egl-static: include libradeonwinsys.la only once
With this and the previous patch, we no longer have multiple
definitions in the final egl_gallium.so.

v2: Drop duplicate libloader link.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com> (v1)
Reviewed-by: Tom Stellard <thomas.stellard@amd.com> (v1)
2014-05-15 17:32:31 +01:00
Emil Velikov
d812c74582 gallium/radeon: link in libradeon.la at target level
It makes more sense to link the core and common parts of the driver as the
target is build. Additionally this will help us drop duplicating symbols
for targets that static link mulitple pipe-drivers. Only egl-static needs
that currently with more to come.

To simplify things a bit add HAVE_GALLIUM_RADEON_COMMON variable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-05-15 17:32:30 +01:00
Emil Velikov
6fcc0b0ba5 gallium/radeon: build only a single common library libradeon
Just fold libllvmradeon in libradeon.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-05-15 17:32:30 +01:00
Rob Clark
670418740f freedreno/a3xx: fix write to bogus register
The loops for updating the multiple packed fields in SP_VS_OUT[] and
SP_VS_VPC_DST[] will zero out one register beyond the last that on
required.  Which is normally not a problem (and is kinda convenient
when looking at cmdstream dumps) unless we have maximum (16) varyings.

Fix loop termination condition so that this does not happen.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:26:35 -04:00
Rob Clark
c37889b5ac freedreno/a3xx: account for special inputs/outputs
We need to size input/output tables big enough for special inputs/
outputs (gl_Position, gl_FrontFacing, etc) which, while they don't
count towards the hw limit of 16 attributes or 16 varyings, we do
still need to track them all the same.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:26:35 -04:00
Rob Clark
5dcf59e142 freedreno/a3xx: fix MAX_INPUTS shader cap
Hardware only supports 16.  Which fd3_shader_variant properly reflected,
but the pipe cap did not, leading to array overflow (and shaders that
could not possibly work).

Also a bunch of asserts to make problems like this easier to see.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:25:53 -04:00
Rob Clark
e1896948da freedreno/a3xx: add debug flag to expose glsl130
We are starting to add integer support to the compiler, which does not
get exercised with glsl feature level 120 and without advertising
integer support.  But doing so breaks too many things right now.  So
for now use a debug flag to conditionally expose the functionality
while it is in development.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:20:29 -04:00
Ryan Houdek
ac2a8e3c9d freedreno/a3xx/compiler: add KILL_IF
The KILL_IF opcode could potentially be merged in to the regular KILL
opcode function.  It was a pain to do so, so I've left is separated
for cleanliness.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:19:43 -04:00
Ryan Houdek
a889049400 freedreno/a3xx/compiler: start adding integer support
Adds a large sum of TGSI opcodes to the a3xx compiler.

For integer opcodes we have 28 opcodes added.
Adds 4 floating point compare opcodes

If GLSL 1.30 is enabled, this allows the GLSL 1.30 piglits to have a
completion amount of 432/641.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 21:19:21 -04:00
Roland Scheidegger
8620730f8a draw: better llvm names for shaders for debugging.
All shaders had the same name.
We could probably use some identifier per shader too, but for now only use
the variant number.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-15 02:35:35 +02:00
Roland Scheidegger
65ad90bd1b llvmpipe: improve setup shader names (for debugging)
The setup shaders were composed of both a fs shader number and a variant
number. But since they aren't tied to a particular fragment shader, the
former was a fixed zero while the latter was also always zero because
it was never assigned. So, similar to what the fs code does, use a ever
increasing number to give it a more catchy name (unlike fragment shaders
though where this number is for each explicitly created shader, we just use
it for the implicitly created variants).
And while here, fix whitespace a bit.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-15 02:35:29 +02:00
Roland Scheidegger
1d28650b55 llvmpipe: kill off llvmpipe_variant_count
Unused except it was increased for both fs and setup shader variants created.
Probably some leftover from ages ago.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-15 02:35:26 +02:00
Roland Scheidegger
3e817e7e56 mesa/st: fix number of ubos being declared in a shader
Previously the code used the total number of ubos being declared in the
linked program (so the ubos of all shaders combined), use the number
from the particular shader instead.
This fixes an assertion failure with piglit arb_uniform_buffer_object-maxblocks
seen in llvmpipe since 8a9f5ecdb1 as it now emits
code for each declared buffer, not just the ones actually used.

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-15 02:35:25 +02:00
Ben Skeggs
9c64cb80d2 nvc0: enable support for maxwell boards
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:54 +10:00
Ben Skeggs
d548d47edf nvc0: add maxwell (sm50) compiler backend
The big missing part here is proper sched data calculations, but
hopefully the chosen placeholder will be sufficient for now.

Passes piglit as well as GK107 does.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:49 +10:00
Ben Skeggs
7b9475fa65 nvc0: maxwell isa has no per-instruction join modifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:46 +10:00
Ben Skeggs
07d3972b49 nvc0: replace immd 0 with $rLASTGPR for emit/restart opcodes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:42 +10:00
Ben Skeggs
3723ff5223 nvc0: move nvc0 lowering pass class definitions into header
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:39 +10:00
Ben Skeggs
bede1bdb48 nvc0: bump sched data member to 32-bits
SM50 backend requires 21 bits per instruction, not 8.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:34 +10:00
Ben Skeggs
c42d7556d3 nvc0: use vertex arrays for eng3d blit
Maxwell doesn't have immediate-mode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:29 +10:00
Ben Skeggs
edb1020ea5 nvc0: restrict "constant vbo" logic to fermi/kepler classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:25 +10:00
Ben Skeggs
322460fdbc nvc0: replace some vb->stride checks with constant_vbo instead
Maxwell no longer has the methods to set constant attributes, and we'll
want to be treating stride 0 vtxbufs the same as for stride > 0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:21 +10:00
Ben Skeggs
9306c3470f nvc0: add maxwell class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:16 +10:00
Ben Skeggs
0079a375a5 nvc0: allow for easier modification of compiler library routines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:54:12 +10:00
Ben Skeggs
737477dac3 nvc0: properly distribute macros in source form
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-15 09:53:56 +10:00
Emil Velikov
e48054d036 docs: Add a note about llvm-shared-libs and libxatracker
Both changes landed in 10.2, and for people not following the
development cycle these will come as a surprise. Note that the
pipe_* interface is not stable.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 23:44:08 +01:00
Brad King
6aac2637a6 automake: Honor GL_LIB for gallium libgl-xlib
Use "@GL_LIB@" in src/gallium/targets/libgl-xlib/Makefile.am to produce
the library name specified by the configure --with-gl-lib-name option.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-14 23:44:08 +01:00
Emil Velikov
f57d092199 configure: correctly set LD_NO_UNDEFINED
Commit 11623be934 was meant to have this hunk, which
I accidently dropped during git rebase.

Cc: 10.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
2014-05-14 23:44:08 +01:00
Roland Scheidegger
8a9f5ecdb1 gallivm: only fetch pointers to constant buffers once
In 1d35f77228 support for multiple constant
buffers was introduced. This meant we had another indirection, and we did
resolve the indirection for each constant buffer access. This looks very
reasonable since llvm can figure out if it's the same pointer, however it
turns out that this can cause llvm compilation time to go through the roof
and beyond (I've seen cases in excess of factor 100, e.g. from 50 ms to more
than 10 seconds (!)), with all the additional time spent in IR optimization
passes (and in the end all of it in DominatorTree::dominate()).
I've been unable to narrow it down a bit more (only some shaders seem affected,
seemingly without much correlation to overall shader complexity or constant
usage) but it is easily avoidable by doing the buffer lookups themeselves just
once (at constant buffer declaration time).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-14 16:23:33 +02:00
Roland Scheidegger
18c6454ad1 gallivm: fix output stream flushing in error case for disassembly.
When there's an error, also need to flush the stream, otherwise an assertion
is hit (meaning you don't actually see the error neither).
2014-05-14 16:23:33 +02:00
Michel Dänzer
c5828b0599 radeonsi: Fix anisotropic filtering state setup
Bring it back in line with r600g. I broke this in the original radeonsi
bringup. :(

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

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

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-05-14 22:53:30 +09:00
Ilia Mirkin
12d97fb7c1 tgsi: support parsing texture offsets from text tgsi shaders
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 09:40:37 -04:00
Ilia Mirkin
04b7e65814 mesa/st: provide native integers implementation of ir_unop_any
Previously, ir_unop_any was implemented via a dot-product call, which
uses floating point multiplication and addition. The multiplication was
completely pointless, and the addition can just as well be done with an
or. Since we know that the inputs are booleans, they must already be in
canonical 0/~0 format, and the final SNE can also be avoided.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 09:40:37 -04:00
Rob Clark
209522070e gallium/docs: clarify when query results are reset
It wasn't completely clear from the docs, so I had to figure out by
looking at piglit results.  Hopefully this saves the next driver writer
implementing queries some time.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-14 07:54:02 -04:00
José Fonseca
b18b7781b2 gallivm: Remove lp_func_delete_body.
Not necessary, now that we will free the whole module (hence all
function bodies) immediately after compiling.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
a6f5cc66db gallivm: Remove gallivm_free_function.
Unused.  Deprecated by gallivm_free_ir().

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
0b239d9ed9 llvmpipe: Delete unneeded LLVM stuff earlier.
Same as Frank's change to draw module but for llvmpipe module.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
Frank Henigman
ef14f0d59f draw: Delete unneeded LLVM stuff earlier.
Free up unneeded LLVM stuff immediately after generating vertex shader
code.  Saves about 500K per shader.

v2: Don't bother calling gallivm_free_function (Jose)

Signed-off-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
Frank Henigman
865d0312c0 gallivm: Separate freeing LLVM intermediate data from freeing final code.
Split free_gallivm_state() into two steps.  First step is
gallivm_free_ir() which cleans up the LLVM scaffolding used to generate
code while preserving the code itself.  Second step is
gallivm_free_code() to free the memory occupied by the code.

v2: s/gallivm_teardown/gallivm_free_ir/ (Jose)

Signed-off-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
Frank Henigman
2c73102dc3 gallivm: One code memory pool with deferred free.
Provide a JITMemoryManager derivative which puts all generated code into
one memory pool instead of creating a new one each time code is generated.
This saves significant memory per shader as the pool size is 512K and
a small shader occupies just several K.

This memory manager also defers freeing generated code until you tell
it to do so, making it possible to destroy the LLVM engine while keeping
the code, thus enabling future memory savings.

v2: Fix compilation errors with LLVM 3.4 (Jose)

Signed-off-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
2ea923cf57 gallivm: Run passes per module, not per function.
This is how it is meant to be done nowadays.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
920933e09e gallivm: Use LLVM global context.
I saw that LLVM internally uses its global context for some things, even
when we use our own.  Given ours is also global, might as well use
LLVM's.

However, sepearate contexts can still be enabled with a simple source
code modification, for when the need/benefit arises.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
69f0835ff1 gallivm: Stop using module providers.
Nowadays LLVMModuleProviderRef is just an alias for LLVMModuleRef, so
its use just causes unnecessary confusion.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:05:00 +01:00
José Fonseca
9cf67e51b0 gallivm,draw,llvmpipe: Remove support for versions of LLVM prior to 3.1.
Older versions haven't been tested probably don't work anyway.  But more
importantly, code supporting it is hindering further work.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:04:59 +01:00
José Fonseca
ecef2da0b2 configure: Require LLVM 3.1.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:04:59 +01:00
José Fonseca
c0ef9a67d3 scons: Require LLVM 3.1
Support for prior versions will be removed in the following change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-14 11:04:59 +01:00
Matt Turner
2012599abb i965: Reformat brw_set_src1 so it can be easily found with grep. 2014-05-13 22:40:01 -07:00
Samuel Iglesias Gonsalvez
e0dc018fd5 i965: fix size assert for gen7 in brw_init_compaction_tables()
It should compare with it's own size.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
2014-05-13 22:35:42 -07:00
Iago Toral Quiroga
520dfa4b5c i965: Relax accumulator dependency scheduling on Gen < 6
Many instructions implicitly update the accumulator on Gen < 6. The instruction
scheduling code just calls add_barrier_deps() for each accumulator access on
these platforms, but a large class of operations don't actually update the
accumulator -- mostly move and logical instructions. Teaching the scheduling
code about this would allow more flexibility to schedule instructions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77740
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-13 22:33:59 -07:00
Jonathan Gray
0c0bbe77d0 glsl: simplify the M_PI*f macros, fixes build on OpenBSD
The M_PI*f macros used a preprocessor paste to append 'f'
to M_PI defines, which works if the values are only numbers
but breaks on OpenBSD where M_PI definitions have casts
and brackets to meet requirements of a future version of POSIX,

http://austingroupbugs.net/view.php?id=801
http://austingroupbugs.net/view.php?id=828

Simplify the M_PI*f macros by using casts directly in the defines
as suggested by Kenneth Graunke.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78665
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2014-05-13 22:30:22 -07:00
Carl Worth
a5769ad373 docs: Really add the 10.1.3 release nots this time
Commit a96c3bccf6 intended to add these, but I
forgot to add the file.
2014-05-13 17:30:17 -07:00
Rob Clark
f999c13176 freedreno/a3xx: occlusion query support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 18:33:19 -04:00
Rob Clark
b8f78e1890 freedreno: add support for hw queries
Real GPU queries need some infrastructure to track samples per tile and
accumulate the results.  But fortunately this can be shared across GPU
generation.

See:
https://github.com/freedreno/freedreno/wiki/Queries#hardware-queries

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 18:33:19 -04:00
Rob Clark
13a0cf4480 freedreno/query: allow multiple query implementations
Split out fd_query into an abstract base class, to allow multiple
implementations.  The current sw based queries are moved into
fd_sw_query.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 18:33:19 -04:00
Kenneth Graunke
2265bda513 mesa: Dump ARB_vp/fp source and IR when MESA_GLSL=dump.
As far as I can tell, Mesa hasn't had a convenient way to dump ARB_vp/fp
source until now.  Using MESA_GLSL=dump is convenient, since it means
you can use a single environment variable to dump a program's shaders,
no matter which language they're written in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-13 15:32:16 -07:00
Kenneth Graunke
bd44ac8b5c i965: Don't _swrast_BlitFramebuffer when doing CopyTexSubImage.
The point of copytexsubimage_using_blit_framebuffer is to use a hardware
accelerated BlitFramebuffer path.  If that fails, we shouldn't do a
swrast blit---we should try our CTSI fallback code.

This is especially important for i965 and GLES, where we don't even
create a swrast context.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-13 15:32:16 -07:00
Jordan Justen
c51c192891 i965/gen8: Set depth extent field
The depth extent field is used to limit the allowed slice range that
can be rendered to.

With the previous setting, only slice 0 could be rendered.

This fixes piglit amd_vertex_shader_layer-layered-depth-texture-render.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-13 14:26:41 -07:00
Jordan Justen
294ada2fef i965/gen8 depth: Set depth size based on LOD0 for 3D textures
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-13 14:25:58 -07:00
Jordan Justen
e6d6ed55ab i965/gen7 depth: Set depth size based on LOD0 for 3D textures
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-13 14:25:58 -07:00
Jordan Justen
e47d08adef i965/gen8 renderbuffer: Set depth size based on LOD0 for 3D textures
Fixes piglit's
'gl-3.2-layered-rendering-clear-color-all-types 3d mipmapped'

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-13 14:25:58 -07:00
Jordan Justen
b875f39e29 i965/gen7 renderbuffer: Set depth size based on LOD0 for 3D textures
If blorp is disabled for color clears, then piglit's
'gl-3.2-layered-rendering-clear-color-all-types 3d mipmapped'
will fail.

Currently, gen8 fails similarly on this test because gen8
does not use blorp.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-13 14:25:57 -07:00
Rob Clark
521ee86db7 freedreno/a3xx: add point-size
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 16:54:37 -04:00
Rob Clark
a13a798926 freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-13 16:54:20 -04:00
Bryan Cain
4e974a9cf3 glsl_to_tgsi: remove unnecessary dead code elimination pass
With the more advanced dead code elimination pass already being run,
eliminate_dead_code was making no difference in instruction count, and had
an undesirable O(n^2) runtime. So remove it and rename
eliminate_dead_code_advanced to eliminate_dead_code.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
2014-05-13 14:57:55 -05:00
José Fonseca
1646f4d0fb ralloc: Omit detailed license information about talloc.
That information misleads source code auditing tools to think that
ralloc itself is released under LGPL v3.

Instead, simply state talloc is not licensed under a permissive license.

v2: Use wording suggested by Kenneth.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-13 12:48:38 +01:00
Iago Toral Quiroga
5421617325 i965: Avoid redundant call to brw_merge_inputs() in brw_try_draw_prims()
We always call brw_merge_inputs() right before looping over the primitives but
this can be called inside the loop for each primitive too. In the case we do it
for the first primitive the call is redundant and can be skipped.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-13 10:09:35 +02:00
Iago Toral Quiroga
a143fbb322 glsl: Do not call lhs->variable_referenced() multiple times
Instead take the result from the first call and use it where needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-13 10:01:02 +02:00
Topi Pohjolainen
2a549c43a8 meta: Refactor state save/restore for framebuffer texture blits
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-13 10:04:25 +03:00
Kristian Høgsberg
06842d436e wayland: Move version 2 request to end of interface specification
We're moving towards requiring interface additions to be appended to the
end of the interface block.  No functional change, opcodes are assigned as
before, but version 2 additions are now grouped together, which prevents
a scanner warning.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-05-12 15:55:21 -07:00
Timothy Arceri
9c9dd8ca93 glsl: the number of samplers is already calculated so use it
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-13 07:40:08 +10:00
Eric Anholt
afe3d1556f i965: Stop doing remapping of "special" regs.
Now that we aren't using pixel_[xy] in live variables, nothing is looking
at these regs after the visitor stage.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 09:50:32 -07:00
Eric Anholt
66f5c8df06 i965: Generalize the pixel_x/y workaround for all UW types.
This is the only case where a fs_reg in brw_fs_visitor is used during
optimization/code generation, and it meant that optimizations had to be
careful to not move pixel_x/y's register number without updating it.

Additionally, it turns out we had a couple of other UW values that weren't
getting this treatment (like gl_SampleID), so this more general fix is
probably a good idea (though I wasn't able to replicate problems with
either pixel_[xy]'s values or gl_SampleID, even when telling the register
allocator to reuse registers immediately)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 09:49:27 -07:00
Eric Anholt
11bef60d09 i965: Move has_hiz from the slice to the level.
The value depends only on the level, so no need to store the bool per slice.
Shrinks intel_mipmap_slice from 24 bytes to 16, while slotting into an
existing hole in intel_mipmap_level.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-12 09:49:18 -07:00
Topi Pohjolainen
4dc9c314c8 meta: Refactor configuration of renderbuffer sampling
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
a2952315ac meta: Refactor binding of renderbuffer as texture image
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
ac4db0aa55 meta: Merge compiling and linking of blit program
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
3a43cd0c3e i965/blorp: Expose coordinate scissoring and mirroring
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 17:48:45 +03:00
Topi Pohjolainen
4a92ad5531 i965/gen8: Use helper variables for surface parameters
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-12 17:48:45 +03:00
Ilia Mirkin
8baed87212 nv50,nvc0: fix blit 3d path for 1d array textures
Need to adjust coordinates since the shader receives the array index as
depth in z, but the TEX instruction expects it to be the second
coordinate for a 1D array texture. This fixes fbo-generatemipmap-array.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
4467c0c9fb nv50,nvc0: leave queries on during blit, turn them on for 2d engine
Fixes the new logic of the conditional rendering piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
64a7ddf40d mesa/st: leave current query enabled during glBlitFramebuffer
Also make sure that pipe_blit_info gets zero'd out so that query isn't
accidentally left enabled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
752ce0affb gallium: add bit to pipe_blit_info to leave current query enabled
Previously the implication was that queries should be disabled during
blits. However glBlitFramebuffer() is supposed to obey the current
query, and this new bit will indicate that to the driver.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
863573b9cb nv50: fix setting of texture ms info to be per-stage
Different textures may be bound to each slot for each stage. So we need
to be able to upload ms parameters for each one without stages
overwriting each other.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-05-11 19:26:31 -04:00
Ilia Mirkin
68f47cad0d nv50/ir: make sure to reverse cond codes on all the OP_SET variants
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: "10.2 10.1" <mesa-stable@lists.freedesktop.org>
2014-05-11 19:26:31 -04:00
Rob Clark
83b4ec03e7 freedreno/a2xx: fix compiler warning
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-11 08:58:20 -04:00
Marek Olšák
d9e102b220 radeonsi: prepare depth export registers at compile time
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
9baaa5dd4f radeonsi: simplify depth/stencil export code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
bd2df40a84 radeon/llvm: add support for non-scalar system values
The sample position is one of them.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
250aa93e23 radeonsi: add and use a helper function for loading constants
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
86035cd88d radeonsi: only count CS space for state atoms if we're going to draw
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
023d367ae6 radeonsi: remove unused variable exports_ps in si_pipe_shader_ps
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
315f3c171d radeonsi: use DRAW_PREAMBLE on CIK
It's the same as setting the 3 regs separately, but shorter, and it also
seems to be required on GFX7.2 and later. This doesn't fix Hawaii.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Marek Olšák
58c659703b r600g: simplify framebuffer state size computation
Take the upper bound. The number doesn't have to absolutely correct, only safe.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-10 13:58:46 +02:00
Kenneth Graunke
155f98d49f Revert "i965: Fix depth (array slices) computation for 1D_ARRAY render targets."
This reverts commit e6967270c7.

Chris Forbes pointed out that this is broken for texture views which
restrict the number of slices.  He committed a better fix which makes
this unnecessary.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-09 20:08:38 -07:00
Emil Velikov
a3e78bab7f egl_dri2: cleanup memory leak in dri2_create_context()
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-10 02:09:02 +01:00
Emil Velikov
42770ff94e ilo: destroy the mutex, if winsys creation fails
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-05-10 02:09:02 +01:00
Emil Velikov
326b8e253e glx/tests: Partially revert commit 51e3569573
C++ does not support designated initializers, thus compilation
is not guaranteed to succeed. Surprisingly gcc 4.6.3 fails to
build the code, while version 4.9.0 compiles it without a hitch.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78403
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2014-05-10 02:08:36 +01:00
Emil Velikov
e477d12c33 configure: error out if building GBM without dri
Both backends require --enable-dri, and building an empty libgbm
makes little to no sense. Error out at configure to prevent the
user from shooting themselves in the foot.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78225
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-10 02:08:36 +01:00
Chia-I Wu
510465016b mesa: propagate FragDepthLayout to gl_program
The information was lost during linking, causing the layout to be treated as
FRAG_DEPTH_LAYOUT_NONE.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-09 17:21:53 -07:00
Chris Forbes
417f5ea00d glsl: Rename linker's is_varying_var
Both the ast->IR and linker have functions with this name, but different
behavior.

Rename the linker's version to var_counts_against_varying_limit to be
closer to what it is actually used for.

Suggested by Ian a while back.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-05-10 09:29:13 +12:00
Kenneth Graunke
9584959123 i965: Fix GPU hangs on Broadwell in shaders with some control flow.
According to the documentation, we need to set the source 0 register
type to IMM for flow control instructions that have both JIP and UIP.

Fixes GPU hangs in approximately 10 Piglit tests, 5 es3conform tests,
Unigine Crypt, a WebGL raytracer demo, and several Steam titles.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75478
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75878
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76939
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-09 14:18:13 -07:00
Tom Stellard
93c2ebbd83 radeonsi: Enable geometry shaders with LLVM 3.4.1
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-05-09 12:16:05 -04:00
Tom Stellard
c5d0008325 configure.ac: Add LLVM_VERSION_PATCH to DEFINES
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-05-09 12:16:05 -04:00
Carl Worth
a96c3bccf6 docs: Import 10.1.3 release notes, andd news item. 2014-05-09 07:52:26 -07:00
Thomas Hellstrom
9306b7c171 st/xa: Fix performance regression introduced by commit "Cache render target surface"
The mentioned commit has the nasty side-effect of turning off accelerated
copies.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-05-09 08:40:12 +02:00
Tom Stellard
c5f0c98c49 clover: Destory pipe_screen when device does not support compute v2
v2:
  - Make sure screen was successfully created before destroying it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-09 04:33:03 -04:00
Tom Stellard
c650033b86 pipe-loader: Don't destroy the winsys in the sw loader
The screen takes ownership of the winsys, and is responsible for
destroying it.  Users of pipe-loader should make sure they destory
and  screens they've created to avoid memory leaks.

This fixes a crash in clover introduced by
ce6c17c083 where the pipe-loader was
destroying the winsys while a screen was still using it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-09 04:32:54 -04:00
Chris Forbes
23e9f06569 i965/Gen8: Set up layer constraints properly for depth buffers
Same issues as the previous commit fixed for Gen7:
- Bogus physical->logical layer conversion; depth/stencil surfaces
  are still IMS layout on Gen8.
- mt_layer ignored in layered rendering case, which breaks handling
  of views with MinLayer.
- Render target array extent not set correctly for arrays.

I'm not able to test this one since I can't get a Broadwell yet, but
it's the same set of fixes as for Gen7.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-09 09:46:20 +12:00
Chris Forbes
77d55ef481 i965/Gen7: Set up layer constraints properly for depth buffers
Again, a few problems:
- Layered attachments did not honor MinLayer.
- Non-layered MSAA attachments rendered to the wrong layer due to
  dividing by the layer count. All depth buffers use the IMS layout, so
  the physical layer count == logical layer count.
- Layered attachments were not limited to irb->layer_count, so we could
  render off the end of the texture.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-09 09:46:19 +12:00
Chris Forbes
9269ea599c i965/Gen8: Set up layer constraints properly for renderbuffers
Fixing the same issues the previous commit does for Gen7.

Note that I can't test this one, since I don't have a Broadwell.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-09 09:46:19 +12:00
Chris Forbes
dd43900b7b i965/Gen7: Set up layer constraints properly for renderbuffers
There were a few problems here, which mostly just broke layered
rendering into a view:

- Render target view extent was always set to be == depth. This is
  benign for non-layered-rendering, but allows writes off the end of the
  render target for layered rendering, which ends badly.
- Layered rendering did not honor the mt_layer setting, so would not
  properly handle MinLayer being set on a view.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-09 09:46:19 +12:00
Chris Forbes
cc8c00da88 i965: Fix typo in assert message
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-09 09:46:19 +12:00
Adam Jackson
74388dd24b radeonsi: Don't use anonymous struct trick in atom tracking
I'm somewhat impressed that current gccs will let you do this, but
sufficiently old ones (including 4.4.7 in RHEL6) won't.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-05-08 12:05:58 -04:00
Roland Scheidegger
cf93f86957 llvmpipe: change LP_MAX_SHADER_INSTRUCTIONS limit definition.
When the limit was changed to be defined in terms of LP_MAX_SHADER_VARIANTS
(75f1fea14f) when it was increased, this
inadvertently lowered the limit in some branches (that have a lower
LP_MAX_SHADER_VARIANTS number) when merged. So, make sure the limit is always
at least the number it once was.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-08 16:26:49 +02:00
Roland Scheidegger
9af68e9b1d draw: do not use draw_get_option_use_llvm() inside draw execution paths
1c73e919a4 made it possible to not allocate
the tgsi machine if llvm was used. However, draw_get_option_use_llvm() is
not reliable after draw context creation, since drivers can explicitly
request a non-llvm draw context even if draw_get_option_use_llvm() would
return true (and softpipe does just that) which leads to crashes.
Thus use draw->llvm to determine if we're using llvm or not instead (and
make draw->llvm available even if HAVE_LLVM is false so we don't have to put
even more ifdefs).

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-08 16:26:49 +02:00
Kenneth Graunke
e6967270c7 i965: Fix depth (array slices) computation for 1D_ARRAY render targets.
1D array targets store the number of slices in the Height field.

Fixes Piglit's spec/!OpenGL 3.2/layered-rendering/clear-color-all-types
1d_array single_level, at least when used with Meta clears.

Cc: "10.2 10.1 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-05-07 23:42:11 -07:00
Kenneth Graunke
5c399ca8e4 mesa: Fix MaxNumLayers for 1D array textures.
1D array targets store the number of slices in the Height field.

Cc: "10.2 10.1 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-05-07 23:42:11 -07:00
Kenneth Graunke
ecfc418b68 i965: Enable GL_ARB_texture_view on Broadwell.
This is a port of commit c9c08867ed.
A tiny bit of extra work was necessary to not break stencil texturing.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-07 23:42:11 -07:00
Ilia Mirkin
9d95d64be0 mesa: pass target through to driver when choosing texture format
This only matters for TextureView where the texObj's target has not been
set yet, in all other instances, texObj->target should be the same as
the passed-in target parameter.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
e7047f2917 nv50/ir/gk110: fix set with f32 dest
Should fix comparison opcodes like SGE/SLT/etc which expected a float to
be returned. These were previously getting integer 0/-1 values.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Cc: 10.2 <mesa-stable@lists.freedesktop.org>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
5a40fe03f7 nv50/ir: allow load propagation when flags are defined
The old condition disallowed load propagation any time flags were
defined, even with e.g. set and a constbuf reference. The new condition
disallows it only with immediate propagation. (There are no opcodes that
set the condition flag and have an immediate argument.)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
83b900fd0a mesa/st: pass 4-offset TG4 without lowering if supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-07 20:40:46 -04:00
Ilia Mirkin
d95df4f4e4 gallium: add a cap for supporting 4-offset TG4 opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-07 20:40:46 -04:00
Brian Paul
9ced3fc649 svga: add switch case for PIPE_SHADER_CAP_PREFERRED_IR, remove default case
Remove default switch case so we're warned of missing cases at compile
time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-07 11:32:11 -06:00
Brian Paul
9b1ae44ae1 tgsi: add missing switch cases in tgsi_exec_get_shader_param()
Add cases for PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS and
PIPE_SHADER_CAP_PREFERRED_IR.  Remove default switch case so we
learn of missing cases at compile time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-07 11:32:11 -06:00
Brian Paul
baec25635d gallivm: add PIPE_SHADER_CAP_PREFERRED_IR switch case, remove default
Return PIPE_SHADER_IR_TGSI for the PIPE_SHADER_CAP_PREFERRED_IR query.
Remove default switch case so we learn of missing switch cases at
compile time.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-07 11:32:11 -06:00
Brian Paul
ed8bfaba52 gallium: remove enum numbers from shader cap queries
The enum numbers were just cruft.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2014-05-07 11:32:11 -06:00
Ian Romanick
f7bf37cb13 linker: Fix consumer_inputs_with_locations indexing
In an earlier incarnation of populate_consumer_input_sets and
get_matching_input, the consumer_inputs_with_locations array was indexed
using the user-specified location.  In that version, only user-defined
varyings were included in the array.

In the current incarnation, the Mesa location is used to index the
array, and built-in varyings are included.

This change fixes the unit test to exepect gl_ClipDistance in the array,
and it resizes the arrays to actually be big enough.  It's just dumb
luck that the existing piglit tests use small enough locations to not
stomp the stack. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78258
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-05-07 09:50:14 -07:00
José Fonseca
98934f4aba st/wgl: Advertise WGL_ARB_create_context(_profile).
We added wglCreateContextAttribsARB but not the extension strings.

This allows creation of GL 3.x contexts.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-07 16:15:45 +01:00
José Fonseca
aee501060b st/wgl: Honour request of 3.1 contexts through core profile where available.
Port 5f493eed69 from GLX.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-07 16:15:45 +01:00
Kenneth Graunke
9701c6984d meta: Only clear the requested color buffers.
This path is used to implement both glClear and glClearBuffer; the
latter is only supposed to clear particular buffers.  Core Mesa provides
us that information in the buffers bitmask; we must only clear buffers
mentioned there.

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

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

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77852
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77856
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-06 11:31:31 -07:00
Kenneth Graunke
c1c1cf5f92 meta: Add infrastructure for saving/restoring the DrawBuffers state.
Sometimes we need to configure what draw buffers we render to, without
creating a new FBO.  This path will make that possible.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-06 11:31:29 -07:00
Kenneth Graunke
e526ebf35c meta: Add a new MESA_META_DRAW_BUFFERS bit.
This will be used for saving/restoring the glDrawBuffers state.
For now, make sure that existing users of MESA_META_ALL don't get
the new bit, since they probably won't want it.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-06 11:31:27 -07:00
Kenneth Graunke
7c8df60f31 meta: Unify the GLSL and fixed-function clear paths.
The majority of _mesa_meta_Clear and _mesa_meta_glsl_Clear was the same;
adding a boolean for whether to use GLSL allows us to share most of it
without polluting either path too much.

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

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-06 11:31:21 -07:00
Kenneth Graunke
cde8bad1c9 i965: Always intel_prepare_render() after invalidating front buffers.
Fixes glean/texture_srgb, which hit recursive-flush prevention
assertions in vbo_exec_FlushVertices.

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

Fixes Glean's texture_srgb test.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-06 11:30:54 -07:00
Marek Olšák
2484daa4fd radeonsi: implement ARB_texture_cube_map_array
No LLVM changes needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

v2: updated GL3.txt and relnotes
2014-05-06 17:18:17 +02:00
Marek Olšák
cc71df5652 configure.ac: radeonsi requires EGL_DRM and GBM
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-06 16:59:35 +02:00
Tapani Pälli
e65917f94e glsl: fix bogus layout qualifier warnings
Print out GL_ARB_explicit_attrib_location warnings only
when parsing attribute that uses "location" qualifier.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77245
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-05-06 08:36:40 +03:00
Carl Worth
6dd907c80d docs: Import 10.1.2 release notes, andd news item. 2014-05-05 13:25:44 -07:00
Paulo Sergio Travaglia
97a70f26f2 st/egl: Flush resources before presentation (android - bug 77966)
[olv: Use the real name provided by the patch author.  Ideally this could be
moved to somewhere higher level so that we would not need to create a pipe
context to flush resources.  Plus, it is not clear if flushing resources for
another context is valid.]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-05-05 08:33:14 +08:00
Ilia Mirkin
5cfd45fbc3 docs: mark ARB_stencil_texturing as done for nv50+/r600+
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-04 20:17:25 -04:00
Ilia Mirkin
833f870d9b mesa/st: implement ARB_stencil_texturing
If StencilSampling is enabled on the texture object, pass in an
equivalent stencil-only format.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-05-04 20:10:14 -04:00
Ilia Mirkin
cee22a0b48 nv50,nvc0: add X8Z24_UNORM, fix stencil-only formats
S8_UINT will become useful when ARB_texture_stencil8 becomes supported by
mesa. The other stencil formats are needed for ARB_stencil_texturing.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-04 20:05:44 -04:00
Rob Clark
b7e7ae9f60 xa: fix segfault
Fixes:

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

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

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-04 11:08:10 -04:00
Kenneth Graunke
829cb0423d i965: Set miptree target field when creating from a BO.
Prior to commit 8435b60a35, the region
equivalent of this function called intel_miptree_create_layout, which
set mt->target to target.  With that commit, it no longer copied target.

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

Copying the target fixes this assertion failure.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 23:05:37 -07:00
Ian Romanick
64c4670dd6 mesa: Bump version to 10.3-devel
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 21:43:48 -07:00
Ian Romanick
a06c9791d1 docs: Add missing release notes for ARB_separate_shader_objects
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 17:25:19 -07:00
Eric Anholt
20404e45c7 i965: Move push constant state packets to push constant update time.
-0.553779% +/- 0.423394% effect on cairo-perf-trace runtime on glamor
(n=612)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
113037148d i965: Merge gen8_upload_constant_state into gen7_upload_constant_state.
The two paths are really similar, and the extra conditionals will be
dwarfed by the cost of the actual upload.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
51b79a6571 i965: Refactor gen7_upload_constant_state to look more like gen8.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
1515ceb8fd i965: Drop unnecessary state flag for units on NEW_BINDING_TABLE.
Commit 30259856a8 moved the state packets to
table generation time, but forgot to make this change.  Apparently the
performance win there was about not reemitting the table pointers on
unrelated state changes.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
f9a2679db5 i965/gen7+: Move sampler state packets to the stage sampler state table update.
Now that we have the stage state coming into our setup of sampler states,
it's easy to drop an identifier into it of which stage the stage_state is,
and then look up which packet to emit in a little table.

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

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
680d202d49 i965/gen6: Don't update unit state when samplers change.
There's no remaining dependency between these two packets that I can find.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
02a3449758 i965: Drop a NEW_SAMPLER annotation for use of sampler_count.
The sampler count is set up from the gl_program at draw time, not at
sampler change time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
57ad5a3103 i965: Simplify sampler setup by passing the stage state.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
9e363f0262 i965: Make batch dumping go to stderr, too.
All our other debug goes there.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:40 -07:00
Eric Anholt
55a049b9ae i965: Fix a stale comment reference
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 17:01:39 -07:00
Armin K
0b307afd57 glx: Conditionally compile GLX_MESA_query_renderer DRI3 support
Missed out with commit 625bdd64e5.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 23:20:34 +01:00
Samuel Li
7f8f6790e4 radeonsi: add Mullins pci ids.
Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-05-02 17:30:31 -04:00
Samuel Li
aad669b1e9 radeonsi: add support for Mullins asics.
v2: name defaults to kabini for older llvm
v3: fix llvm version check

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-05-02 17:30:27 -04:00
Alex Deucher
b26175b6c3 configure: bump up libdrm_radeon requirement to 2.4.54
Required for Mullins.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-05-02 17:29:56 -04:00
Ian Romanick
625bdd64e5 dri3: Enable GLX_MESA_query_renderer on DRI3 too
This should have happend around the time of commit 4680d23, but Keith's
DRI3 patches and my GLX_MESA_query_renderer patches crossed in the mail.

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 22:13:58 +01:00
José Fonseca
7ebdc9e48c util: Don't attempt to redefine INFINITY/NAN on VS 2013.
There are now provided by VS.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:47 +01:00
José Fonseca
8c879ac197 mesa: VS 2013 does not provide strcasecmp.
A define is necessary, like for earlier VS versions.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:47 +01:00
José Fonseca
ade79b21e9 egl: Don't attempt to redefine stdint.h types with VS 2010.
Just include stdint.h.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:47 +01:00
José Fonseca
979692a52a scons: Don't use bundled C99 headers for VS 2013.
Use the ones provided by the compiler instead.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
0582800dd6 scons: Don't restrict MSVC_VERSION values.
Saves the trouble of continuously needing to update.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
d69fd5d940 draw: Prevent signed/unsigned comparisons.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
605ef195aa st/vega: Prevent signed/unsigned comparisons.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
42b9f8590d scons: Adjust the warnings for VS.
Silence insignificant warnings so significant warnings have a chance to
stand out.

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

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
José Fonseca
5bd3b91784 util/u_debug_flush: Use util_snprintf.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-05-02 22:04:46 +01:00
Emil Velikov
1c6154c9b4 targets/omx: add nouveau target
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:27 +01:00
Emil Velikov
be1b5feaa0 targets/omx: use GALLIUM_VIDEO_CFLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:27 +01:00
Emil Velikov
ce6c17c083 targets/pipe-loader: cleanup version-script
Drop the version/name tag from the script as it was never
meant to be there. Add swrast_create_screen as it is used
when loading swrast. Rename the file to pipe.sym.

v2: Rebase on top of the LD_NO_UNDEFINED changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 21:48:27 +01:00
Emil Velikov
f743670b9a targets/opencl: hide all the exported llvm/clang mayhem... hopefully
Both llvm and clang polute the exported symbol table, as soon
as we try to link with either one. Other than those two
everything else looks good (clean).

Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 21:48:27 +01:00
Emil Velikov
7b7944ee1c targets/egl-static: freshen up the version script
Namely drop the version/name tag of the exported symbol, and
rename the filename to egl.sym.

v2: Rebase on top of the LD_NO_UNDEFINED changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
4eaa3c9b60 targets/gbm: add version-script to limit exported symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
69d790da9f targets/vdpau: use version script to limit the exported symbols
Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
53dd2e45f4 targets/omx: drop the version from the omx targets
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
bea9e8dca0 targets/omx: use version script to limit amount of exported symbols
Using export-symbols-regex is the least desirable method of restricting
the exported symbols, as is completely messes up with the symbol table.

radeon_drm_winsys_create is not needed, avoid exporting it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:26 +01:00
Emil Velikov
6239d42fdb targets/dri: use a single version script to restict exported symbols
Rather than having multiple (almost) identical version scripts use
a single one.

Cc: Christian König <christian.koenig@amd.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:25 +01:00
Emil Velikov
b8f31dfc22 targets/xvmc: limit the amount of exported symbols
In the presence of LLVM the final library exports every symbol from
the llvm namespace. Resolve this by using a version script (w/o the
version/name tag).

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

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

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-05-02 21:48:25 +01:00
Emil Velikov
9bcb3698db targets/osmesa: hide osmesa_create_screen
The symbol is not meant to be exported, and its presence was
only a side effect due to the missing visibility flags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-02 21:48:25 +01:00
Emil Velikov
658b36ff78 targets/pipe-loader: drop driver_descriptor symbol from swrast
The symbol is used for hardware only drivers. For swrast the
loader uses swrast_create_screen. Add VISIBILITY_CFLAGS while
we're here.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 21:48:25 +01:00
Juha-Pekka Heikkila
a50b02783b mesa: add extra null checks in vbo_rebase_prims()
v2 [idr]: Move declarations before code to prevent MSVC build breaks.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 12:00:30 -07:00
Juha-Pekka Heikkila
dc675919d3 mesa: add missing null checks in _tnl_register_fastpath()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 11:58:36 -07:00
Ian Romanick
59ad2e6696 mesa: Add _mesa_error_no_memory for logging out-of-memory messages
This can be called from locations that don't have a context pointer
handy.  This patch also adds enough infrastructure so that the unit
tests for the GLSL compiler and the stand-alone compiler will build and
function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-02 11:58:36 -07:00
Chia-I Wu
267e28bb62 glsl: make static constant variables "static const"
This allows them to be moved to .rodata, and allow us to be sure that they
will not be modified.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-05-02 10:50:14 -07:00
Petri Latvala
6a2d28599f docs: update 10.2 release notes
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:05 -07:00
Petri Latvala
b4363c8ea4 i965: Enable INTEL_performance_query for Gen5+.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
8cf5bdad3c mesa: Implement INTEL_performance_query.
Using the existing driver hooks made for AMD_performance_monitor, implement
INTEL_performance_query functions.

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

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
dac82ceac5 mesa: Add core support for the GL_INTEL_performance_query extension.
Like AMD_performance_monitor, this extension provides an interface for
applications (and OpenGL-based tools) to access GPU performance
counters. Since the exact performance counters available vary between
vendors and hardware generations, the extension provides an API the
application can use to get the names, types, and minimum/maximum
values of all available counters.

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

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

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
6ccb98e88c mesa: Add INTEL_performance_query enums to tests/enum_strings.cpp
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Petri Latvala
927c3c9704 Regenerate gl_mangle.h.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 10:07:04 -07:00
Ilia Mirkin
cf6c9dbc33 docs: update ARB_buffer_storage for nouveau 2014-05-02 12:16:25 -04:00
Ilia Mirkin
3df4d692f3 nouveau: add ARB_buffer_storage support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:16:25 -04:00
Ilia Mirkin
b0d02db7e0 nouveau: remove cb_dirty, it's never used
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:01:35 -04:00
Ilia Mirkin
1baf77dbe8 nvc0: treat non-linear 2DRect textures the same as 2D
This fixes textureGather(2DRect) piglit tests, and does not appear to
have any adverse effects.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:01:35 -04:00
Ilia Mirkin
cd064c6a25 mesa/st: enable carry/borrow lowering pass
This handles the last of the ARB_gs5 instructions currently present in
mesa.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-02 12:01:35 -04:00
Ilia Mirkin
31b92aa2fc glsl: add lowering passes for carry/borrow
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-02 12:01:35 -04:00
Ian Romanick
f64bfb2e39 mesa: Eliminate gl_shader_program::InternalSeparateShader
This was a work-around to allow linking a program with only a fragment
shader in a GLES context.  Now that we have GL_EXT_separate_shader_objects
in GLES contexts, we can just use that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:11 -07:00
Ian Romanick
7d9adef340 mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:10 -07:00
Ian Romanick
507b875cf5 glsl: Sort the list of extensions
ARB, OES, then everything else.  If there's ever a KHR shading language
extension, it should go between ARB and OES.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:10 -07:00
Ian Romanick
fb615feafb mesa: Remove support for desktop OpenGL GL_EXT_separate_shader_objects
I don't know of any applications that actually use it.  Now that Mesa
supports GL_ARB_separate_shader_objects in all drivers, this extension
is just cruft.

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

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:10 -07:00
Ian Romanick
e608449d3e mesa/sso: Enable GL_ARB_separate_shader_objects by default
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:20:08 -07:00
Ian Romanick
0939d3d097 sso: Add display list support for ARB_separate_shader_objects new functions
With this patch, the piglit arb_separate_shader_object-dlist test
passes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
7ff937e579 linker: Modify cross_validate_outputs_to_inputs to match using explicit locations
This will be used for GL_ARB_separate_shader_objects.  That extension
not only allows separable shaders to rendezvous by location, but it also
allows traditionally linked shaders to rendezvous by location.  The spec
says:

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

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

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

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

v3: Rebase on removal of ir_variable::user_location.

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
d030a3404c linker: Sort shader I/O variables into a canonical order
v2: Rebase on removal of ir_variable::user_location.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
c557eb7722 linker: Allow geometry shader without vertex shader for separable programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
1ff5a2b1ba linker: Assign varying locations for separable programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:40 -07:00
Ian Romanick
7d73c3e99e linker: Allow consumer stage or producer stage to be NULL
When linking a separable program that contains only a fragment shader,
the producer will be NULL.  Similar cases will exist with geometry
shaders and, eventually, tessellation shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:19:40 -07:00
Ian Romanick
fe37cb0ac6 linker: Refactor code that gets an input matching an output
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:40 -07:00
Ian Romanick
5699220cd5 glsl: Exit when the shader IR contains an interface block instance
While writing the link_varyings::single_interface_input test, I
discovered that populate_consumer_input_sets assumes that all shader
interface blocks have been lowered to discrete variables.  Since there
is a pass that does this, it is a reasonable assumption.  It was,
however, non-obvious.  Make the code fail when it encounters such a
thing, and add a test to verify that behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:40 -07:00
Ian Romanick
ba7195d126 glsl/tests: Add first simple tests of populate_consumer_input_sets
Four initial tests:

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

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

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

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 07:19:39 -07:00
Ian Romanick
8f5852bd2b linker: Refactor code that builds hash tables of varyings during linking
I want to make some changes to this code, but first I want to make some
unit tests for it... so that I can capture the pre- and
post-invariants.  Pulling the code out into its own function in a
non-anonymous namespace enables that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 07:19:39 -07:00
Ian Romanick
ca21cffebd meta: Fix saving the program pipeline state
This code was broken in some odd ways before.  Too much state was being
saved, it was being restored in the wrong order, and in the wrong way.
The biggest problem was that the pipeline object was restored before
restoring the programs attached to the default pipeline.

Fixes a regression in the glean texgen test.

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

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-05-02 07:17:34 -07:00
Ian Romanick
4a868a984d mesa/sso: Refactor new function _mesa_bind_pipeline
Pull most of the guts out of _mesa_BindPipeline into a new utility
function that can be use elsewhere (e.g., meta).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:16:55 -07:00
Ian Romanick
5998fd536a linker: Make lower_packed_varyings work with explicit locations
Don't do anything with variables that have explicitly assigned
locations.  This is also how built-in varyings are handled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:16:54 -07:00
Ian Romanick
7016afe25d glsl: Remove varying "base" parameters
In February 2013 Paul unified the values used for shader stage outputs
and shader stage inputs.  See commits 8a076c5f0^..eed6baf76.  Since that
time, the location_base parameters are always VARYING_SLOT_VAR0.
Instead of passing that around, just hard code it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-02 07:16:54 -07:00
Ian Romanick
03488cd3b9 glsl: Constify parameter to a couple varying_matches methods
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-02 07:16:54 -07:00
Tom Stellard
e05cebafd8 clover: Add a stub implementation of clCreateImage() v3
Now that we are uisng the OpenCL 1.2 headers, applications expect all
the OpenCL 1.2 functions to be implemented.

This fixes linking errors with the piglit CL tests.

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

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

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-05-02 06:48:17 -07:00
Chris Forbes
11f92fd9f9 docs: Add missing ARB_gpu_shader5 subfeature to GL3.txt
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-05-02 17:09:13 +12:00
Fredrik Höglund
e6ff557d15 docs: Mark ARB_multi_bind as done
...and update relnotes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:42 +02:00
Fredrik Höglund
68f3b31a0f mesa: Enable ARB_multi_bind
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:42 +02:00
Fredrik Höglund
2a25570456 mesa: Implement glBindImageTextures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
63995b902a mesa: Implement glBindVertexBuffers
v2: Use the user provided offset and stride when the buffer ID is zero.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2014-05-02 03:00:41 +02:00
Fredrik Höglund
f0c36cf4fa mesa: Implement glBindBuffersRange
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
533cfa03ac mesa: Implement glBindBuffersBase
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
835abfaba4 mesa: Add _mesa_set_transform_feedback_binding()
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
f65a0c19a5 mesa: Refactor set_ubo_binding()
Make set_ubo_binding() just update the binding, and move the code
that does validation, flushes the vertices etc. into a new
bind_uniform_buffer() function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 03:00:41 +02:00
Fredrik Höglund
28d7335810 mesa: Add helper functions for looking up multiple buffers
v2: Document the difference between _mesa_lookup_bufferobj() and
    _mesa_multi_bind_lookup_bufferobj().
v3: Don't create the buffer objects when they don't exist.

Reviewed-by: Brian Paul <brianp@vmware.com> (v2)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
2014-05-02 02:53:26 +02:00
Fredrik Höglund
19f7eeb6fb mesa: Refactor set_atomic_buffer_binding()
Make set_atomic_buffer_binding() just update the binding, and move
the code that does validation, flushes the vertices etc. into a new
bind_atomic_buffer() function.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:26 +02:00
Fredrik Höglund
4f30c0ba80 mesa: Implement glBindTextures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
659d94b256 mesa: Add a texUnit parameter to dd_function_table::BindTexture
This is for glBindTextures(), since it doesn't change the active
texture unit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
b8ee235e72 mesa: Add helper functions for looking up multiple textures
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
b16e2ada4c mesa: Implement glBindSamplers
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
6655e70f99 glapi: Add infrastructure for ARB_multi_bind
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
82291f64e3 mesa: Add functions for doing unlocked hash table lookups
This patch adds functions for locking/unlocking the mutex, along with
_mesa_HashLookupLocked() and _mesa_HashInsertLocked()
that do lookups and insertions without locking the mutex.

These functions will be used by the ARB_multi_bind entry points to
avoid locking/unlocking the mutex for each binding point.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
30af8ce3f8 mesa: Optimize unbind_texobj_from_texunits()
The texture can only be bound to the index that corresponds to its
target, so there is no need to loop over all possible indices
for every unit and checking if the texture is bound to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
4bd8272088 mesa: Add a _BoundTextures field in gl_texture_unit
This will be used by glBindTextures() when unbinding textures,
to avoid having to loop over all the targets.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Fredrik Höglund
6bf8ac846a mesa: Store the target index in gl_texture_object
This will be used by glBindTextures() so we don't have to look it up
for each texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-02 02:53:25 +02:00
Eric Anholt
d55e5a323b i965: Fix the file comment for intel_image.h
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:28 -07:00
Eric Anholt
5566747296 i965: Rename intel_regions.h to something more appropriate now.
We had the EGLimage structure laying around in intel_regions.h, but now
it's the only thing left in the file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
e7f65655cb i965: Delete the intel_regions.c code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
3278f96a52 i965: Drop region usage from DRI2 winsys-allocated buffers.
v2: Fix bad pointer on unreference (caught by Chad)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-05-01 15:12:27 -07:00
Eric Anholt
835f90692f i965: Drop a funny assert about mt pitch.
I slipped this in in the region->pitch change from pixels to bytes, but I
don't see any reason for it any more -- the libdrm code doesn't appear to
divide pitch by a cpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
b49982de6a i965: Fix intel_bufferobj_buffer range for blit drawpixels.
If the stride wasn't width*cpp, we wouldn't track how much of the src is
busy, and allow a subdata into the end to proceed unsynchronized.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
e16c5c9063 i965: Drop use of intel_region from miptrees.
Note: region->width/height used to reflect the total_width/height padding
of separate stencil, though mt->total_width didn't.  region->width/height
was being used in EGL images, where the padded value would have been the
wrong one, so I converted them to use rb->Width/Height.

v2: Drop debug printf that slipped in (caught by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
e3a9ca4563 i965: Replace the region in DRIimage with just a BO pointer and stride.
Regions aren't refcounted safely for multithreaded applications, and
they're not terribly useful wrappers of a BO, so I'm trying to remove
them.

Even the stride I added here could probably be reduced to use of an
existing field in the __DRIimageRec, but I want this to be as mechanical
of a change as possible.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
8435b60a35 i965: Make intel_set_texture_region just take a BO and pitch.
I want to do this to get the region removed from DRI images.  However, it
does mean that we won't share the intel_region between the rb and the
texture for texture_from_pixmap.  I think that's fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:27 -07:00
Eric Anholt
c0bf5a7eff i965: Stop making a pointless region for DRI2 to just throw it away.
I noticed that we were doing this while changing the DRI3 path to not use
regions, which involved changing the signature of
intel_update_winsys_renderbuffer_miptree() this way.

v2: Replace my comment with Chad's version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
3a7a20752f i965: Drop the global GEM name from regions.
Once a buffer has been named, drm_intel_bo_flink() is just a getter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
76932c0ded i965: Drop the tiling argument to intel_miptree_create_for_bo.
The drm function to get the tiling is just a getter storing the two
pointers, so we don't need to go out of our way to avoid it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
522fb01275 i965: Drop pointless cast of texObj to intelObj.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
3033f80af5 i965: Move intel_region_get_aligned_offset() to be a miptree function.
All the consumers are doing it on a miptree.

v2: fix a silly duplicated dereference (review by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
2014-05-01 15:12:26 -07:00
Eric Anholt
9791eb4280 i965: Move intel_region_get_tile_masks() to be a miptree function.
All the consumers are doing it on a miptree.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
ea2cac01e8 i965: Fix another broken offset-aligned-to-tile test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
65e025f99c i965: Fix offset-aligned-to-tile test in dma_buf import.
v1 of the patch got pushed, insted of the v2 that I had reviewed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Eric Anholt
6db640da22 i965: Reuse intel_miptree_get_tile_offsets().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-05-01 15:12:26 -07:00
Brian Paul
5ec1adeb10 mesa: move declarations before code in texstore.c
To fix MSVC build.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-05-01 16:01:06 -06:00
Ville Syrjälä
eb502c31a0 i965: Fix format of private renderbuffers
intel_alloc_renderbuffer_storage() will clobber rb->Format which was
already set up by intel_create_renderbuffer(). This causes the driver
to potentially create the depth buffer in the wrong format.

In practice this makes the depth buffer Z24 even if the visual has
depthBits==16.

The incorrect depth buffer format doesn't seem to cause any actual
problems in i965, but it seems like we should fix it anyway. I see
Z16 has been more or less deprecated in the driver except the for
the depthBits==16 case. But if we want to use Z24 even in that
case (not sure it's really legal?) it would look better if the
code made that decision explicitly rather than relying on the
format to get magically overwritten by the renderbuffer code.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-01 23:56:34 +03:00
Ville Syrjälä
c1d4d49993 i915: Don't advertise Z formats in TextureFormatSupported on gen2
Gen2 doesn't support texturing from Z formats, so state as much.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-01 23:56:25 +03:00
Ville Syrjälä
d3edc31810 i915: Fix format of private renderbuffers
intel_alloc_renderbuffer_storage() will clobber rb->Format which was
already set up by intel_create_renderbuffer(). This causes the driver
to potentially create the depth buffer in the wrong format.

Long time ago things worked by accident because
_mesa_choose_tex_format() checked for ARB_depth_texture
and thus returned MESA_FORMAT_NONE on gen2 hardware. Somehow
that ended up working when depthBits==16 because the driver
would then pick DEPTH_FRMT_16_FIXED. Not sure how, but things
also seemed to work with depthBits==24.

Things started to go more sideways at:
 commit 6ae473221a
 Author: Eric Anholt <eric@anholt.net>
 Date:   Mon Apr 22 16:04:25 2013 -0700

    intel: Fold the one last function intel_tex_format.c into the caller.

since that caused intel_miptree_create_layout() to divide by zero
when encoutering MESA_FORMAT_NONE (bw==0). So after this
commit things were broken enough that many applications wouldn't even
run.

Things got a bit better at:
 commit c245efe7e8
 Author: Eric Anholt <eric@anholt.net>
 Date:   Thu Mar 21 09:50:45 2013 -0700

    mesa: Remove extension checking from ChooseTexFormat.

since now _mesa_choose_tex_format() would return MESA_FORMAT_X8_Z24
for GL_DEPTH_COMPONENT due to i915 erroneosly claiming that
MESA_FORMAT_X8_S24 (and others) are supported texture formats even
on gen2 hardware. So now the the div-by-zero was gone, but now the
driver would pick DEPTH_FRMT_24_FIXED_8_OTHER even when
depthBits==16 which caused rendering problems.

If we prevent rb->Format from getting clobbered for the depth buffer
things work much better. This makes the spinning title text visible
again in chromium-bsu at 16bpp, for example.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-01 23:56:09 +03:00
Anuj Phogat
c1743707a1 mesa: Allow FLOAT_32_UNSIGNED_INT_24_8_REV in get_tex_depth_stencil()
Fixes a crash in Khronos OpenGL CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
29b8e894d1 mesa: Add support to unpack depth-stencil texture in to FLOAT_32_UNSIGNED_INT_24_8_REV
V2: Follow the new naming convention for unpack functions.
    Use double precision for converting Z24 to a float.
V3: Unpack stencil value to most significant byte.
    Use 'struct z32f_x24s8' type.
V4: Unpack stencil value to least significant byte.
    Add a comment to clarify stencil packing.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
7a8045d2f7 mesa: Add new helper function _mesa_unpack_depth_stencil_row()
This patch makes non-functional changes in the code. New helper
function added here will make it easier to support more data
types in the following patches.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
ef924f0de9 mesa: Remove redundant if checks in _mesa_texstore_xx_xx() functions
This patch contains non-functional changes. Assertion checks made
earlier in the functions make the if checks redundant. So, remove
the if checks and unindent the code in if block.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
1a8f9ba9b3 mesa: Allow srcFormat=GL_DEPTH_STENCIL in _mesa_texstore_xx_xx() functions
_mesa_texstore_z24_s8() and _mesa_texstore_z32f_x24s8() are capable of
handling GL_DEPTH_STENCIL format. So, allow it in both the functions.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
aeb9d4495d mesa: Add missing types in _mesa_texstore_xx_xx() functions
Depth-stencil teture targets are allowed to use source data of type
GL_UNSIGNED_INT_24_8_EXT and GL_FLOAT_32_UNSIGNED_INT_24_8_REV.

Fixes few crashes in Khronos OpenGL CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
d714b20eb4 i965: Fix crash in do_blit_readpixels()
Fixes a crash in Khronos CTS packed_pixels tests.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:40 -07:00
Anuj Phogat
5388fc157e mesa: Add error condition for format=STENCIL_INDEX in glGetTexImage()
From OpenGL 4.0 spec, page 306:
   "Calling GetTexImage with a format of STENCIL_INDEX
    causes the error INVALID_ENUM."

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
340658e44f mesa: Add entry for extension ARB_texture_stencil8
V2: Alphabetize the new entry

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
9bcb0a8532 glsl: Apply the link error conditions to GL_ARB_fragment_coord_conventions
Link error conditions added in previous patch are equally applicable
to GL_ARB_fragment_coord_conventions implementation. Extension's spec
says:
   "If gl_FragCoord is redeclared in any fragment shader in a program,
    it must be redeclared in all the fragment shaders in that program
    that have a static use of gl_FragCoord. All redeclarations of
    gl_FragCoord in all fragment shaders in a single program must have
    the same set of qualifiers."

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
35f11e85cb glsl: Link error if fs defines conflicting qualifiers for gl_FragCoord
GLSL 1.50 spec says:
   "If gl_FragCoord is redeclared in any fragment shader in a program,
    it must be redeclared in all the fragment shaders in that
    program that have a static use gl_FragCoord. All redeclarations of
    gl_FragCoord in all fragment shaders in a single program must
    have the same set of qualifiers."

This patch causes the shader link to fail if we have multiple fragment
shaders with conflicting layout qualifiers for gl_FragCoord.

V2: Restructure the code and add conditions to correctly handle the
    following case:

fragment shader 1:
layout(origin_upper_left) in vec4 gl_FragCoord;
void main()
{
    foo();
    gl_FragColor = gl_FragData;
}

fragment shader 2:
layout(pixel_center_integer) in vec4 gl_FragCoord;
void foo()
{
}

V3:
Allow linking in the following case:
fragment shader 1:
void main()
{
    foo();
    gl_FragColor = gl_FragCoord;
}

fragment shader 2:
in vec4 gl_FragCoord;
void foo()
{
   ...
}

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
a751adf071 glsl: Compile error if fs uses gl_FragCoord before first redeclaration
Section 4.3.8.1, page 39 of GLSL 1.50 spec says:
  "Within any shader, the first redeclarations of gl_FragCoord
   must appear before any use of gl_FragCoord."

GLSL compiler should generate an error in following case:

vec4 p = gl_FragCoord;
layout(origin_upper_left) in vec4 gl_FragCoord;

void main()
{
}

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
581e4acb0d glsl: Compile error if fs defines conflicting qualifiers for gl_FragCoord
GLSL 1.50 spec says:
   "If gl_FragCoord is redeclared in any fragment shader in a program,
    it must be redeclared in all the fragment shaders in that
    program that have a static use gl_FragCoord. All redeclarations of
    gl_FragCoord in all fragment shaders in a single program must
    have the same set of qualifiers."

This patch makes the glsl compiler to generate an error if we have a
fragment shader defined with conflicting layout qualifier declarations
for gl_FragCoord. For example:

layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;
layout(pixel_center_integer) in vec4 gl_FragCoord;

void main()
{
}

V2: Some code refactoring for better readability.
    Add compiler error conditions for redeclarations like:

layout(origin_upper_left) in vec4 gl_FragCoord;
layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;

and

in vec4 gl_FragCoord;
layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;

V3: Simplify function is_conflicting_fragcoord_redeclaration()
V4: Check for null pointer before doing strcmp(var->name, "gl_FragCoord").

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
49c71050de mesa: Use location VERT_ATTRIB_GENERIC0 for vertex attribute 0
In OpenGL 3.1 attribute 0 becomes non-magic, just like in
OpenGL ES 2.0. Earlier versions of OpenGL used attribute 0
exclusively for vertex position.

V2: Add a utility function _mesa_attr_zero_aliases_vertex() in
    varray.h

Fixes 4 Khronos OpenGL CTS failures:
glGetVertexAttrib
depth24_basic
depth24_precision
rgb8_rgba8_rgb

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
dc75479b7a mesa: Fix querying location of nth element of an array variable
This patch makes changes to the behavior of glGetAttribLocation(),
glGetFragDataLocation() and glGetFragDataIndex() functions.

Code changes handle a case described in following example:

shader program:
layout(location = 1)in vec4[4] a;
void main()
{
}

Currently, glGetAttribLocation("a") returns 1.
glGetAttribLocation("a[i]"), where i = {0, 1, 2, 3}, returns -1.
But the expected locations for array elements are: 1, 2, 3 and 4
respectively.

This clarification came up with the addition of
ARB_program_interface_query to OpenGL 4.3.

From Page 326 (page 347 of the PDF) of OpenGL 4.3 spec:
   "Otherwise, the command is equivalent to

    GetProgramResourceLocation(program, PROGRAM_INPUT, name);"

And, From Page 101 (page 122 of the PDF) of OpenGL 4.3 spec:

   "A string provided to GetProgramResourceLocation or
    GetProgramResourceLocationIndex is considered to match an active
    variable if

    • the string exactly matches the name of the active variable;
    • if the string identifies the base name of an active array, where
      the string would exactly match the name of the variable if the
      suffix "[0]" were appended to the string; or
    • if the string identifies an active element of the array, where
      the string ends with the concatenation of the "[" character, an
      integer (with no "+" sign, extra leading zeroes, or whitespace)
      identifying an array element, and the "]" character, the integer
      is less than the number of active elements of the array variable,
      and where the string would exactly match the enumerated name of
      the array if the decimal integer were replaced with zero."

V2: Simplify get_matching_index() function.
    Add relevant text from OpenGL spec in commit message.

Fixes failures in Khronos OpenGL CTS tests:
explicit_attrib_location_room
draw_instanced_max_vertex_attribs

Proprietary linux drivers of NVIDIA (331.49) matches the behavior
expected by OpenGL 4.3 spec.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Anuj Phogat
8c61b6a99b glsl: Allow overlapping locations for vertex input attributes
Currently overlapping locations of input variables are not allowed for all
the shader types in OpenGL and OpenGL ES.

From OpenGL ES 3.0 spec, page 56:
   "Binding more than one attribute name to the same location is referred
    to as aliasing, and is not permitted in OpenGL ES Shading Language
    3.00 vertex shaders. LinkProgram will fail when this condition exists.
    However, aliasing is possible in OpenGL ES Shading Language 1.00 vertex
    shaders."

Taking in to account what different versions of OpenGL and OpenGL ES specs
say about aliasing:
   - It is allowed only on vertex shader input attributes in OpenGL (2.0 and
     above) and OpenGL ES 2.0.
   - It is explictly disallowed in OpenGL ES 3.0.

Fixes Khronos CTS failing test:
explicit_attrib_location_vertex_input_aliased.test
See more details about this at below mentioned khronos bug.

V2: Fix the case where location exceeds the maximum allowed attribute
    location.
V3: Simplify the condition added in V2.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: Khronos #9609
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-01 10:58:39 -07:00
Roland Scheidegger
a773fdc64d glx/drisw: fix memory leak when destroying screen.
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-01 16:13:38 +02:00
Roland Scheidegger
64d6460a56 gallivm: fix 2 leaks in disassembly code
don't leak the MCSubtargetInfo (not really big, was already fixed with
llvm master) and TargetMachine (big). While this is only used for debugging
the leak is large enough to get you into trouble in some cases.
Tested with llvm 3.1 and master.
Before (llvm 3.1), GALLIVM_DEBUG=asm glxgears:
==14152== LEAK SUMMARY:
==14152==    definitely lost: 105,228 bytes in 20 blocks
==14152==    indirectly lost: 347,252 bytes in 261 blocks
==14152==      possibly lost: 866,625 bytes in 1,453 blocks
==14152==    still reachable: 7,344,677 bytes in 6,494 blocks
==14152==         suppressed: 0 bytes in 0 blocks

After:
==13799== LEAK SUMMARY:
==13799==    definitely lost: 3,108 bytes in 6 blocks
==13799==    indirectly lost: 0 bytes in 0 blocks
==13799==      possibly lost: 804,143 bytes in 1,429 blocks
==13799==    still reachable: 7,314,267 bytes in 6,473 blocks
==13799==         suppressed: 0 bytes in 0 blocks

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-05-01 16:13:38 +02:00
José Fonseca
6d911a5944 mesa: Move declaration to top of block.
To fix MSVC build.  Trivial.
2014-05-01 10:00:10 +01:00
José Fonseca
b0de67ad2d osmesa: Fix typo in _MaxEnabledTexImageUnit. 2014-05-01 09:55:20 +01:00
Kenneth Graunke
85ce2242cb i965/vec4: Port untyped atomic message support to Broadwell.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:12 -07:00
Kenneth Graunke
45367d2d09 i965/vec4: Port untyped surface reads support to Broadwell.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:10 -07:00
Kenneth Graunke
e9e89d5756 i965/fs: Port untyped atomic message support to Broadwell.
v2: Fix SIMD mode comment (caught by Eric Anholt).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:08 -07:00
Kenneth Graunke
54a48984b3 i965/fs: Port untyped surface read support to Broadwell.
v2: Drop unused num_components variable; fix SIMD Mode comment
    (caught by Eric Anholt).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:06 -07:00
Kenneth Graunke
f1cd9fee53 i965/fs: Set fs_inst::header_present for untyped atomics/surface reads.
The brw_eu_emit.c code manually forces the header present bit when
used in align1 (scalar) mode.  So, this has no effect currently.

However, it is nice to have fs_inst::header_present reflect reality.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:04 -07:00
Kenneth Graunke
4d9c27df45 i965: Disassemble atomic operations and other DP:DC1 stuff on Broadwell.
This is similar to what Eric did for Gen7 a little while ago; it also
has support for untyped surface reads.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:24:02 -07:00
Kenneth Graunke
3b3c46656e i965: Implement the create_raw_surface() hook on Broadwell.
Otherwise we crash when setting up atomic buffer objects.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:23:59 -07:00
Kenneth Graunke
69fd055166 i965: Drop mark_surface_used from gen8 generators.
Francisco made brw_mark_surface_used a freestanding function in
commit a32817f3c2.  We should use it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:23:57 -07:00
Kenneth Graunke
b10785f9a9 i965/fs: Add support for fs_inst::force_writemask_all on Broadwell.
This must not have existed when I wrote the original code.  The atomic
operation header setup code uses this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-05-01 00:23:44 -07:00
Kenneth Graunke
ac30e1adb4 i965: Actually emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS.
For platforms using hardware contexts (currently Gen6+), we failed to
emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS, instead emitting MI_NOOP
for both.

During one of the context initialization reordering patches, we
accidentally moved brw_init_state before we set brw->CMD_PIPELINE_SELECT
and brw->CMD_VF_STATISTICS.  So, when brw_init_state uploaded initial
GPU state (brw_init_state -> brw_upload_initial_gpu_state ->
brw_upload_invariant_state), these would be 0 (MI_NOOP).

Storing the commands in the context is not worthwhile.  We have many
generation checks in our state upload code, and for platforms with
hardware contexts, this only gets called once per GL context anyway.
The cost is negligable, and it's easy to botch context creation
ordering.

This may fix hangs on Gen6+ when using the media pipeline.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-05-01 00:12:22 -07:00
Kenneth Graunke
0380ec467d i965: Don't enable reset notification support on Gen4-5.
arekm reported that using Chrome with GPU acceleration enabled on GM45
triggered the hw_ctx != NULL assertion in brw_get_graphics_reset_status.

We definitely do not want to advertise reset notification support on
Gen4-5 systems, since it needs hardware contexts, and we never even
request a hardware context on those systems.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75723
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 23:08:22 -07:00
Carl Worth
4546b70e08 doc: Add pointer to the Mesa Stable Queue page.
Since this is now updated daily and looks to be useful.
2014-04-30 16:27:03 -07:00
Eric Anholt
862986ade3 i965: Fix state flag comments on color_buffer_write_enabled() calls.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
e739558c9d i965: Drop bogus state flag comment.
This was introduced with the comment and code below it, though the code
only touches prog_data (CACHE_NEW_WM_PROG).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
60c5f9716c i965: Track the number of samples in the drawbuffer.
This keeps us from having to emit the nonpipelined state packet on every
FBO binding.

-4.42003% +/- 1.09961% effect on cairo-perf-trace runtime on glamor (n=110).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
973345fc23 mesa: Track maximum CurrentTexUnit to reduce glDeleteTextures() overhead.
No more walking 96*6 pointers looking to see if they're the current
texture, when we only use the first 2 out of 96 units.  -6.26002% +/-
1.87817% effect on cairo runtime on no-fbo-cache glamor (n=36).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:21 -07:00
Eric Anholt
6a97deb88a mesa: Rewrite shader-based texture image state updates.
Instead of walking 6 shader stages for each of the 96 combined texture
image units, now we just walk the samplers used in each shader stage.

With cairo-perf-trace on Xephyr with glamor, I'm seeing a -6.50518% +/-
2.55601% effect on runtime (n=22) since the "drop _EnabledUnits" change.
No significant performance difference on an apitrace of minecraft (n=442).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
a580b500ed mesa: Split the shader texture update logic from fixed function.
I want to avoid walking the entire long array texture image units, but the
obvious way to do so means walking program samplers, and thus hitting the
units in a random order.

This change replaces the previous behavior of only setting up the fallback
texture for a fragment shader with setting up the fallback texture for any
shader that's missing a complete texture of the right target in its unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
e5e50fae6a mesa: Finish removing the _ReallyEnabled field.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
741f5d58e6 radeon: Drop the remaining driver usage of _ReallyEnabled.
This is kind of ugly, but I think it's worth it to finish off the last
consumers of _ReallyEnabled.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
2f8749af20 swrast: Drop remaining use of _ReallyEnabled.
The _MaxEnabledTexImageUnit check assures us that Unit[0].Current != NULL.
This is the last consumer of _ReallyEnabled outside of the radeons.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
8061f90a64 gallium: Drop use of _ReallyEnabled.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
cef82a64bd mesa: Drop _ReallyEnabled usage from ff_fragment_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
07b94c99a7 i915: Drop use of _ReallyEnabled.
We can just look at _Current's target.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
ff9c3e8e5a mesa: Replace use of _ReallyEnabled as a boolean with use of _Current.
I'm probably not the only person that has tried to kill _ReallyEnabled.
This does the mechanical part of the work, and cleans _ReallyEnabled from
i965.

I think that using _Current makes texture management clearer: You can't
have multiple targets in use in the same texture image unit at the same
time, because there's just that one pointer.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
62d46332d8 mesa: Ensure that (unit->_Current != 0) == (unit->_ReallyEnabled != 0).
I'm going to try to delete _ReallyEnabled, which is this weird bitfield
with either 0 or 1 bits set with just the reference to _Current.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
6bac47c05a mesa: Drop dead last_ReallyEnabled fields from drivers.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:20 -07:00
Eric Anholt
c703658b39 mesa: Drop _EnabledUnits.
The field wasn't really valid, since we've got more than 32 units now.  It
turns out it was mostly just used for checking != 0, or checking for fixed
function coordinates, though.

v2: Fix mis-conversion in xm_line.c (caught by Ken).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:33:17 -07:00
Eric Anholt
3dfe56c53b swrast: Just use _EnabledCoordUnits for figuring out which texcoords to build.
_EnabledUnits is all of the first 32 image units that are used by fixed
function or programs, while _EnabledCoordUnits is just which fixed function
fragment shader texcoords need to be generated.  This is a theoretical bugfix
in the case of a vertex shader texturing from large texture image unit number
(we'd end up flagging something other than a VARYING_SLOT_TEXn as needing to
be generated), but it's actually just motivated by trying to kill
_EnabledUnits.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:21:59 -07:00
Eric Anholt
1ad443ecdd i915: Redo texture unit walking on i830.
We now know what the max unit is in the context state.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 14:21:59 -07:00
Matt Turner
9565392031 i965/vec4: Remove 'mul_arg' from try_emit_mad().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 11:41:29 -07:00
Matt Turner
1e50bc9ee1 i965/fs: Remove 'mul_arg' from try_emit_mad().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-30 11:41:29 -07:00
Brian Paul
475f5ff64d mesa: change invalid texture swizzle error to GL_INVALID_ENUM
The original GL_EXT_texture_swizzle extensions said GL_INVALID_OPERATION
was to be generated when the an invalid swizzle was passed to
glTexParameter().  But in OpenGL 3.3 and later, the error should be
GL_INVALID_ENUM.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-30 10:09:44 -06:00
Andreas Hartmetz
1c6aa6599e translate_sse: Use the correct buffer index in this fast path.
It is possible that there are multiple input buffers but only one is
relevant for translation. Then there will be only a single translation
group, which might need to source data from a buffer index != 0.

Fixes wrong vertex shader inputs as observed while debugging with an
application and driver combination that requires translation of a
vertex attribute in a non-trivial set of attributes and input buffers.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-29 20:35:10 -04:00
Tom Stellard
ca848e8bee clover: Query drivers for max clock frequency
Igor Gnatenko:

v2: PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY instead of
    PIPE_COMPUTE_MAX_CLOCK_FREQUENCY

Bruno Jiménez:

  v3: Drivers report clock in Mhz

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 15:28:17 -07:00
Tom Stellard
0a41054b7f radeon/compute: Implement PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY
Igor Gnatenko:
  v2: in define RADEON_INFO_MAX_SCLK use 0x1a instead of 0x19 (upstream changes)

Bruno Jiménez:
  v3: Convert the frequency to MHz from kHz after getting it in
  'do_winsys_init'

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 15:25:50 -07:00
Tom Stellard
5fe1a0ebad gallium: Add PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY
Bruno Jiménez:
  v2: Updated the docs
  v3: Remove trailing comma

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 15:24:53 -07:00
Kenneth Graunke
979a015bc1 i965: Fix a few base addresses on Broadwell.
We intended to set these 64-bit addresses to 0, and set the enable bit.
But, I accidentally placed the DWord with the high bits first, when it
should have been second.

This generally worked out, by luck - presumably General State Base
Address is initially zero, and ends up remaining that way in our
contexts since we bungled the "modify enable" bit.

v2: Fix MOCS shift on GSBA.  It should be 4, and I had 2.
    (Caught by Ben Widawsky.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-04-29 14:01:06 -07:00
EdB
7fb05f9298 clover: Stub implementation of CL 1.2 sub-devices.
The implementation is basically a NOP but it conforms with OpenCL 1.2.

[ Francisco Jerez: Initialize property return buffer for
  CL_DEVICE_PARTITION_PROPERTIES, CL_DEVICE_PARTITION_TYPE,
  CL_DEVICE_PARTITION_AFFINITY_DOMAIN, and make the latter a scalar
  rather than a vector.  Some clean-up and code style fixes. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 16:14:50 +02:00
EdB
5827781d25 clover: Add clEnqueue{Marker, Barrier}WithWaitList.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 13:12:38 +02:00
Jan Vesely
7b11c97d31 clover: Align kernel argument sizes to nearest power of 2
v2: use a new variable for aligned size
    add comment
    make both vars const
    only use the aligned value in argument constructors
    fix comment typo

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 13:09:21 +02:00
Francisco Jerez
df985cc8f6 clover: Avoid warnings from references to deprecated CL 1.1 APIs.
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 13:01:37 +02:00
Francisco Jerez
beadd6b0cc clover: Update OpenCL headers to version 1.2 from Khronos.
The C++ headers are *not* updated because they rely on CL 1.2 APIs
that we do not implement yet when the core CL 1.2 headers are present.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 13:01:10 +02:00
Ilia Mirkin
f782d6e792 nvc0/ir: offset appears to come before the Z ref
Fixes textureGatherOffset when used with a shadow sampler. Also verified
against blob compiler with textureLodOffset manually (no piglit tests
for texture[Lod]Offset + shadow samplers).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 20:32:36 -04:00
Brian Paul
50034c0171 mesa: remove unused #pragma export on/off lines
PRAGMA_EXPORT_SUPPORTED is never defined.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77749
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 17:16:42 -06:00
Ilia Mirkin
f3aa999383 nv50/ir: change texture offsets to ValueRefs, allow nonconst
This allows us to have non-constant offsets for textureGatherOffset and
textureGatherOffsets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:09:18 -04:00
Ilia Mirkin
46364a53ef nvc0/ir: do constant folding of extbf/insbf
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin
1c85177419 nvc0/ir: add support for MUL_HI tgsi opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin
b4b20d42f6 nvc0/ir: add support for new bitfield manipulation opcodes
This adds support for:

IBFE, UBFE, BFI, LSB, IMSB, UMSB, BREV, POPC

Which are all required for ARB_gs5 support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin
1db993f2fe tgsi: add tgsi_exec support for new bit manipulation opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:11 -04:00
Ilia Mirkin
ab4927f3e0 gallium/util: add helpers for bitfield manipulation
Add bitwise reversing and signed MSB helpers for software implementation
of the new TGSI opcodes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:07 -04:00
Ilia Mirkin
3e73bf2724 mesa/st: implement new bit manipulation opcodes
Also pipe through [IU]MUL_HI, MAD, and lower ldexp. This provides
coverage of all new ARB_gpu_shader5 functions except uaddCarry,
usubBorrow and interpolateAt*.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:04 -04:00
Ilia Mirkin
a52eaba787 gallium: add new opcodes for ARB_gs5 bit manipulation support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:04:46 -04:00
Emil Velikov
b125c92aa9 glx/drisw: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:39 +01:00
Emil Velikov
a2454bdfbd glx/dri3: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:39 +01:00
Emil Velikov
55d82adec6 glx/dri2: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
76ae25d7e8 glx/dri: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
2f519e4635 glx/indirect: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set indirect_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
31a3b58cb7 glx/apple: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set applegl_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
5f280d0c44 egl_dri: rework dri extension handling
Use designated initialisers, and store the extensions pointers as const.

The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension
are setup by the platform backends so they should not be constified.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov
5457caa58c gbm: cleanup __DRI*extension handling
Use designated initialisers, store all extension pointers as const and use
a const __DRIextensions array over assigning each element individually.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov
c812557a0e dri_util: cleanup dri extension handling
Explicitly set the version that is implemented, as that may differ from
the one defined in dri_interface.h. The remaining __DRI*Extensions are
treated as constants, so got ahead and declare them as such.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov
51e3569573 glx/tests: explicitly set __DRI2rendererQueryExtension members
While we're here use the typcast'ed name and constify.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov
ecfe986120 glx/dri3: rework __DRIextension handling
Use a const array with the extensions, rather than assigning each
one to a fixed size array at runtime.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:37 +01:00
Emil Velikov
4be3874c97 glx/dri2: rework __DRIextension handling
Make sure that the DRI*Extensions report the version of the interface
implemented over the listed in the headers. While both are currently
the same, this may change in the future.

v2: Keep loader extensions handling as is.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:18 +01:00
Emil Velikov
98e2a8e2f9 st/dri: cleanup dri extension handling
Explicitly set the version that is implemented, as that may differ
from the one defined in dri_interface.h. Use designated initialisers
and constify whereever possible.

Note: __DRIimageExtension should not be made const as it's modified
at runtime. This patch should have no side effects on compilers that
do not support designated initialisers, as the existing code in
dri/common already uses them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:28 +01:00
Emil Velikov
748b35a69f dri/radeon: use a const __DRIextension array
Rather than keeping a separate and unused copy of the screen extensions
within the radeon screen, use a constant array that can be used directly
with __DRIscreen.

[Kristian Høgsberg]
The copy in the radeon screen isn't unused, that's where the array is
built and stored, the dri screen just points to that.  The pattern
here was used for cases where the extensions exported by a dri driver
could vary at runtime, for example depending on chipset.  In this
case, it's known at compile time, so it makes sense to use a static
const array instead.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Emil Velikov
38f20f79da drivers/dri: cleanup dri extension instantiation
Uniformly use the typecasted extension name, constify extension instances
and use designated initialisers. Set the implemented version of the
extension, over the one defined in dri_infertace.h. Patch covers the
following extensions:

__DRItexBufferExtension
__DRIimageExtension
__DRIrobustnessExtension
__DRI2rendererQueryExtension
__DRIdri2LoaderExtension

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Emil Velikov
9b42fd1772 dri_interface: Update __DRItexBufferExtensionRec to version 3
With commit e59fa4c46c8("dri2: release texture image.") we updated the
extension without bumping the version number. The patch itself added an
interface required to enable texture_from_pixmap on certain platforms.

The new code was effectively never build, as it depended on
__DRI_TEX_BUFFER_VERSION >= 3, which never came to be in upstream mesa.

This commit bumps the version number, drops the __DRI_TEX_BUFFER_VERSION
checks and resolves all the build conflicts. Additionally it add a version
check as egl and dri3, as require version 2 of the extension which does
not have the releaseTexBuffer hook.

Cc: Juan Zhao <juan.j.zhao@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Jon TURNEY
ec8ebff342 Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULT
Unfortunately, Cygwin defines RTLD_DEFAULT (for glibc compatibility), but can't
provide dladdr(), so add a check for dladdr()

Since I don't think scons is ever used to build for Cygwin, just set HAVE_DLADDR
in SConscript, assuming that if we have RTLD_DEFAULT, we have dladdr().

Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-28 19:11:02 +01:00
Richard Sandiford
6c8f547f66 util: Fix cross-compiles between endiannesses
The old python code used sys.is_big_endian to select between little-endian
and big-endian formats, which meant that the build and host endiannesses
needed to be the same.  This patch instead generates both big- and little-
endian layouts, using PIPE_ARCH_BIG_ENDIAN to select between them.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:27 +01:00
Richard Sandiford
6944796cbe util: Split out channel-parsing Python code
Splits out the code that parses the channel list, so that we
can have different lists for little and big endian.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:25 +01:00
Richard Sandiford
1a3746212d util: Split out channel-printing Python code
Rather than iterate over format.channels and format.swizzles directly,
use Python subfunctions that take the channel and swizzle lists as
arguments.  This allow the channel and swizzle lists to depend on
endianness.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:24 +01:00
Richard Sandiford
0ee3ac938a util: Turn inv_swizzle into a global function
With the big-endian changes, there can be two swizzle orders for each format.
This patch turns Format.inv_swizzle() into a global function that takes the
swizzle list as a parameter.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:22 +01:00
Richard Sandiford
227d7a6a3c util: Add more query methods to u_format_parse.Format
The main aim is to reduce the number of places that access channels[0],
swizzles[0] and swizzles[1] directly.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:20 +01:00
Michel Dänzer
136c437cea st/mesa: Fix NULL pointer dereference for incomplete framebuffers
This can happen with glamor, which uses EGL_KHR_surfaceless_context and
only explicitly binds GL_READ_FRAMEBUFFER for glReadPixels.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-28 12:12:03 +09:00
Chris Forbes
151a20dcd4 glsl: fix spelling of derived
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-27 21:37:23 +12:00
Ilia Mirkin
e88644c1f2 docs: mark off nv50/nvc0 for ARB_sample_shading, update relnotes
relnotes weren't updated this whole time, so I went through all the
GL3.txt changes and picked out the nouveau ones since 10.1.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-27 00:16:29 -04:00
Chia-I Wu
7b2dd89041 mesa: overhaul debug namespace support
_mesa_HashTable is not well-suited for us: it locks a mutex unnecessarily and
it does not accept 0 as the key (and have branches to handle 1 specially).
What we really need is a sparse array.  Whether it should be implemented as a
hash table, a list, or a bsearch()-able array requires investigations of the
use models.

We choose to implement it as a list for now, assuming it is common to have a
short list of IDs in each (source, type) namespace.  The code is simpler, and
the memory footprint is lower.  This also fixes several corner cases such as
making messages to have different states at different severities.

v2: use GLbitfield for State/DefaultState, and add a comment

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
70e4337014 mesa: delay copying of debug groups
Do not copy the debug group until it is about to be written.  One likely
scenario of using glPushDebugGroup/glPopDebugGroup is to enclose a sequence of
GL commands and give them a human-readable description.  There is no message
control change in this scenario, and thus no need to copy.

This also reduces the initial size of gl_debug_state from 306KB to 7KB.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
a30c4c6ca0 mesa: clean up debug output namespace handling
Add functions to provide these operations on a struct gl_debug_namespace:

  init():    initialize the namespace
  copy():    copy all elements from one namespace to another
  clear():   clear all elements (to free the memories)
  set():     set the value of an element
  set_all(): set the value of all elements
  get():     get the value of an element

A debug namespace is like a sparse array.  The length of the array is huge,
2^sizeof(GLuint), but most of the elements assume the same value sepcified by
set_all().

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
44a1374793 mesa: clean up debug groups
Add struct gl_debug_group to hold all namespaces of a debug group.  Replace
the 3-dimensional array, Namespaces, in struct gl_debug_state by a
1-dimensional array of type struct gl_debug_groups.

Turn the 4-dimensional array, Defaults, in struct gl_debug_state to a
1-dimensional array in struct gl_debug_namespace.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
e412305f9f mesa: clean up debug message log
Remove NextMsgLength, and move members of struct gl_debug_state that belong to
the message log to a new struct, gl_debug_log.  Rename gl_debug_msg to
gl_debug_message.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu
cf61ea3029 mesa: use accessors for struct gl_debug_state
When GL_DEBUG_OUTPUT_SYNCHRONOUS is GL_TRUE, drivers are allowed to log debug
messages from other threads.  That requires gl_debug_state to be protected by
a mutex, even when it is a context state.  While we do not spawn threads in
Mesa yet, this commit makes it easier to do when we want to.

Since the definition of struct gl_debug_state is no longer needed by the rest
of the driver, move it to main/errors.c.  This should make it even harder to
use the struct incorrectly.

v2: add comments for the accessors

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
94e45c98e1 mesa: eliminate debug output message_insert
Add validate_length, and call it together with log_msg directly instead of
message_insert.  No functional change.

v2: make sure length is non-negative (i.e., known) before calling
    validate_length, noted by Timothy Arceri

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
188d22d9b7 mesa: eliminate debug output should_log
In both call sites, it could be easily replaced by direct
debug_is_message_enabled calls.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
c9dfb6b76c mesa: eliminate debug output control_app_messages
Merge control_app_messages with the only caller.  Eliminate set_message_state
and control_messages too as they are unused.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
274913c42c mesa: eliminate debug output get_msg
Merge get_msg with the only caller.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
04a8baad37 mesa: refactor _mesa_PopDebugGroup and _mesa_free_errors_data
Replace free_errors_data by debug_clear_group.  Add debug_pop_group and
debug_destroy for use in _mesa_PopDebugGroup and _mesa_free_errors_data
respectively.  No funcitonal change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
f1d00dce43 mesa: refactor _mesa_PushDebugGroup
Move group copying to debug_push_group.  Save the group message before pushing
instead of after, since we will need it after popping.  No functional change
otherwise.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
de0e0ae4b6 mesa: refactor debug output control_messages
Move most of the code to debug_set_message_enable_all.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
7e9451dc46 mesa: refactor debug output get_msg
Move message fetching to debug_fetch_message and message deletion to
debug_delete_messages.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
e9d1b5c8af mesa: refactor debug out log_msg
Move message logging to debug_log_message.  Replace store_message_details by
debug_message_store.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
880183fee8 mesa: refactor debug output set_message_state
Move message state update to debug_set_message_enable.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
7554d27de4 mesa: refactor debug output should_log
Move the message filtering logic to debug_is_message_enabled.  No functional
change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu
672b209225 mesa: refactor _mesa_get_debug_state
Move gl_debug_state allocation to a new function, debug_create.  No functional
change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Ilia Mirkin
9339f8ac1b nvc0/ir: fetch shadow value from proper place for TG4 cube array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
b86d78b4c1 nvc0/ir: set gatherComp for non-shadow targets
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
24e68c9024 nvc0/ir: set instance count based on the GS_INVOCATIONS property
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
802fe8d9af nvc0/ir: add support for INVOCATIONID system value
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 12:01:13 -04:00
Ilia Mirkin
b3a2398ade nvc0/ir: add support for SAMPLEMASK sysval
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 11:57:18 -04:00
Ilia Mirkin
c3d2bda53e mesa/st: translate gl_InvocationID to INVOCATIONID semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:57:15 -04:00
Ilia Mirkin
389379e81d mesa/st: translate gl_SampleMaskIn to SAMPLEMASK semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:57:12 -04:00
Ilia Mirkin
4be146b108 gallium: add GS_INVOCATIONS property
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:57:09 -04:00
Ilia Mirkin
76db20fc67 gallium: add INVOCATIONID semantic
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-26 11:56:39 -04:00
Ilia Mirkin
af38ef907c nvc0: add support for PIPE_CAP_SAMPLE_SHADING
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 11:53:34 -04:00
Ilia Mirkin
f715a0a39a nv50: add support for PIPE_CAP_SAMPLE_SHADING
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-26 11:53:24 -04:00
Ilia Mirkin
c5d822dad9 mesa/st: add support for ARB_sample_shading
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-26 11:52:52 -04:00
Ilia Mirkin
88d8d88d8c gallium: add basic support for ARB_sample_shading
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-26 11:52:01 -04:00
Enrico Horn
3a2885fb26 mapi: OpenVG symbol exports.
Fixes another mistake in 144bbb7b78.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77502
2014-04-25 19:34:38 -07:00
Matt Turner
18993f7892 glsl: Use properly typed arguments for bitfieldInsert.
bitfieldInsert takes scalar integers for its last two arguments. Since
bitfieldInsert is lowered on i965 to two instructions that have more
flexible arguments, I didn't notice when I wrote this.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-25 19:24:39 -07:00
Eric Anholt
07730e9463 i965: Don't bother flushing the batch if it doesn't ref our mt to map.
-1.1372% +/- 0.858033% effect on cairo runtime on glamor (n=175).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-25 18:19:55 -07:00
Ander Conselvan de Oliveira
17860309f1 egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM
Otherwise it fails to compile if the drm egl platform is disabled.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:17:54 +01:00
Neil Roberts
63d4661ab2 wayland: Fix the logic in disabling the prime capability
It looks like this bit of code is trying to disable the prime capability if
the driver doesn't support createImageFromFds. However the logic looks a bit
broken and what it would actually do is disable all other capabilities apart
from prime. This patch fixes it to actually disable prime.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:17:05 +01:00
Ander Conselvan de Oliveira
49964fa28b gbm: Set errno on errors
This should give the caller some information of what called the error.
For the gbm_bo_import() case, for instance, it is possible to know if
the import is not supported or the error was caused by an invalid
parameter.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:16:45 +01:00
Ander Conselvan de Oliveira
aa91fe1c09 gbm/dri: Fix out-of-memory error path in dri_device_create()
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:16:00 +01:00
Emil Velikov
c0953cf06e gallium/tests: conditionally include sw/dri winsys
In all fairness we allow the gallium tests to be build with --disable-dri
which will result in the approapriate winsys to not be build, thus the
build will fail.

  ./configure --disable-dri --with-gallium-drivers=svga --enable-gallium-tests

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:09:26 +01:00
Emil Velikov
6c44d43bae automake: cleanup pipe-loader handling when using sw/xlib winsys
Rather than defining our own set of variables, use NEED_WINSYS_XLIB
and based on it include the sw/xlib winsys.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:09:17 +01:00
Emil Velikov
5c6a1445d5 pipe-loader: conditionally build and use pipe_loader_sw_probe_dri
The function relies on the sw/dri winsys which is build only when --enable-dri
is set. Fixes build issues with the following config

 ./configure --disable-dri --with-gallium-drivers=svga --enable-xa

Issue can be reproduced with any hw gallium driver + st that uses the pipe-loader.

Cc: Brian Paul <brianp@vmware.com>
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-25 21:09:09 +01:00
Roland Scheidegger
a7a03d84fc llvmpipe: fix clearing of individual color buffers in a fb
GL (3.0) allows you to clear individual color buffers in a fb. In fact
for fbs containing both int and float/normalized color buffers this is
required (because the clearing values are otherwise undefined if applied
to all buffers). The gallium interface was changed a while ago, but llvmpipe
ignored it (hence doing such individual clears always resulted in clearing
all buffers, plus some assorted asserts due to the mixed fbs).
So change the clear command to indicate the buffer to be cleared. Also, because
indicating the buffer to be cleared would have made lp_rast_arg_cmd larger
which is unacceptable (we're trying to shrink it some day) allocate the clear
value in the scene and just pass a pointer.
There's several advantages and disadvantages here:
+ clearing individual buffers works (we could also actually bin such clears now
if they'd come through clear_render_target() if the surface is in the current
fb, though we didn't do this before for the single rb case and still don't try).
+ since there's one clear per rb, we do the format conversion in setup rather
than per bin. Aside from the (drop in the ocean...) performance advantage this
means that clearing to very small values (that is, denormal when converted to
the format) should work for small float (fp16 etc.) formats, as the util code
couldn't handle it correctly before (because cpu denorms are disabled when
executing the bin commands, screwing up the magic conversion and flushing
the values to 0, though this was not verified).
- there's some overhead for traditional old-style clear-all MRT cases, since
there's one rast clear command per rb instead of one for all rbs.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=76976.

v2: get rid of the ugly manual memcpy stuff and just use union util_color.
This is 32 bytes instead of 16 but as the allocation is per scene we can live
with those additional 16 bytes (and the additional 128 bytes in the setup
context), which makes the code much more obvious. Suggested by Brian.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-25 19:29:30 +02:00
Roland Scheidegger
fa4082320a gallium/util: use ui[4] instead of ui in union util_color
util_color often merely represents a collection of bytes, however it is
inconvenient if those bytes can only be accessed as floats/doubles for int
formats exceeding 32bits.
(Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and
short member were left as is.)
2014-04-25 19:29:30 +02:00
Roland Scheidegger
2f65f61bea llvmpipe: (trivial) use correct LP_MIN_VECTOR_ALIGN define for alignment.
Currently it's the same value.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-25 19:29:30 +02:00
Marek Olšák
3a3b1bf60e r600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISC
Changing SX_MISC hangs RV740. When we're at it, let's use DX_RASTERIZATION_KILL
on all R700 and later chipsets.

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:13 +02:00
Marek Olšák
3d0c4f3b01 r600g: fix for an MSAA hang on RV770
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
ecc8a37ec5 r600g: fix for broken CULL_FRONT behavior on R6xx
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
ef162cf13d r600g: fix for HTILE on R6xx
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
0967970768 r600g: fix buffer copying on R600-R700
This fixes broken rendering in DOTA 2.

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
042e40f67b r600g: fix flushing on RV670, RS780, RS880 again
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
20a9b784da r600g: fix MSAA resolve on R6xx when the destination is 1D-tiled
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
6dd045ef40 r600g: disable async DMA on R700
Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
2014-04-25 01:33:12 +02:00
Marek Olšák
e5741f1e91 r600g: fix edge flags and layered rendering on R600-R700
We forgot to set these bits.

Cc: 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
8a1dfba73e st/mesa: remove trailing NULL colorbuffers
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-25 01:33:12 +02:00
Marek Olšák
e522c455e4 r300g: don't crash when getting NULL colorbuffers
Cc: mesa-stable@lists.freedesktop.org
2014-04-25 01:33:12 +02:00
Marek Olšák
ba4f6a5fc9 r300g: fix runtime warning after winsys cleanup
Broken by:
  b2238b3452
  winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc
2014-04-25 01:33:12 +02:00
Marek Olšák
7920adb45c radeonsi: implement GL_ARB_vertex_type_10f_11f_11f_rev
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-25 01:33:12 +02:00
José Fonseca
f438a82492 st/xlib: Do minimal version checking in glXCreateContextAttribsARB.
The current version checking is wrongly refusing to create 3.3 contexts;
unsupported version are checked elsewhere; and the DRI path doesn't do
this sort of checking neither.

This enables piglit glsl 3.30 tests to run without skipping.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-24 20:26:23 +01:00
José Fonseca
7380ce9bf6 llvmpipe: Advertise GLSL 3.30.
According to Roland all TGSI support is there in theory.

In practice there are a few piglit failures and crashes, as this hadn't
been tested before.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-24 20:26:23 +01:00
José Fonseca
5f493eed69 st/xlib: Honour request of 3.1 contexts through core profile where available.
The GLX_ARB_create_context_profile spec says:

    "If version 3.1 is requested, the context returned may implement
    any of the following versions:

      * Version 3.1. The GL_ARB_compatibility extension may or may not
        be implemented, as determined by the implementation.

      * The core profile of version 3.2 or greater."

Mesa does not support GL_ARB_compatibility, and there are no plans to
ever support it, therefore the only chance to honour a 3.1 context is
through core profile, i.e, the 2nd alternative from the spec.

This change does that.  And with it piglit tests that require 3.1
contexts no longer skip.

Assuming there is no objection with this change, src/glx/dri_common.c
and src/gallium/state_trackers/wgl/stw_context.c should also be updated
accordingly, given they have the same logic.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-24 20:26:23 +01:00
Zack Rusin
1c73e919a4 draw/llvm: reduce memory usage
Lets make draw_get_option_use_llvm function available unconditionally
and use it to avoid useless allocations when LLVM paths are active.
TGSI machine is never used when we're using LLVM.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 13:59:24 -04:00
Brian Paul
552a8e44a9 docs: fix typo in 10.1.1 release notes URL 2014-04-24 08:37:23 -06:00
Brian Paul
0a92c88a51 swrast: move texture_slices() calls out of loops
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
Brian Paul
1a7fa8b2eb swrast: move null pointer check earlier in _swrast_map_teximage()
There's no reason to compute texel size, stride, etc. if there's no
image data to map.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
Brian Paul
5e81e6e268 swrast: remove _mesa_ prefix from static function
And add a const qualifier.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
Brian Paul
7cc2e2e99d swrast: allocate swrast_texture_image::ImageSlices array if needed
Fixes a segmentation fault in conform divzero.c test.
This happens when glTexImage(level, width=0, height=0) is called.  We
don't allocate texture memory in that case so the ImageSlices array
was never allocated.

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

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-24 08:16:01 -06:00
nick
15c92464df swrast: Fix vertex color in _swsetup_Translate()
Straightforward fix to properly load dest->color with color data, as
opposed to position data as previously implemented.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27499
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-24 08:16:00 -06:00
José Fonseca
1527a545a4 gallivm: Fix wrong operator in lp_exec_default.
Courtesy of MSVC static code analyser.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-24 14:49:53 +01:00
José Fonseca
878877d3c4 mesa/st: Handle empty frame-buffers without asserting.
Fixes assertion failures with radeonsi.

Tested-by: Marek Olšák <maraeo@gmail.com>
2014-04-24 14:48:37 +01:00
José Fonseca
fd92346c53 mesa/st: Fix pipe_framebuffer_state::height for PIPE_TEXTURE_1D_ARRAY.
This prevents buffer overflow w/ llvmpipe when running piglit

  bin/gl-3.2-layered-rendering-clear-color-all-types 1d_array single_level -fbo -auto

v2: Compute the framebuffer size as the minimum size, as pointed out by
Brian;  compacted code;  ran piglit quick test list (with no
regressions.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-23 19:12:23 +01:00
José Fonseca
7a8667f2b3 util/u_debug: Pass correct size to strncat.
Courtesy of Clang static analyzer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-23 19:12:23 +01:00
Rob Clark
05b3cea77b freedreno/a3xx: fix TOTALATTRTOVS
In cases where varying fetches are optimized away (just pass-through in
vertex shader, but unused in fragment shader) we need to calculate the
correct TOTALATTROVS based on the actual number of varyings fetched,
otherwise lockup.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-23 07:32:16 -04:00
Kenneth Graunke
34a68345e2 i965: Make Broadwell HiZ path arrange for TC flushes.
HiZ operations make the depth/render caches out of sync with the sampler
caches.  We need to arrange for a TC flush to happen before the target
buffer is used by the sampler.  Calling brw_render_cache_set_add_bo
makes that happen.

On previous generations, brw_blorp_exec took care of flushing the
texture cache by calling intel_batchbuffer_emit_mi_flush after doing
any rendering.  If we were to use the normal drawing path, then
brw_postdraw_set_buffers_need_resolve would handle this.

On Broadwell, we don't use BLORP, and we don't emit a rectangle
primitive via the normal drawing path.  The 3DSTATE_WM_HZ_OP and
PIPE_CONTROL implicitly make drawing happen.  So, none of our existing
code makes this flush happen - we need to do it directly.

Fixes 11 Piglit copyteximage subtests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77223
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77226
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-22 10:57:11 -07:00
Matt Turner
fe49949392 i965: Use uint16_t for control/src index tables.
No need to use 32-bits to store 15 and 12.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-22 09:12:31 -07:00
Matt Turner
f02f489295 i965/disasm: Fix s/xoo/xor/ typo.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-22 09:12:31 -07:00
Matt Turner
06501b3cf0 i965/disasm: Remove tables with obvious mappings.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-22 09:12:31 -07:00
Ilia Mirkin
5ce3f2fe72 mesa/st: enable EXT_shader_integer_mix when NativeIntegers is on
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-22 11:27:34 -04:00
Christian König
7eda318ffe st/omx/enc: implement frame reordering and B-frames
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-22 16:42:08 +02:00
Leo Liu
b03be6908e st/omx/enc: replace omx buffer with texture buffer
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-22 15:13:08 +02:00
Michel Dänzer
360038fa50 radeonsi: Fix calculation of number of banks for SI
The way cik_num_banks() was calculating the index only makes sense for
the CIK specific macrotile mode array. For SI, we need to use the tile
mode index directly.

This happened to work most of the time because most of the SI tiling
modes use the same number of banks.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-22 12:07:07 +09:00
Chris Forbes
0dfa6e7cf5 glsl: Only allow invariant on shader in/out between stages.
Previously this was special-cased for VS and FS; it never got updated
when geometry shaders came along. Generalize using is_varying_var() so
this won't be broken again with tessellation.

Note that there are two copies of the logic for `invariant`: It can be
present as part of a new declaration, and also as a redeclaration of an
existing variable or block member.

Fixes the four new piglits:
   spec/glsl-1.50/compiler/invariant-qualifier-*.geom

Note for stable: This won't quite pick cleanly due to whitespace and
state->target -> state->stage renames. Should be straightforward
adjustments though.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-22 09:07:05 +12:00
Brian Paul
0a0075666c svga: move draw debug code into separate function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-21 14:54:28 -06:00
Brian Paul
e959274081 mesa: move declaration before code
To fix MSVC build.
2014-04-21 13:24:26 -06:00
Anuj Phogat
f8ae2a56c6 mesa: Fix error code generation in glReadPixels()
Section 4.3.1, page 220, of OpenGL 3.3 specification explains
the error conditions for glreadPixels():

   "If the format is DEPTH_STENCIL, then values are taken from
    both the depth buffer and the stencil buffer. If there is
    no depth buffer or if there is no stencil buffer, then the
    error INVALID_OPERATION occurs. If the type parameter is
    not UNSIGNED_INT_24_8 or FLOAT_32_UNSIGNED_INT_24_8_REV,
    then the error INVALID_ENUM occurs."

Fixes failing Khronos CTS test packed_depth_stencil_error.test

V2: Avoid code duplication

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 11:20:50 -07:00
Anuj Phogat
bd1880dfe8 mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()
From the OpenGL 4.4 spec page 275:
  "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, param will
   contain the format of components of the specified attachment,
   one of FLOAT, INT, UNSIGNED_INT, SIGNED_NORMALIZED, or
   UNSIGNED_NORMALIZED for floating-point, signed integer,
   unsigned integer, signed normalized fixedpoint, or unsigned
   normalized fixed-point components respectively. If no data
   storage or texture image has been specified for the attachment,
   param will contain NONE. This query cannot be performed for a
   combined depth+stencil attachment, since it does not have a
   single format."

Fixes Khronos CTS test: packed_depth_stencil_parameters.test

Khronos Bug# 9170
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 11:20:50 -07:00
Brian Paul
7cb3bbf2cd libgl-gdi: silence unused variable warning when not using LLVM 2014-04-21 09:50:53 -06:00
Brian Paul
1f043cd95a docs: import 10.0.5 release notes and update links 2014-04-21 09:03:32 -06:00
Brian Paul
3fd9943a65 docs: import 10.1.1 release notes, update links 2014-04-21 09:03:32 -06:00
Benjamin Bellec
9b3b9c613f mesa: fix GetStringi error message with correct function name
Signed-off-by: Benjamin Bellec <b.bellec@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>
2014-04-21 08:44:20 -06:00
Brian Paul
27496af67f st/mesa: fix invalid pointer use in st_texture_get_sampler_view()
The '**used' pointer was pointing into the stObj->sampler_views array.
If 'free' was null, we'd realloc that array, thus making the 'used'
pointer invalid.  This soon led to memory errors.

Just change the pointer to be '*used' so it points directly at the
pipe_sampler_view.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-21 08:30:46 -06:00
Chris Forbes
9fec560e63 glsl: Fix typo
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-21 16:02:02 +12:00
Chris Forbes
d63026f62a i965: Use ctx->Texture._MaxEnabledTexImageUnit for upper bound
Avoid looping over 32/48/96 (!!) tex image units every draw, most of
which we don't care about.

Improves performance on everyone's favorite not-a-benchmark by 2.9% on
Haswell.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 10:13:07 +12:00
Chris Forbes
c4a98e76d7 mesa: Track max enabled tex image unit
This gives us a better bound for some hot loops in the drivers than
MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
hardware, and only getting worse as more shader stages are added.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-21 10:12:00 +12:00
Ilia Mirkin
ba6dcb3c2b nouveau/codegen: add missing values for OP_TXLQ into the target arrays
Also rework things so that if someone were to add an opcode without
adjusting the values in these arrays, there will be a compilation error.

This fixes a few quadop-related piglit regressions since commit
d5faf8e786.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Ilia Mirkin
47c19a5819 nvc0: change logic for centering of eng2d blit when downsampling
We want to center the sample. The old code may have been correct given
the limited values of ms_x/y, but the new logic should be more
intuitive. Note that ms_x can only be 1/2 and ms_y can only be 0/1.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Ilia Mirkin
6d5c3c8260 nv50: use 2d blit when src/dst have same number of samples
The 2D engine should be usable in more cases, but this fixes MS blits
between textures with the same MS settings. Otherwise a single sample is
selected to be the target texel value.

This allows other tests to work that render to a RB and then blit that
to a texture for input into a shader that uses sampler2DMS to verify it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Ilia Mirkin
2d2e60bdee gallium/docs: fix PIPE_CAP_ENDIANNESS delimiter, remove trailing spaces
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-19 13:23:32 -04:00
Petri Latvala
b45f65e760 mesa: update glext.h to version 20140313
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-18 14:30:57 -07:00
Kenneth Graunke
a1273a07ed i965/fs: Implement fs_inst::force_sechalf support on Broadwell.
Back when I originally wrote this code, force_sechalf was only used for
Gen4 code, so I didn't bother hooking it up.  However, it's used more
generally these days.  In particular, we use it for computing
gl_SamplePosition.

Fixes Piglit's spec/ARB_sample_shading/builtin-gl-sample-position tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77222
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-18 11:57:33 -07:00
Chris Forbes
92840aabf7 glsl: Allow explicit binding on atomics again
As of 943b2d52bf, layout(binding) on an atomic would fail the assertion
here.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 10:35:05 -07:00
Alex Deucher
7489f3eeda radeonsi: fix num banks selection on SI for dma setup (v2)
The number of banks varies based on the tile mode index
just like CIK.

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

v2: fix ordering for nbanks calculation for consistency

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-04-18 13:24:12 -04:00
Matt Turner
f770123f58 i965/fs: Reduce restrictions on interference in register coalescing.
We previously only allowed coalescing registers that interfere (i.e.,
whose live ranges overlap) if the destination register's live range was
entirely inside the source's live range. This is unnecessary -- we only
need to check for interfering writes in the intersection of their live
ranges.

total instructions in shared programs: 1639470 -> 1638453 (-0.06%)
instructions in affected programs:     84751 -> 83734 (-1.20%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
55de1c035c i965/fs: Give up in interference check if we see a WHILE.
Rather than any old control flow. Muchnick's algorithm just checks for
interfering writes between the MOV and the end of the program. Handling
this when you have backward branches is hard, so don't, but there's no
reason to bail if you see forward branches.

instructions in affected programs:     4270 -> 4248 (-0.52%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
5ff1e446d4 i965/fs: Simplify interference scan in register coalescing.
We were starting at the beginning of the instruction list, rather than
with the MOV instruction itself. This allows us to coalesce after
control flow.

Excluding the shaders from an unreleased title, the shader-db results:

total instructions in shared programs: 1603791 -> 1594215 (-0.60%)
instructions in affected programs:     678772 -> 669196 (-1.41%)
GAINED:                                5
LOST:                                  0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
04a4e43eb2 i965/fs: Unindent can_coalesce_vars().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
a975b2f55c i965/fs: Recognize nop-MOV instructions early.
And avoid rewriting other instructions unnecessarily. Removes a few
self-moves we weren't able to handle because they were components of a
large VGRF.

instructions in affected programs:     830 -> 826 (-0.48%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Matt Turner
ef6127ff69 i965/fs: Only sweep NOPs if register coalescing made progress.
Otherwise there's nothing to do.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-18 09:16:19 -07:00
Marek Olšák
352e06ddea r600g,radeonsi: don't skip the context flush if a fence should be returned
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77589
2014-04-18 13:33:57 +02:00
Brian Paul
744d2a225d svga: fix comment for emit_adjusted_vertex_attribs() 2014-04-17 16:15:37 -06:00
Brian Paul
cb34575e19 svga: compute need_swvfetch in svga_create_vertex_elements_state()
This saves us doing it at state validation time.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-04-17 11:31:15 -07:00
Brian Paul
851645a3e7 svga: add VS code to set attribute W component to 1
There's a few 3-component vertex attribute formats that have no
equivalent SVGA3D_DECLTYPE_x format.  Previously, we had to use
the swtnl code to handle them.  This patch lets us use hwtnl for
more vertex attribute types by fetching 3-component attributes as
4-component attributes and explicitly setting the W component to 1.

This lets us handle PIPE_FORMAT_R16G16B16_SNORM/UNORM and
PIPE_FORMAT_R8G8B8_UNORM vertex attribs without using the swtnl path.

Fixes piglit normal3b3s GL_SHORT test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:33 -07:00
Brian Paul
615a356ee3 svga: implement support for signed byte vertex attributes
There's no SVGA3D_DECLTYPE that directly corresponds to
PIPE_FORMAT_R8G8B8_SNORM.  Previously, we used the swtnl fallback
path to handle this but that's slow and causes invariance issues.
Now we fetch the attribute as SVGA3D_DECLTYPE_UBYTE4N and insert
some extra VS instructions to remap the attributes from the range
[0,1] to the range[-1,1].

Fixes Sauerbraten sw fallback.
Fixes piglit normal3b3s-invariance test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:33 -07:00
Brian Paul
52faafa174 svga: move translated vertex declaration types into svga_velems_state
Now only translate the formats once in svga_create_vertex_elements_state().
And rename the array and use the proper SVGA3dDeclType type.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Brian Paul
0f5add1959 Revert "svga: add work-around for Sauerbraten Z fighting issue"
This reverts commit c875d6e57a.

Conflicts:
	src/gallium/drivers/svga/svga_context.c

This work-around will no longer be needed after the next patch
which properly supports signed-byte vertex attributes.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Brian Paul
7c7ab5434a svga: use new inst_token_setp() helper function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Brian Paul
8e131576ee svga: use new inst_token_predicated() helper function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-04-17 11:29:32 -07:00
Kenneth Graunke
71846a943f i965: Retype pre-Gen6 varying pull load destination to UW.
This sets up the proper execution mask for sends in SIMD16 mode.

Fixes Piglit's glsl-fs-normalmatrix, glsl-fs-uniform-array-2,
glsl-fs-uniform-array-6, and glsl-fs-uniform-array-7 on Ironlake,
which regressed when I enabled SIMD16 pull parameter support in
commit b207e88b25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-17 10:54:00 -07:00
Anuj Phogat
ee10e893cb mesa: Fix error condition for multisample proxy texture targets
Fixes failures in Khronos OpenGL CTS test proxy_textures_invalid_samples

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:26:39 -07:00
Anuj Phogat
1d350b9e22 i965: Add glBlitFramebuffer to commands affected by conditional rendering
Fixes failures in Khronos OpenGL CTS test conditional_render_test9

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:26:39 -07:00
Anuj Phogat
8ed42ddd7d swrast: Add glBlitFramebuffer to commands affected by conditional rendering
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 10:26:05 -07:00
Anuj Phogat
48fc2703e5 i965: Fix component mask and varying_to_slot mapping for gl_ViewportIndex
gl_ViewportIndex doesn't get its own varying slot. It is stored
in VARYING_SLOT_PSIZ.z. This patch fixes the issue for both gen7
and gen8 because gen7_upload_3dstate_so_decl_list() is shared
between them.

Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins.
Makes new piglit test glsl-1.50-transform-feedback-builtins pass for
'gl_ViewportIndex'.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:08:28 -07:00
Anuj Phogat
7928b9c249 i965: Fix component mask and varying_to_slot mapping for gl_Layer
gl_Layer doesn't get its own varying slot. It is stored in
VARYING_SLOT_PSIZ.y. This patch fixes the issue for both gen7
and gen8 because gen7_upload_3dstate_so_decl_list() is shared
between them.

Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins.
Makes new piglit test glsl-1.50-transform-feedback-builtins pass for
'gl_Layer'.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:08:28 -07:00
Anuj Phogat
969b461c2b i965: Put an assertion to check valid varying_to_slot[varying]
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-17 10:08:28 -07:00
Darren Powell
bc86690f13 radeonsi: Added Diag Handler to receive LLVM Error messages
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-17 19:37:58 -04:00
Marek Olšák
9f9ab8ec0d winsys/radeon: remove some unused code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:19 +02:00
Marek Olšák
8b966bcaf2 winsys/radeon: remove is_handle_added array
Use index -1 if a buffer is not added.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:19 +02:00
Marek Olšák
b0fca0a378 winsys/radeon: remove local variable reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:18 +02:00
Marek Olšák
3384a41aa9 winsys/radeon: remove parameter reloc from radeon_get_reloc
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-04-17 13:54:18 +02:00
José Fonseca
75e487538d util: Add __declspec(noreturn) to _debug_assert_fail().
Mostly for consistency; as MSVC's static source code analysis doesn't
seem to rely on assertions, but instead on different kind of source
annotations( http://msdn.microsoft.com/en-us/library/hh916383.aspx ).

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 09:56:49 +01:00
José Fonseca
a2b89c4ae1 auxiliary/os,auxiliary/util: Fix the ‘noreturn’ function does return warning.
Now that _debug_assert_fail() has the noreturn attribute, it is better
that execution truly never returns.  Not just for sake of silencing the
warning, but because the code at the return IP address may be invalid or
lead to inconsistent results.

This removes support for the GALLIUM_ABORT_ON_ASSERT debugging
environment variable, but between the usefulness of
GALLIUM_ABORT_ON_ASSERT and better static code analysis I think better
static code analysis wins.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 09:56:48 +01:00
José Fonseca
97fa9cd220 scons: Enable building through Clang Static Analyzer.
Same intent as commit a45a50a482,
but this the C compiler is detected via C-preprocessor macros,
similar to how autotools do it, as that seems to be the most
reliable method.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-17 09:56:48 +01:00
Maarten Lankhorst
74f19445cc gallium glsl: Fix crash with piglit fs-deref-literal-array-of-structs.shader_test
This allows the following shader code to work without a weird crash:

struct Foo {
  int value[1];
};

int actual_value = Foo[2](Foo(int[1](100)), Foo(int[1](200)))[i].value[0];

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-04-17 10:34:10 +02:00
Maarten Lankhorst
49d26a277d nouveau/vdec: small fixes to h264 handling
nouveau_vp3_inter_sizes requires sliec_count as argument just
as the other places that call it from h264 code do. Hopefully
fixes something.

Fix the status_vp code to allow status == 0 too, when processing
hasn't started yet.

set h264->second_field correctly.
2014-04-17 10:30:39 +02:00
Thomas Hellstrom
09cd376353 st/xa: Cache render target surface
Otherwise it will trick the gallium driver into thinking that the render
target has actually changed (due to different pipe_surface pointing to
same underlying pipe_resource).  This is really badness for tiling GPUs
like adreno.

This also appears to fix a rendering error with Motif on vmwgfx.
Why that is is still under investigation.

Based on an idea by Rob Clark.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
2014-04-17 09:56:28 +02:00
Rob Clark
a45ae814d1 st/xa: scissor to help tilers
Keep track of the maximal bounds of all the operations and set scissor
accordingly.  For tiling GPU's this can be a big win by reducing the
memory bandwidth spent moving pixels from system memory to tile buffer
and back.

You could imagine being more sophisticated and splitting up disjoint
operations.  But this simplistic approach is good enough for the common
cases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-17 09:42:06 +02:00
Rob Clark
3c52013273 st/xa: remove unneeded args
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-17 09:40:42 +02:00
Iago Toral Quiroga
cda5e0c25e glsl: Small optimization for constant conditionals
Once the relevant branch has been identified do not iterate over the
instructions in the branch, do a linked list insertion instead to avoid the
loop.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 23:39:57 -07:00
Iago Toral Quiroga
4472ab9e6d glsl: Fix incorrect indentation.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 23:22:24 -07:00
Chris Forbes
d1b6f67110 meta: Clip src/dest rects in BlitFramebuffer, using the scissor
Fixes piglit's fbo-blit-stretch test on drivers which use the meta path.
(i965: should fix Broadwell, but also fixes Sandybridge/Ivybridge/Haswell
since this test falls off the blorp path now due to format conversion)

V2: Use scissor instead of just mangling the rects, to avoid texcoord
rounding problems. (Thanks Marek)

V3: Rebase on Eric's CTSI meta changes; re-add _mesa_update_state in the
CTSI path so that _mesa_clip_blit sees the correct bounds.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77414
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-17 18:11:24 +12:00
Samuel Iglesias Gonsalvez
9927180714 mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()
According to the spec:
	<renderbuffertarget> must be RENDERBUFFER and <renderbuffer>
	should be set to the name of the renderbuffer object to be
	attached to the framebuffer.  <renderbuffer> must be either
	zero or the name of an existing renderbuffer object of type
	<renderbuffertarget>, otherwise an INVALID_OPERATION error is
	generated.

This patch changes the previous returned GL_INVALID_VALUE to
GL_INVALID_OPERATION.

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

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
2014-04-16 23:00:40 -07:00
Matt Turner
42a26cb5e4 i965: Don't make instructions with a null dest a barrier to scheduling.
Now that we properly track accumulator dependencies, the scheduler is
able to schedule instructions between the mach and mov in the common
the integer multiplication pattern:

   mul  acc0, x, y
   mach null, x, y
   mov  dest, acc0

Since a null destination implies no dependency on the destination, we
can also safely schedule instructions (that don't write the accumulator)
between the mul and mach.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
a6860100b8 i965/fs: Change fs_visitor::emit_lrp to use MAC for gen<6
This allows us to emit ADD/MUL/MAC instead of MUL/ADD/MUL/ADD,
saving one instruction and two temporary registers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
da0c3b02e7 i965/fs: Add support for the MAC instruction.
This allows us to generate the MAC (multiply-accumulate) instruction,
which can be used to implement some expressions in fewer instructions
than doing a series of MUL and ADDs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
2dfbbeca50 i965/vec4: Change vec4_visitor::emit_lrp to use MAC for gen<6
This allows us to emit ADD/MUL/MAC instead of MUL/ADD/MUL/ADD,
saving one instruction and two temporary registers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
0974706671 i965/vec4: Add support for the MAC instruction.
This allows us to generate the MAC (multiply-accumulate) instruction,
which can be used to implement some expressions in fewer instructions
than doing a series of MUL and ADDs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
306ed81b93 i965: Add writes_accumulator flag
Our hardware has an "accumulator" register, which can be used to store
intermediate results across multiple instructions.  Many instructions
can implicitly write a value to the accumulator in addition to their
normal destination register.  This is enabled by the "AccWrEn" flag.

This patch introduces a new flag, inst->writes_accumulator, which
allows us to express the AccWrEn notion in the IR.  It also creates a
n ALU2_ACC macro to easily define emitters for instructions that
implicitly write the accumulator.

Previously, we only supported implicit accumulator writes from the
ADDC, SUBB, and MACH instructions.  We always enabled them on those
instructions, and left them disabled for other instructions.

To take advantage of the MAC (multiply-accumulate) instruction, we
need to be able to set AccWrEn on other types of instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Juha-Pekka Heikkila
30c35d1dcb i965: Add is_accumulator() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-04-16 22:46:45 -07:00
Matt Turner
6541f1b4d0 i965: Add reads_accumulator_implicitly() function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 22:46:44 -07:00
Anuj Phogat
cb6566f9df mesa: Add error condition for integer formats in glGetTexImage()
OpenGL 4.0 spec, page 306 suggests an INVALID_OPERATION in glGetTexImage
if :
   "format is one of the integer formats in table 3.3 and the internal
    format of the texture image is not integer, or format is not one of
    the integer formats in table 3.3 and the internal format is integer."

V2: Use helper function _mesa_is_format_integer()

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 18:37:06 -07:00
Anuj Phogat
3135668254 mesa: Add helper function _mesa_is_format_integer()
This function will be used in the following patch.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 18:37:06 -07:00
Anuj Phogat
fdd8bebc22 mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)
mesa currently returns 4 when GL_VERTEX_ATTRIB_ARRAY_SIZE is queried
for a vertex array initially set up with size=GL_BGRA. This patch
makes changes to return size=GL_BGRA as required by the spec.

Fixes Khronos OpenGL CTS test: vertex_array_bgra_basic.test

V2: Use array->Format instead of adding a new variable

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
2014-04-16 18:37:06 -07:00
Anuj Phogat
80b4a36fed glsl: Fix copy-paste error in linker_warning()
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-16 18:37:06 -07:00
Michel Dänzer
7286739b9b r600g: Disable LLVM by default at runtime for graphics
For graphics, the LLVM compiler backend currently has many shortcomings
compared to the non-LLVM one. E.g. it can't handle geometry shaders yet,
but that's just the tip of the iceberg.

So building Mesa with --enable-r600-llvm-compiler is currently not
recommended for anyone who doesn't want to work on fixing those issues.
However, for protection of users who end up enabling it anyway for some
reason, let's disable the LLVM backend at runtime by default. It can be
enabled with the environment variable R600_DEBUG=llvm.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-17 10:15:59 +09:00
Roland Scheidegger
f23d1160c2 gallivm: fix compilation with llvm 3.5 r206241+
Just adjust to the ever-changing API, pass in MCContext when creating the
MCDisassembler.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-16 19:57:47 +02:00
José Fonseca
e3c58cdfd9 Revert "scons: Enable building through Clang Static Analyzer."
This reverts commit a45a50a482.

Unfortunately gcc dumps argv[0] as the first word of --version, so it is
unreliable for detecting gcc.

In particular `cc --version` and `i686-w64-mingw32-gcc --version` give
wrong results.

A better solution needs to be found -- most likely using C-preprocessing
like autotools does.  Revert for now.
2014-04-16 13:18:06 +01:00
Marek Olšák
11459436d9 r600g,radeonsi: share some of gfx flush code
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:52 +02:00
Marek Olšák
adfadeadd8 r600g,radeonsi: share r600_flush_from_st
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:52 +02:00
Marek Olšák
586011486d r600g: merge r600_flush with r600_context_flush
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
d4edc60767 radeonsi: merge si_flush with si_context_flush
This also removes si_flush_gfx_ring.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
70cf6639c3 gallium/radeon: create and return a fence in the flush function
All flush functions get a fence parameter. cs_create_fence is removed.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
3e9d2cbca2 r600g: remove redundant r600_flush_dma_from_winsys
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
dd72c327e9 winsys/radeon: fold cs_set_flush_callback into cs_create
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
c6033a6cb8 radeonsi: cleanup redundant computation of flush flags and rename a function
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
fc151b08be r600g: remove redundant r600_flush_from_winsys
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
b2238b3452 winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc
The only difference is that it doesn't write to the CS and only returns
the index.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
Marek Olšák
927213f33d winsys/radeon: consolidate hash table lookup
I should have done this long ago.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-16 14:02:51 +02:00
José Fonseca
d3c0e236f2 scons: Add an analyze option.
For Clang static code analyzer, the scan-build script will produce more
comprehensive output.  Nevertheless you can invoke it as

  CC=clang CXX=clang++ scons analyze=1

For MSVC this is the best way to use its static code analysis.  Simply
invoke as

  scons analyze=1

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 11:44:21 +01:00
José Fonseca
f81305c0cb util/u_debug: Add noreturn attribute to _debug_assert_fail().
As recommended by
http://clang-analyzer.llvm.org/annotations.html#attr_noreturn

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 11:44:17 +01:00
José Fonseca
a45a50a482 scons: Enable building through Clang Static Analyzer.
By accurately detecting gcc/clang through --version option instead
of executable name.

Clang Static Analyzer reports many issues, most false positives, but it
found at least one real and subtle use-after-free issue
in st_texture_get_sampler_view():

  http://people.freedesktop.org/~jrfonseca/scan-build-2014-04-14-1/report-869047.html#EndPath

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-16 11:44:06 +01:00
Iago Toral Quiroga
6d0e30c6a3 glsl: Properly handle blocks that define the same field name.
Currently we can have name space collisions between blocks that define the same
fields. For example:

in block
{
    vec4 Color;
} In[];

out block
{
    vec4 Color;
} Out;

These two blocks will assign the same interface name (block.Color) to the Color
field in flatten_named_interface_blocks_declarations.cpp, leading to havoc.
This was breaking badly the gl-320-primitive-shading test from ogl-samples.

The patch uses the block instance name to avoid collisions, producing names
like block.In.Color and block.Out.Color to avoid the name clash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76394
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 22:18:43 -07:00
Michel Dänzer
6ac5a5e383 r600g/radeonsi: Map transfer staging texture unsynchronized when possible
The transfer staging texture is always freshly allocated, so for write-only
transfers we don't need to explicitly wait for the BO to become idle.

Squeezes a few hundered MB/s more out of x11perf -shmput500 with glamor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-16 12:11:27 +09:00
Matt Turner
9fed627234 Revert "i965/fs: Only sweep NOPs if register coalescing made progress."
This reverts commit f092e8951c.

Didn't mean to push this...
2014-04-15 17:27:55 -07:00
Matt Turner
f092e8951c i965/fs: Only sweep NOPs if register coalescing made progress.
Otherwise there's nothing to do.
2014-04-15 16:28:04 -07:00
Eric Anholt
7ae870211d i965: Fix buffer overruns in MSAA MCS buffer clearing.
This manifested as rendering failures or sometimes GPU hangs in
compositors when they accidentally got MSAA visuals due to a bug in the X
Server.  Today we decided that the problem in compositors was equivalent
to a corruption bug we'd noticed recently in resizing MSAA-visual
glxgears, and debugging got a lot easier.

When we allocate our MCS MT, libdrm takes the size we request, aligns it
to Y tile size (blowing it up from 300x300=900000 bytes to 384*320=122880
bytes, 30 pages), then puts it into a power-of-two-sized BO (131072 bytes,
32 pages).  Because it's Y tiled, we attach a 384-byte-stride fence to it.
When we memset by the BO size in Mesa, between bytes 122880 and 131072 the
data gets stored to the first 20 or so scanlines of each of the 3 tiled
pages in that row, even though only 2 of those pages were allocated by
libdrm.  In the glxgears case, the missing 3rd page happened to
consistently be the static VBO that got mapped right after the first MCS
allocation, so corruption only appeared once window resize made us throw
out the old MCS and then allocate the same BO to back the new MCS.

Instead, just memset the amount of data we actually asked libdrm to
allocate for, which will be smaller (more efficient) and not overrun.
Thanks go to Kenneth for doing most of the hard debugging to eliminate a
lot of the search space for the bug.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:47 -07:00
Eric Anholt
e5b86cb64b meta: Add support for MSAA resolves from 2D_MS_ARRAY textures.
We don't have any piglit tests for this currently.

v2: Use vec3s for the texcoords so it has some hope of working.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:45 -07:00
Eric Anholt
234db60954 meta: Add an accelerated glCopyTexSubImage using glBlitFramebuffer.
You'll note from the previous commits that there's something of a loop
here: You call CTSI, which calls BlitFB, then if things go wrong that
falls back to CTSI.  As a result, meta CTSI reaches over into blitfb to
tell it "no, don't try that fallback".

v2: Drop the _mesa_update_state(), which was only necessary due to use of
    _mesa_clip_blit() in _mesa_meta_BlitFramebuffer() in another patch
    series.
v3: Drop an _EXT suffix I copy-and-pasted.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
70961c032f meta: Add support for CUBE_MAP_ARRAY to generatemipmap.
I added support to bind_fbo_image in the process of building meta
CopyTexSubImage, and found that it broke generatemipmap because previously
we would just throw a GL error there and then end up with an incomplete
FBO and fallback.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
bb3f983d10 meta: Infer bind_fbo_image parameters from an incoming image.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
cd808ac848 meta: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.
I need to do the same code again for CopyTexSubImage().

v2: Drop incorrect, not-terribly-useful comment (review by Ken)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
4cc42805e7 meta: Refactor the BlitFramebuffer depth CopyTexImage fallback.
This avoids a ReadPixels() if there's accelerated CopyTexImage present.
It now requires GLSL as opposed to just fragment programs, but we don't
have any drivers that do ARB_fp but not GLSL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 14:34:22 -07:00
Eric Anholt
b702233f53 meta: Refactor the BlitFramebuffer color CopyTexImage fallback.
There shouldn't be anything special about copying out a subset of the src
rb to a temp before texturing from it, so just do it when we're figuring
out our src texture binding.

This drops Anuj's change to copy an extra border of 1 pixel around the src
area.  I can't see how that change could be valid, and presumably if
there's some filtering problem at edges we just need to set the right
wrap mode.

v2: Don't fall back to swrast on non-2D/RECT/2D_MS textures when we can
    still CopyTexSubImage.  Fixes a segfault regression on i965 with
    gl-3.2-layered-rendering-blit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-15 14:34:06 -07:00
Eric Anholt
4e43299633 meta: Drop blit src size fallback.
I think we can assert that renderbuffer size is <= maximum 2D texture
size.  Our source coordinates should have already been clipped to the src
renderbuffer size, but haven't actually (so we could potentially have
trouble if there's scaling, and we're in the CopyTexImage path that tries
to use src size).  However, this texture size dependency was blocking the
next refactors, so I'm not sure if we want to go ahead with this series
before we get the clipping sorted out or not.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 12:27:37 -07:00
Mike Stroyan
602510395a i965: Avoid dependency hints on math opcodes
Putting NoDDClr and NoDDChk dependency control on instruction
sequences that include math opcodes can cause corruption of channels.
Treat math opcodes like send opcodes and suppress dependency hinting.

Signed-off-by: Mike Stroyan <mike@LunarG.com>
Tested-by: Tony Bertapelli <anthony.p.bertapelli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-15 10:31:46 -07:00
Matt Turner
ad48a9a319 i965: Expand INTEL_DEBUG to uint64_t.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 10:29:00 -07:00
Matt Turner
58db339599 dri: Expand driParseDebugString return value to uint64_t.
Users will downcast if they don't have >32 debug flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-15 10:28:57 -07:00
Matt Turner
73400d8f70 i965/fs: Remove dead_code_eliminate_local().
Subsumed by the new dead_code_eliminate() function. No shader-db
changes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-15 09:25:47 -07:00
Matt Turner
18d12336b9 i965/fs: Clear variable from live-set if it's completely overwritten.
One program affected:

instructions in affected programs:     246 -> 244 (-0.81%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-15 09:25:44 -07:00
Matt Turner
f34f39330b i965/fs: Reimplement dead_code_elimination().
total instructions in shared programs: 1653399 -> 1651790 (-0.10%)
instructions in affected programs:     92157 -> 90548 (-1.75%)
GAINED:                                2
LOST:                                  2

Also significantly reduces the number of optimization loop iterations:

total loop iterations in shared programs: 39724 -> 31651 (-20.32%)
loop iterations in affected programs:     21617 -> 13544 (-37.35%)

Including some great pathological cases, like 29 -> 3 in Strike Suit
Zero and 24 -> 3 in Dota2.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-15 09:25:11 -07:00
Matt Turner
596737ee91 i965/vec4: Let DCE eliminate dead writes in other basic blocks.
We previously stopped searching for unread writes after encountering
control flow, but we can instead just search backwards until we hit
control flow.

instructions in affected programs:     22854 -> 22194 (-2.89%)
2014-04-15 09:24:09 -07:00
Matt Turner
4dcfb92417 i965/gs: Add dummy source to prepare_channel_masks instruction.
The generator uses its destination as a source implicitly, which breaks
some assumptions in dead code elimination. Giving the instruction a
source allows us to reason about it better.
2014-04-15 09:24:09 -07:00
Matt Turner
d877c643be glsl: Use M_PI_* macros.
Notice our multiple values for M_PI_2, which rounded ...32 up to
...4 and ...5.
2014-04-15 09:24:09 -07:00
Kenneth Graunke
4f20b7d3dd i965: Disable Z16 in all APIs.
We originally thought that GL 3.0 required GL_DEPTH_COMPONENT16 to map
exactly to Z16.  However, we misread the specification, thanks in part
to LaTeX reordering the tables in the PDF.

Page 180 of the GL 3.0 specification (glspec30.20080923.pdf) says:
"[...] memory allocation per texture component is assigned by the GL to
match the allocations listed in tables 3.16-3.18 as closely as possible.
[...]

Required Texture Formats
[...]
In addition, implementations are required to support the following sized
internal formats.  Requesting one of these internal formats for any
texture type will allocate exactly the internal component sizes and
types shown for that format in tables 3.16-3.17:"

Notably, however, GL_DEPTH_COMPONENT16 does /not/ appear in table 3.16
or table 3.17.  It appears in table 3.18, where the "exact" rule doesn't
apply, and it falls back to the "closely as possible" rule.

The confusing part is that the ordering of the tables in the PDF is:

Table 3.16 (pages 182-184)
Table 3.18 (bottom of page 184 to top of 185)
Table 3.17 (page 185)

Presumably, people saw table 3.16, then saw the table immediately
following with DEPTH_COMPONENT* formats, and assumed it was 3.17.

Based on a patch by Chia-I Wu, but without the driconf option to force
Z16 to be used.  It's not required, and there's apparently no benefit
to actually using it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-04-15 02:15:11 -07:00
Kenneth Graunke
be000b4d19 i965: Update comments about Z16 being slow.
We've learned a few things since we originally disabled Z16; this attempts
to summarize the issue.  I am no expert on this subject, though, so the
comment may not be totally accurate.

I did some benchmarking on GM45 and Ironlake, and discovered that for
GLBenchmark 2.7 EgyptHD, using Z16 was 3% slower on GM45 (n=15), and
4.5% slower on Ironlake (n=95).  So, we can drop the "on Ivybridge"
aspect of the comment - it's always slower.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-04-15 02:15:11 -07:00
Michel Dänzer
313104e8d5 r600g/radeonsi: Use caching buffer manager for textures as well
Significantly reduces BO allocation / destruction overhead for transfers,
e.g. measurable via x11perf -shm{ge,pu}t* with glamor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-15 11:34:56 +09:00
Jordan Justen
24c773fb06 i965/gen8: add debug code to show FS disasm with jump locations
Copied from similar code in gen8_vec4_generator.cpp.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-14 10:32:42 -07:00
Chia-I Wu
73a4761058 ilo: remove GPE state size estimation
Use size defines from genhw.
2014-04-14 20:45:04 +08:00
Chia-I Wu
8fa8e9b1b8 ilo: remove GPE command size estimation
Use size defines from genhw.
2014-04-14 20:45:04 +08:00
Chia-I Wu
bdd0546d7c ilo: remove unused headers
Remove intel_*.h.  brw_*.h is still needed by the state dumper and
disassembler.
2014-04-14 20:45:04 +08:00
Chia-I Wu
e55e1610e5 ilo: use only defines from genhw headers
Stop including classic driver headers in genhw.h, with some formatting fixes.
2014-04-14 20:45:04 +08:00
Chia-I Wu
6c6bd796ad ilo: scripted conversion to genhw headers
Hopefully my four hundred line sed script is correct.
2014-04-14 20:45:04 +08:00
Chia-I Wu
01e3e82a56 ilo: add genhw headers
All except genhw.h are generated by https://github.com/olvaffe/envytools/.
intel_chipset.h is deprecated.
2014-04-14 20:45:03 +08:00
Chia-I Wu
d75a8799fd ilo: avoid brw_wm_barycentric_interp_mode in compiler
In preparation for genhw.
2014-04-14 20:45:03 +08:00
Chia-I Wu
ad39b991ce ilo: add TOY_OPCODE_DO
We used to give BRW_OPCODE_DO a special meaning, while we should have used
TOY_OPCODE_DO.
2014-04-14 20:45:03 +08:00
Vinson Lee
36fb36aa36 gtest: Update to 1.7.0.
This patch fixes gtest build errors on Mac OS X 10.9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73106
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-14 00:06:53 -07:00
Chris Forbes
936dda08ee mesa: Consider gl_VertexID and gl_InstanceID active attribs
Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-13 19:27:01 +12:00
Chris Forbes
ca5c8d6cd4 mesa: Extract is_active_attrib() in shaderapi
The rules are about to get a bit more complex to account for
gl_InstanceID and gl_VertexID, which are system values.

Extracting this first avoids introducing duplication.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-13 19:26:56 +12:00
Chris Forbes
aeb03f8aea glsl: Fix typo in interface block comment
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-13 17:02:11 +12:00
Simone Scanzoni
c3b701d63c egl-static: fix build after recent radeon winsys changes
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-04-13 02:37:36 +02:00
Chris Forbes
b92e7f2da9 mesa: Fix typo in error message
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-13 12:38:24 +12:00
Iago Toral Quiroga
a5957f7bc5 i965: glClearBuffer() should only clear a single buffer.
glClearBuffer() is currently clearing all active draw color buffers (all
buffers that have not been set to GL_NONE when calling glDrawBuffers) instead
of only clearing the one it receives as parameter. Altough brw_clear()
receives a bit mask indicating the color buffers that should be cleared,
this mask is ignored when calling brw_blorp_clear_color().

This was breaking the 'fbo-drawbuffers-none glClearBuffer' piglit test.

The patch provides the bit mask to brw_blorp_clear_color() so it can limit
clearing to the color buffers present in the mask.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76832
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-13 12:28:25 +12:00
Chris Forbes
26224d3e00 i965: Add comment to explain the weird-looking shadow compares.
This always looks crazy when I stumble across it, until I remember
what the hardware is doing. Describing it ought to short-circuit
that process next time :)

V2: Fix indents to 6 spaces, not 7.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-13 08:51:46 +12:00
Kenneth Graunke
857f3a68ea glsl: Ignore loop-too-large heuristic if there's bad variable indexing.
Many shaders use a pattern such as:

for (int i = 0; i < NUM_LIGHTS; i++) {
   ...access a uniform array, or shader input/output array...
}

where NUM_LIGHTS is a small constant (such as 2, 4, or 8).

The expectation is that the compiler will unroll those loops, turning
the array access into constant indexing, which is more efficient, and
which may enable array splitting and other optimizations.

In many cases, our heuristic fails - either there's another tiny nested
loop inside, or the estimated number of instructions is just barely
beyond the threshold.  So, we fail to unroll the loop, leaving the
variable indexing in place.

Drivers which don't support the particular flavor of variable indexing
will call lower_variable_index_to_cond_assign(), which generates piles
and piles of immensely inefficient code.  We'd like to avoid generating
that.

This patch detects unsupported forms of variable-indexing in loops, where
the array index is a loop induction variable.  In that case, it bypasses
the loop-too-large heuristic and forces unrolling.

Improves performance in various microbenchmarks: Gl32PSBump8 by 47%,
Gl32ShMapVsm by 80%, and Gl32ShMapPcf by 27%.  No changes in shader-db.

v2: Check ir->array for being an array or matrix, rather than the
    ir_dereference_array itself.
v3: Fix and expand statistics in commit message.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:43 -07:00
Kenneth Graunke
2231db5598 glsl: Rename loop_unroll_count::fail to "nested_loop."
The "fail" flag is set if loop_unroll_count encounters a nested loop;
calling the flag "nested_loop" is a bit clearer.

The original reasoning was that count is inaccurate (too small) if there
are nested loops, as we don't do any sort of analysis on the inner loop.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:41 -07:00
Kenneth Graunke
8268a2f347 glsl: Pass gl_shader_compiler_optimizations to unroll_loops().
Loop unrolling will need to know a few more options in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:39 -07:00
Kenneth Graunke
da22221aa3 glsl: Drop do_common_optimization's max_unroll_iterations parameter.
Now that we pass in gl_shader_compiler_options, it makes sense to just
use options->MaxUnrollIterations, rather than passing a separate
parameter.

Half of the invocations already passed options->MaxUnrollIterations,
while the other half passed in a hardcoded value of 32.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:37 -07:00
Kenneth Graunke
f00a6483e9 i965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.
This will prevent the two from getting out of sync again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:36 -07:00
Kenneth Graunke
320e0c5205 i965: Correct EmitNoIndirect shader compiler option flags.
These were out of sync with the flags used to control
lower_variable_index_to_cond_assign in brw_shader.cpp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 17:41:25 -07:00
Matt Turner
509b2a6523 i965/fs: Reset reg_from when we can't coalesce.
Not setting this would prevented coalescing after a failed attempt if
the sources for both MOVs were the same.

total instructions in shared programs: 1654531 -> 1650224 (-0.26%)
instructions in affected programs:     423167 -> 418860 (-1.02%)
GAINED:                                2
LOST:                                  0

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-11 15:27:46 -07:00
Eric Anholt
7e034a8d77 i965: Fill in a bunch of gen7/hsw data cache-related disasm.
This gets us disasm of atomic ops.

v2: Fix fallthrough on pre-gen7.  (bug caught by Ilia Mirkin).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-11 13:38:53 -07:00
Eric Anholt
99442bc7b2 i965: Stop setting up a 1:1 "attrib" member in our vertex inputs.
It's just the array index, so we can just go look at the array and see
which element we are.

No significant performance difference (n=140)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:38:53 -07:00
Eric Anholt
9a5d19d680 i965: Skip a bunch of IB BO refcount twiddling.
Improves cairo performance on glamor by 1.64828% +/- 1.04742% (n=65).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:38:52 -07:00
Eric Anholt
3f9440cfbb i965/gen7: Skip repeated NULL depth/stencil state emits.
Improves cairo performance on glamor by 2.87752% +/- 0.966977 (n=57).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:38:52 -07:00
Chris Forbes
fe4f373eb4 docs: Fix ubo indexing description
Ian points out that this being unrestricted was an oversight in the
spec, and is corrected in GLSL4.40.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-12 08:31:05 +12:00
Brian Paul
e5f306e3ff draw: remove unused 'start' variable in draw_stats_clipper_primitives()
It was computed, but never actually used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 13:54:17 -06:00
Kenneth Graunke
ae2a03b573 glsl: Try vectorizing when seeing a repeated assignment to a channel.
When considering assignment expressions like:

    v.x += u.x;
    v.x += u.x;

the vectorizer would incorrectly keep going, attempting to find more
instructions to vectorize.  It would overwrite the saved assignment
to point at the second one, and increment channels a second time,
resulting in try_vectorize thinking the expression was a vec2 instead of
a float.

Instead, if we see a repeated assignment to a channel, just try to
vectorize everything we've found so far.  This clears the saved state
so it will start over.

Fixes Piglit's repeated-channel-assignments.vert.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-11 12:39:37 -07:00
Ian Romanick
625cf8c874 glsl: Propagate explicit binding information from the AST all the way to the linker
Information about the binding was not being properly communicated from
the front-end compiler to the linker.  As a result, the linker never
knew that any UBOs had explicit bindings!

Fixes the piglit test arb_shading_language_420pack-binding-layout.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: github@socker.lepus.uberspace.de [v0]
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
25a6656875 linker: Set binding for all elements of UBO array
Previously, a UBO like

    layout(binding=2) uniform U {
        ...
    } my_constants[4];

wouldn't get any bindings set.  The code would try to set the binding of
U, but that would fail.  It should instead set the bindings for U[0],
U[1], ...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
cc42717b50 linker: Set block bindings based on UniformBlocks rather than UniformStorage
For blocks, gl_shader_program::UniformStorage isn't very useful.  The
names stored there are the names of the elements of the block, so
finding blocks with an instance name is hard.  There is also only one
entry in ::UniformStorage for each element of a block array, and that is
a deal breaker.

Using ::UniformBlocks is what _mesa_GetUniformBlockIndex does.  I
contemplated sharing code between set_block_binding and
_mesa_GetUniformBlockIndex, but building the stand-alone compiler and
the unit tests make this hard.  I plan to return to this effort shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
157391a41b linker: Clean up "unused parameter" warnings
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'type' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'type' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
943b2d52bf linker: Fold set_uniform_binding into call site
In the next patch, we'll see that using
gl_shader_program::UniformStorage is not correct for uniform blocks.
That means we can't use ::UniformStorage to select between the sampler
path and the block path.  Instead we want to just use the type of the
variable.  That's never passed to set_uniform_binding, and it's easier
to just remove the function (especially for later patches in the series)
than to add another parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
881c52f13f linker: Various trivial clean-ups in set_sampler_binding
- Remove the spurious block left from the previous commit and re-indent.

- Constify elements.

- Make the spec reference in the code look like other spec references in
  the compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Ian Romanick
6e2f63b69e linker: Split set_uniform_binding into separate functions for blocks and samplers
The two code paths are quite different, and there are some problems in
the handling of uniform blocks.  Future changes will cause these paths
to diverge further.  Ultimately, selecting between the two functions
will happen at the set_uniform_binding call site, and
set_uniform_binding will be deleted.

NOTE: This patch just moves code around.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
2014-04-11 12:26:01 -07:00
Heinrich Janzing
c8e7568f97 softpipe: fix shadow sampling
And remove nonsensical approximation of linear interpolation behavior
for shadow samplers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
2014-04-11 11:47:32 -06:00
Brian Paul
86b8843e9c softpipe: add PIPE_CAP_MIN/MAX_TEXTURE_GATHER_OFFSET query cases
To silence compiler warnings.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-11 11:47:31 -06:00
Brian Paul
f61edd509b mesa: use _mesa_get_srgb_format_linear() in sRGB texstore functions
Instead of switch statements.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 11:47:31 -06:00
Brian Paul
c5631b341e swrast: use macros to initialize texfetch_funcs[] table
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 11:47:31 -06:00
Brian Paul
4da1efb370 swrast: fix more fetch_texel function names
These were missed/typo'd in the previous patch series:
s/R8G8B8A/R8G8B8A8/
s/rgba_16/RGBA_UNORM16/
s/rgba_uint/RGBA_UINT/
s/rgba_int/RGBA_SINT/

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-11 11:47:31 -06:00
José Fonseca
9d36a8d4d2 egl-static: Fix missing radeon_surface.h includes.
Fixes

  fatal error: radeon_surface.h: No such file or directory

when libdrm is not present, or non-Linux OSes.

Trivial.
2014-04-11 16:46:02 +01:00
Knut Andre Tidemann
5ac3435a47 gallium/radeon: fix missing winsys include in pipe-loader.
The commit 3b0b44f7de introduced a build
error:

error: dereferencing pointer to incomplete type

This patch fixes this issue in all the affected files.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-11 19:22:17 -04:00
Christian König
68bba1801e st/omx/enc: separate input buffer private and task structure
Keep tasks as linked list, this way we can associate
more than one encoding task with each buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
7806dbeb70 radeon/vce: implement B-frame support
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
a56fa0e83b radeon/vce: add proper CPB backtrack
Remember what frames we encoded at which position.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
d7d41ce133 vl: add interface for H264 B-frame encoding
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:03 +02:00
Christian König
ee4439c562 radeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES
Doesn't seems to be needed any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-11 11:35:02 +02:00
Chris Forbes
ce57c8e925 docs/relnotes: Fix consistency, add i965 to ARB_buffer_storage.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-11 21:20:13 +12:00
Kenneth Graunke
227049098b i965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.
The _Xmin/_Xmax/_Ymin/_Ymax values need to be guarded by _NEW_SCISSOR.

Fixes Piglit's scissor-many, and rendering in GNOME Shell.
Hopefully fixes similar issues with Unity and ChromeOS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75879
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: James Ausmus <james.ausmus@intel.com>
Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
2014-04-10 23:38:10 -07:00
Ilia Mirkin
31640f4c38 mesa/st: set min/max texture gather offset to driver-reported value
It was always getting set to -8/7 unconditionally.  Use the
driver-reported value instead.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-10 20:42:48 -04:00
Ilia Mirkin
c2f9ad5289 gallium: add a way to query min/max texture gather offsets
Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For
nvc0, the offset can be -32/31.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-10 20:42:36 -04:00
Marek Olšák
8291f6d5c5 configure.ac: require libdrm_radeon 2.4.53
We need latest radeon_drm.h.
2014-04-10 21:24:50 +02:00
Marek Olšák
3b0b44f7de winsys/radeon: fix a race condition in initialization of radeon_winsys::screen
Create the screen in the winsys while the mutex is locked.
This also results in a nice code cleanup!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
ac330d4130 winsys/radeon: fix a race condition between winsys_create and winsys_destroy
This also hides the reference count from drivers.

v2: update the reference count while the mutex is locked in winsys_create

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
7c57b01564 winsys/radeon: fix a race condition between 2 calls to radeon_winsys_create
This fixes random crashes of: piglit/glx-multithread-shader-compile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
b5ebfc33b8 winsys/radeon: remove unused radeon_info variables, move backend_map
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
9b8449ae90 winsys/radeon: unify radeon_bo::flink and radeon_bo::name
Both contained the GEM flink name.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
34564c8753 winsys/radeon: remove definitions already present in radeon_drm.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
e3e05c6db9 winsys/radeon: handle squared micro tiling from GEM_GET_TILING
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 20:50:17 +02:00
Marek Olšák
38858207a1 gallium/u_gen_mipmap: rewrite using pipe->blit (v2)
This replaces u_gen_mipmap with an extremely simple implementation based
on pipe->blit. st/mesa is also cleaned up.

Pros:
- less code
- correct mipmap generation for NPOT 3D textures (u_blitter uses a better
  formula)
- queries are not affected by mipmap generation if drivers disable them

v2: add "first_layer", "last_layer" parameters, drop "face"
v2.1: add format
v2.2: document the format parameter
2014-04-10 20:50:16 +02:00
Marek Olšák
26c41398cc st/mesa: properly implement MapTextureImage with multiple mapped slices (v2)
This is needed by _mesa_generate_mipmap.

This adds an array of pipe_transfers to st_texture_image. Each transfer is
for mapping a single layer.

v2: allocate the array of transfers on demand
2014-04-10 20:50:16 +02:00
Brian Paul
5206d4bc09 mesa: remove the MALLOC, CALLOC and FREE macros
No longer used anywhere.  These also caused trouble in the Gallium
state tracker code where we include both core Mesa and Gallium util
headers (and the macros were defined differently in each world.)
Removing these macros should help avoid macro mix-ups in the future.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:12 -06:00
Brian Paul
7e55050301 xlib: s/FREE/free/
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:11 -06:00
Brian Paul
3b323c4d40 mesa: s/FREE/free/ in vdpau code
Reviewed-by: Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-10 07:53:11 -06:00
Brian Paul
00f31bdd32 mesa: s/FREE/free/ in _mesa_free_errors_data()
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:10 -06:00
Brian Paul
7fbb8ba499 mesa: use malloc/free instead of MALLOC/FREE in attrib stack code
We moved away from MALLOC/FREE in the rest of core Mesa a while ago.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-10 07:53:05 -06:00
Brian Paul
f9985db0bc st/mesa: fix sampler_view REALLOC/FREE macro mix-up
We were using REALLOC() from u_memory.h but FREE() from imports.h.
This mismatch caused us to trash the heap on Windows after we
deleted a texture object.

This fixes a regression from commit 6c59be7776.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-10 07:53:05 -06:00
Chris Forbes
87502bbcd7 docs: Expand ARB_gpu_shader5 to describe status of individual features
This extension is a huge grab-bag of "stuff that's in DX11". Break it
apart to make it clear what still needs to be done.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-10 18:52:03 +12:00
Chris Forbes
0d653b948f docs: Mark off ARB_texture_view and add to release notes for 10.2.
V4: Don't claim Gen8 yet.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:42 +12:00
Chris Forbes
2a2f8cd9d2 i965: Enable ARB_texture_view on Gen7
V4: Don't enable this for Gen8 yet -- that still needs wired up.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:42 +12:00
Chris Forbes
ea477817d7 i965: Account for view parameters in blit CTSI path
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
01d6a2ad16 i965: Account for MinLayer/MinLevel in blorp CTSI path
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
058f353a15 i965: Account for view parameters in fast depth clears
V2: - No need for layer_multiplier; multisampled depth surfaces are IMS.
    - Remove unused num_layers.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
540d53d9b0 i965/blorp: Account for nonzero MinLayer in layered clears.
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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
d581247569 i965/blorp: Use irb->layer_count in clear
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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
98328e4c19 i965: Add layer_count to intel_renderbuffer
This is the effective layer count, for clears etc. This differs from the
depth of the miptree level when views are involved.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
0a08147fcb i965: Pull out layer_multiplier in intel_update_renderbuffer_wrapper
We're about to need this in another place.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
a76cde35d8 i965: Add layered parameter to intel_update_renderbuffer_wrapper
We're about to need this so we can determine the layer count of the
wrapper.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
85dda825fe i965: Adjust renderbuffer wrapper to account for MinLevel/MinLayer
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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
24f490fb37 i965: Enable texture upload fast path with MinLevel
We'll still avoid MinLayer here since the fast path doesn't understand
arrays at all, but it's straightforward to do levels.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
5de52541e5 i965: Account for MinLevel in texture upload fast path
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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
ba3499ba01 i965: Adjust map/unmap code for MinLevel/MinLayer
This allows core mesa's TexSubImage paths etc to work correctly
with views which have nonzero MinLevel or MinLayer.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
ca1d1b2fc1 i965: Don't try to use fast upload path for nontrivial views
This will eventually be relaxed, but we'll get the fallback path
working first.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
c9c08867ed i965: Adjust surface_state emission to account for view parameters
V4: Comment style, remove magic shift.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
771c2ae0af i965: Add _Format to intel_texobj.
This is the actual mesa_format to use. In non-view cases this is always
the same as the mt's format.

V4: Comment style

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
b7f011fdc9 i965: Add driver hook for TextureView
We need to wire the original texture's mt into the view. All the hard
work of setting up an appropriate tree of gl_texture_image structures
has already been done by core mesa.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
93fa16bdd1 i965: Ensure that texture validation is skipped for immutable textures.
If we were to relayout the miptree, we'd break any views that are
sharing it.

(Simplified based on suggestions from Eric)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:41 +12:00
Chris Forbes
a98b675945 i965: refactor format selection for unsupported ETC* formats
We will need to call this to munge view formats.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
14c116433d i965: refactor format munging for separate stencil
We will need this for munging the view's format.

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
215c9432b9 i965: Include #slices in miptree debug
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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
c1b017472b mesa: Adjust _MaxLevel computation to account for views
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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
61e264f4fc mesa: Prefer non-swizzled formats for most sized internalformats
These formats can be cast to others (with different component types or
sizes) via ARB_texture_view or ARB_shader_image_load_store. We want
them to be laid out consistently so that we can just reinterpret the
memory with a different format.

In V1, this was done conditionally on a 'prefer_no_swizzle' flag which
was set in TexStorage/TextureView paths, but we need the same behavior
for ARB_shader_image_load_store (which also works with images created
via TexImage, so we don't want it to be conditional.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
58790043bb i965: Render R8G8B8X8 as R8G8B8A8
The sampler can handle R8G8B8X8 (and substitute 1.0 for the fourth
component) but we can't use it as a render target.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
50eed4eed5 i965: Pretend we don't support BRW_SURFACEFORMAT_R16G16B16_FLOAT for textures.
None of the other 3-component 16bpc formats are directly supported, so
they get promoted to XRGB equivalents. *Not* promoting RGB16F the same
way makes texture views much more fiddly -- we don't want to have to do
crazy copying behind the scenes.

(with my other master + my experimental ARB_texture_view support) fixes
the piglit test: `spec/ARB_texture_view/view compare 48bit formats`

No regressions in gpu.tests on Haswell.

V4: Don't alter the formats table -- just don't match it to a mesa_format. [Kenneth]

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>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
66b0554fa6 i965: Enable R10G10B10A2_UNORM format
This is supported by all generations, and is required for memory layout
consistency for texture_view.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
932a1eeac8 i965: Enable R8G8B8A8_UNORM_SRGB format
Now this is the preferred format for GL_SRGB8_ALPHA8.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
6ef7205613 swrast: Add support for fetching from MESA_FORMAT_R10G10B10A2_UNORM
V4: Fix rebase conflicts with Brian's renaming of the texfetch
functions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Chris Forbes
a421be1dcb mesa: fix packing of float texels to GL_SHORT/GL_BYTE
Previously, we would unpack the texels to floats using *_TO_FLOAT_TEX,
and then pack them into the desired format using FLOAT_TO_*. Unfortunately,
this isn't quite the inverse operation, and so some texel values would
end up off-by-one.

This fixes the GL_RGB8_SNORM and GL_RGB16_SNORM subcases in piglit's
arb_texture_view-format-consistency-get test on i965. The similar 1-, 2-
and 4-component cases already worked because they took the memcpy path
rather than repacking.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-04-10 18:27:40 +12:00
Michel Dänzer
ee2bcf38a4 r600g: Don't leak bytecode on shader compile failure
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74868

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-10 14:00:43 +09:00
Emil Velikov
55f9bbd46c build: force .so extension for the gallium dri modules
While linux uses .so as a default extension for shared libraries that is
not the case for other platforms. The loader in libGL (and others) assumes
that the dri module will always have a .so extension, thus it will fail
to load on the affected platforms.

Spotted-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-09 22:12:36 +01:00
Jon TURNEY
92d0786f88 Partially revert bba9c28 "configure: use LIB_EXT rather than hardcoded .so"
Filenames passed to dlopen() don't need to use the platform's default extension
for shared libraries.

Using the '.so' extension when dlopen()ing DRI drivers is hardcoded into mesa
and the X server, so it should be hardcoded here in the Makefile as well.

A similar fix is probably also needed for gallium DRI drivers.

(Consider that if we were starting from scratch, perhaps we would use a custom
extension like .dri instead)

Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-09 22:12:36 +01:00
Emil Velikov
56f531657c Partially revert "st/xa: Fix advertized version number and try to avoid future discrepancies"
This reverts commit 61bedc3d6b.

As the header is the one defining the API/ABI and is distributed
during installation, we should be using it rather than re-defining
the XA version in configure.ac.

Bump the version in the header to 2.2.0, to reflect what was the
original intent of commit 42158926c6.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-09 22:12:35 +01:00
Emil Velikov
f9832f960f glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path
With commit 1f1928db001(glx: Drop _Xglobal_lock while we create and
initialize glx display) we've split the big _Xglobal_lock handling in
a more fine grained manner.

Unfortunatelly we forgot to drop the unlock_mutex on the error paths,
leading to undefined behaviour as the mutex is already unlocked.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: "9.2 10.0 10.1"  <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-09 22:12:35 +01:00
Rob Clark
6afd7be132 freedreno/a3xx: assert() -> debug_assert()
We hit this assert with some piglit tests.  Which appears to be a bug
outside of freedreno.  Previously we were relying on assert() being
redefined to debug_assert() so that we didn't crash in release builds.
Somehow that stopped working.  So just use debug_assert() directly.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09 16:37:04 -04:00
Brian Paul
e853ade544 svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()
Fixes a crash in svga_context_flush_buffers() if we use the 'draw' module
for AA lines (when the device doesn't support that feature).  We need to
initialize this list before we setup the swtnl pieces.

Found/fixed by Charmaine Lee.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-09 12:02:03 -06:00
Kenneth Graunke
26ae030fcc i965: Stop advertising GL_MESA_ycbcr_texture.
The "new" fragment shader backend has never supported the necessary
color conversion code for this to work.  We began using the new backend
in Mesa 7.10 for GLSL (commit a81d423d93, October 2010),
and for ARB_fragment_program in Mesa 9.1 (commit 97615b2d8c,
August 2012).

I haven't heard any complaints, so I don't think anyone will miss this
feature.  I believe mplayer used it at one point, but these days
defaults to other paths anyway.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-09 08:28:25 -07:00
Rob Clark
4a92c12232 freedreno/a3xx/compiler: add CEIL
fixes piglit glsl-fs-ceil

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09 10:59:18 -04:00
Rob Clark
9604e31dc9 freedreno/a3xx/compiler: fix neg mov's
create_mov() was fixed up to handle neg/abs properly for interal mov's,
using absneg.f, but forgot to fix it for TGSI MOV's.  The problem with
using add.f to handle negated mov's is that we can only take a single
const reg src.  So:

  MOV TEMP[n], -CONST[m]

would turn into:

  add.f Rdst, (neg)CONST[m], 0.0

which would not work.  Anyways, just remove the extra code and always
use create_mov() which DTRT.

This fixes piglit vs-op-neg-int test.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-09 10:59:18 -04:00
Marek Olšák
4d641803e8 radeonsi: allow fast color clear and Hyper-Z with 1D-tiled surfaces on CIK
This depends on my kernel fix. Hyper-Z is still disabled by default.
2014-04-09 01:45:16 +02:00
Marek Olšák
fb5cf3490e r600g,radeonsi: add a bunch of useful queries for the HUD 2014-04-09 01:45:16 +02:00
Marek Olšák
4a5519f1e0 r600g,radeonsi: set correct initial domain for shared resources 2014-04-09 01:45:16 +02:00
Marek Olšák
5f7faff61b gallium/radeon: fix warnings 2014-04-09 01:45:16 +02:00
Iago Toral Quiroga
1a92637c68 tnl: Merge _tnl_vbo_draw_prims() into _tnl_draw_prims().
This should help prevent situations where we render without proper index
bounds. For example: https://bugs.freedesktop.org/show_bug.cgi?id=59455

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-08 15:10:10 -07:00
Topi Pohjolainen
2ffb50d77b i965: Remove unused sampler key fields
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 13:34:59 -07:00
Brian Paul
6f059725fa mesa: move declaration before code in etc2_unpack_rgb8()
To fix MSVC build since cb4ad13685.
2014-04-08 14:17:40 -06:00
Kenneth Graunke
ec1baea95a i965: Delete "fast color clear unsupported" performance warning.
Applications frequently clear to colors other than 0.0 or 1.0, which
prevents us from doing fast color clears.  In that case, we issue this
performance warning on basically every glClear call, resulting in so
much spam that it's nearly impossible to see any other messages.

Plus, I don't think it's useful.  We aren't suggesting a better way to
do what the application developers want---we're just telling them it
would be faster to do something they don't want.

Driver developers have no control over the clear color, so this message
is totally useless to them.

A better alternative to get this sort of information is to use
INTEL_DEBUG=blorp, which tells you whether color clears were fast,
simd16 repdata, or slow.

v2: Rebase on has_color_component changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-08 13:09:46 -07:00
Rob Clark
ee839cc6ef freedreno/a3xx: deal with optimized tex instructions
Keep track of whether we actually have any sam instructions in the
resulting shader, rather than using TGSI SAMP declarations.  If the sam
instruction is optimized out, because the result is not used, we don't
want to emit texture state, etc.  In fact emitting sampler state and/or
setting PIXLODENABLE bit when there are no texture fetches seems to
cause lockup.

In theory this should never happen for a "normal" shader, unless the
state tracker is wonky.  But it is a very real possibility for binning
pass shaders.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-08 16:06:49 -04:00
Courtney Goeltzenleuchter
cb4ad13685 mesa: add bounds checking to eliminate buffer overrun
Decompressing ETC2 textures was causing intermitent segfault
by copying resulting 4x4 texel block to the destination texture
regardless of the size of the destination texture. Issue found
via application crash in GLBenchmark 3.0's Manhattan test.

v2: add more detail comment. Compute limit outside inner loops.
v3: add bugzilla reference
v4: Correct cc syntax in commit log
v5: really grab the right patch

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74988
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1, suggested v2-3]
2014-04-08 12:55:25 -07:00
Leo Liu
a22d944fdb st/omx/enc: cleanup omx/vid_enc.c
cleanup by moving each step into a separate function

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-08 17:51:19 +02:00
Christian König
5f374826f8 st/omx/enc: allocate input buffer private on demand
v2: move allocation to a function as first step
    to clean vid_enc_EncodeFrame

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-04-08 17:51:15 +02:00
Brian Paul
9bb2ec6fd1 svga: replace sampler assertion with conditional
For TEX instructions, the set of samplers and sampler views should
be consistent.  The XA state tracker sometimes passes an inconsistent
set of samplers and sampler views.  Rather than assert and die, issue
a warning.

v2: add debugging code to detect inconsistent state.
v3: also check for null sampler in svga_state_tss.c

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-08 08:45:18 -06:00
Chia-I Wu
4ddf51db6a i965/vec4: fix record clearing in copy propagation
Given

  mov vgrf7, vgrf9.xyxz
  add vgrf9.xyz, vgrf4.xyzw, vgrf5.xyzw
  add vgrf10.x, vgrf6.xyzw, vgrf7.wwww

the last instruction would be wrongly changed to

  add vgrf10.x, vgrf6.xyzw, vgrf9.zzzz

during copy propagation.

The issue is that when deciding if a record should be cleared, the old code
checked for

  inst->dst.writemask & (1 << ch)

instead of

  inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch))

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76749
Signed-off-by: Chia-I Wu <olv@lunarg.com>
Cc: Jordan Justen <jljusten@gmail.com>
Cc: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romainck <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.1" <mesa-stable@freedesktop.org>
2014-04-08 21:04:22 +08:00
Eric Anholt
57d6e7b7ee i965/vec4: Add a test for copy propagation behavior.
I thought I was seeing a bug in the code while reviewing, but it's not
there.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-08 00:59:48 -07:00
Eric Anholt
6230b646a5 i965/fs: Track whether we're doing dual source in a more obvious way.
I'm going to be turning dual_src_output into an array in a moment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
14b85e3a47 i965/fs: Add a couple more global special regs to special[]
Nothing bad came of this because they weren't used after visitor running,
but leaving them in a bad state seems like a recipe for pain later.

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
4303d26f93 i965/fs: Handle arrays of special regs more cleanly.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
72b845e640 i965/fs: Fix dump_instructions() on uniforms.
All of a vec4 uniform was being printed as "u0"

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
caa2605db5 i965/fs: Fix vgrf0 live interval when no interpolation was done.
When you've got a simple solid-color shader that doesn't generate
pixel_x/y interpolation, we were deciding that the first vgrf was both the
undefined pixel_x and pixel_y, and extending its live interval to avoid
the stride problem.  That tricked other optimization that tries to see if
a particular instruction is the last use of a variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
cf40ebacb1 i965: Drop pointless check for variable declarations in splitting.
We're walking the whole instruction stream, so we know the declaration
will be found.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
66b15ad9db i965: Remove stale comment.
We stopped doing variable index lowering for uniforms in
a64c1eb9b1, 5 months after the comment was
added.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
8c2bfbc6b9 glsl: Move tree grafting's debug output to stderr.
The rest of our compiler dumps are there, now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:48 -07:00
Eric Anholt
e9822f77a9 glsl: Skip making a temporary for assignments when we don't need one.
While we wish our optimization passes could identify all the cases where
we can coalesce our variables, we miss out on a lot of opportunities.

total instructions in shared programs: 1673849 -> 1673166 (-0.04%)
instructions in affected programs:     299521 -> 298838 (-0.23%)
GAINED:                                7
LOST:                                  0

Note that many programs are "hurt".  The notable ones are where we produce
unrolling in cases we didn't before (presumably just because of the lower
instruction count).  But there are also some cases where pushing things
right into the variables prevents copy propagation and tree grafting,
since we don't split our variable usage webs apart.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:59:47 -07:00
Iago Toral Quiroga
dff3439fef i915: Fix build error.
is_power_of_two() is now provided by mesa so its definition must be removed
from the i915 driver code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-08 00:29:59 -07:00
Kenneth Graunke
73f80c20f6 glsl: Pass ctx->Const.NativeIntegers to do_algebraic.
The next patch will introduce an optimization that only works when
integers are not represented as floating point values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:06 -07:00
Kenneth Graunke
169c645f12 glsl: Pass ctx->Const.NativeIntegers to do_common_optimization().
The next few patches will introduce an optimization that only works when
integers are not represented as floating point values.

v2: Re-word-wrap a line, as requested by Ian Romanick.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:03 -07:00
Kenneth Graunke
40d9337406 glsl: Validate that base types match for a number of binops.
The IR is not supposed to support implicit type conversions; we just
failed to validate it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:02:01 -07:00
Kenneth Graunke
e14b93371c glsl: Fix lack of i2u in lower_ubo_reference.
ir_binop_ubo_load takes unsigned integer operands.  However, the array
index used to compute these offsets may be a signed integer.  (For
example, see Piglit's spec/glsl-1.40/uniform_buffer/fs-bvec-array).

For some reason, we were missing an ir_binop_i2u cast, and ir_validator
was failing to catch that.

Without this change, ir_builder's type inference code broke for me when
writing a new optimization pass.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:58 -07:00
Kenneth Graunke
4311f9878d i965/fs: Skip emitting MACH/MOV for small integers.
The vector backend already implemented this optimization, but
surprisingly, we never bothered to implement it in the scalar backend.

In addition to saving two instructions, this eliminates a use of the
accumulator as an explicit source, which is unsupported in SIMD16 mode
on Gen7+, which could help us gain SIMD16 programs.

Cuts 19.23% of the instructions in dolphin/efb2ram.shader_test.

v2: Rebase on is_16bit_integer_constant -> is_uint16_constant rename.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:55 -07:00
Kenneth Graunke
7540be22d1 glsl: Make is_16bit_constant from i965 an ir_constant method.
The i965 MUL instruction doesn't natively support 32-bit by 32-bit
integer multiplication; additional instructions (MACH/MOV) are required.
However, we can avoid those if we know one of the operands can be
represented in 16 bits or less.  The vector backend's is_16bit_constant
static helper function checks for this.

We want to be able to use it in the scalar backend as well, which means
moving the function to a more generally-usable location.  Since it isn't
i965 specific, I decided to make it an ir_constant method, in case it
ends up being useful to other people as well.

v2: Rename from is_16bit_integer_constant to is_uint16_constant, as
    suggested by Ilia Mirkin.  Update comments to clarify that it does
    apply to both int and uint types, as long as the value is
    non-negative and fits in 16-bits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:53 -07:00
Kenneth Graunke
bd69f65f90 mesa: Move is_power_of_two() function from brw_context.h to macros.h.
This makes the function available from core Mesa code, including the
GLSL compiler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:51 -07:00
Kenneth Graunke
6bda3a5267 i965: Fix "SIMD16 unsupported" messages via KHR_debug.
Performance warnings are logged via KHR_debug in addition to when the
INTEL_DEBUG=perf environment variable is set.  Without this, messages in
debug contexts would have "(null)" for the reason.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-08 00:01:34 -07:00
Kenneth Graunke
ee12a03805 i965: Fix missing dirty bits in the gen8_sbe_state atom.
These are clearly needed---the comments in the function are even present
for each one of them.   I originally had two separate state atoms for
3DSTATE_SBE and 3DSTATE_SBE_SWIZ.  When I combined the functions, I must
have forgotten to add the atoms for 3DSTATE_SBE_SWIZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:37:18 -07:00
Kenneth Graunke
47682f2ca1 i965: Drop BRW_NEW_RASTERIZER_DISCARD flag from Broadwell SOL atom.
Nothing actually uses this---we handle rasterizer discard in the
clipper in order for statistics counters to work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:37:16 -07:00
Kenneth Graunke
f68353c57c i965: Use the correct program when uploading Broadwell SOL state.
This is the equivalent of commit 43e77215b1.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 23:36:19 -07:00
Thomas Hellstrom
47f60cbb71 st/xa: Make sure unused samplers are set to NULL
renderer_copy_prepare was setting the first sampler but never telling
the cso code how many samplers were actually used. Fix this.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-07 22:34:10 -07:00
Thomas Hellstrom
e5d2c5b899 st/xa: Bind destination before setting new state
Binding a new destination may cause the svga driver to emit draw calls
while propagating the surface. Make sure this doesn't happen in the middle
of sampler state setup where state may be incosistent.

In practice, surface propagation should never happen here and even if it did,
it wouldn't be a valid reason for the svga driver to emit partially set up
state, but to avoid future uncertainties, make sure this doesn't happen
anyway.

Found while auditing the state tracker for inconsistent sampler state /
sampler view setup.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-04-07 22:34:10 -07:00
Eric Anholt
34f15903d6 glapi: Fix libglapi build.
This line appears to have been accidentally dropped from the last commit,
and the resulting libglapi was missing symbols.
2014-04-07 14:34:49 -07:00
Matt Turner
144bbb7b78 glapi/build: Add headers to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:45:26 -07:00
Matt Turner
fbca1ab780 glapi/gen: Ship more Python files
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:45:19 -07:00
Matt Turner
b0f37a6bd2 glapi/gen: Ship XML and Python files
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:43:21 -07:00
Matt Turner
f76ac9c9a6 glapi/gen: Add missing XML files to API_XML
Also (re)move XML files from COMMON to API_XML.

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:43:21 -07:00
Matt Turner
cdc3a6bb21 src/build: Add getopt to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:02 -07:00
Matt Turner
a97611313d gbm/build: Add headers to distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:01 -07:00
Matt Turner
3f64c3d591 egl/build: Sort egl sources alphabetically.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:41:00 -07:00
Matt Turner
5ae2f28ca7 egl/build: Remove unused -DXF86VIDMODE.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:58 -07:00
Matt Turner
5074117928 egl/build: Include headers and XML in distribution.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:57 -07:00
Matt Turner
1d4007fbd9 egl/build: Drop two unnecessary Makefiles.
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-07 09:40:31 -07:00
Matt Turner
5c770ba919 i965/fs: Remove left-over 'removed' variable.
I think this was used for coalescing out partly dead large virtual
registers, but the patch that enabled that caused regressions and didn't
make it upstream.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 10:29:43 -07:00
Matt Turner
99437b730f i965/fs: Check for interference after finding all channels.
It's more likely that we won't find writes to all channels than one will
interfere, and calculating interference is more expensive. This change
will also help prepare for coalescing load_payload instructions'
operands.

Also update the live intervals for all channels, and not just the last
that we saw.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-07 10:29:22 -07:00
Jordan Justen
70285f607c i965: initialize more device info fields for Cherryview
The intent in 9b6b084eb7 was
for urb .size and .min_vs_entries fields to use the values
from the GEN8_FEATURES macro.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-04-07 09:52:32 -07:00
Brian Paul
d3ef6f5427 swrast: reindent s_texfetch_temp.h, remove trailing whitespace
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul
a19d60faef swrast: remove out of date comments in s_texfetch_tmp.h
The comments were out of date and redundant (the functions are
pretty much self-explanatory).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul
56db16fb5b swrast: rename texture fetch functions (pt. 7)
sed commands:
s/f_z24_s8/S8_UINT_Z24_UNORM/g
s/f_s8_z24/Z24_UNORM_S8_UINT/g
s/f_z16/Z_UNORM16/g
s/f_z32/Z_UNORM32/g
s/z32f_x24s8/Z32_FLOAT_S8X24_UINT/g
s/f_ycbcr_rev/YCBCR_REV/g
s/f_ycbcr/YCBCR/g
s/dudv8/DUDV8/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:27 -06:00
Brian Paul
d41fe0aec2 swrast: rename texture fetch functions (pt. 6)
sed commands:
s/rgb9_e5/R9G9B9E5_FLOAT/g
s/r11_g11_b10f/R11G11B10_FLOAT/g
s/f_alpha_f16/A_FLOAT16/g
s/f_alpha_f32/A_FLOAT32/g
s/f_luminance_f16/L_FLOAT16/g
s/f_luminance_f32/L_FLOAT32/g
s/f_luminance_alpha_f16/LA_FLOAT16/g
s/f_luminance_alpha_f32/LA_FLOAT32/g
s/f_intensity_f16/I_FLOAT16/g
s/f_intensity_f32/I_FLOAT32/g
s/f_r_f16/R_FLOAT16/g
s/f_r_f32/R_FLOAT32/g
s/f_rg_f16/RG_FLOAT16/g
s/f_rg_f32/RG_FLOAT32/g
s/f_rgb_f16/RGB_FLOAT16/g
s/f_rgb_f32/RGB_FLOAT32/g
s/f_rgba_f16/RGBA_FLOAT16/g
s/f_rgba_f32/RGBA_FLOAT32/g
s/xbgr16161616_float/RGBX_FLOAT16/g
s/xbgr32323232_float/RGBX_FLOAT32/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
9eb45114fd swrast: rename texture fetch functions (pt. 5)
sed commands:
s/srgba8/A8B8G8R8_SRGB/g
s/sargb8/B8G8R8A8_SRGB/g
s/sabgr8/R8G8B8A8_SRGB/g
s/sxbgr8/R8G8B8X8_SRGB/g
s/sla8/L8A8_SRGB/g
s/sl8/L_SRGB8/g
s/srgb8/BGR_SRGB8/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
faa8a8e8b2 swrast: rename texture fetch functions (pt. 4)
sed commands:
s/signed_rg1616/R16G16_SNORM/g
s/signed_rg88_rev/R8G8_SNORM/g
s/signed_al88/L8A8_SNORM/g
s/signed_a8/A_SNORM8/g
s/signed_a16/A_SNORM16/g
s/signed_l8/L_SNORM8/g
s/signed_l16/L_SNORM16/g
s/signed_i8/I_SNORM8/g
s/signed_i16/I_SNORM16/g
s/signed_r8/R_SNORM8/g
s/signed_r16/R_SNORM16/g
s/signed_al1616/LA_SNORM16/g
s/signed_rgb_16/RGB_SNORM16/g
s/signed_rgba_16/RGBA_SNORM16/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
a401362019 swrast: rename texture fetch functions (pt. 3)
Rename functions to match format names.

sed commands:
s/f_rg1616_rev/G16R16_UNORM/g
s/f_rg1616/R16G16_UNORM/g
s/f_argb2101010/B10G10R10A2_UNORM/g
s/f_a8/A_UNORM8/g
s/f_a16/A_UNORM16/g
s/f_i8/I_UNORM8/g
s/f_i16/I_UNORM16/g
s/f_r8/R_UNORM8/g
s/f_r16/R_UNORM16/g
s/f_rgb888/BGR_UNORM8/g
s/f_bgr888/RGB_UNORM8/g
s/f_l8/L_UNORM8/g
s/f_l16/L_UNORM16/g
s/xbgr16161616_unorm/RGBX_UNORM16/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:26 -06:00
Brian Paul
e4ebb24b35 swrast: rename texture fetch functions (pt. 2)
Rename functions to match format names.

sed commands:
s/f_al1616_rev/A16L16_UNORM/g
s/f_al1616/L16A16_UNORM/g
s/f_rgb565_rev/R5G6B5_UNORM/g
s/f_rgb565/B5G6R5_UNORM/g
s/f_argb4444_rev/A4R4G4B4_UNORM/g
s/f_argb4444/B4G4R4A4_UNORM/g
s/f_rgba5551/A1B5G5R5_UNORM/g
s/f_argb1555_rev/A1R5G5B5_UNORM/g
s/f_al88_rev/A8L8_UNORM/g
s/f_al88/L8A8_UNORM/g
s/f_gr88/R8G8_UNORM/g
s/f_rg88/G8R8_UNORM/g
s/f_al44/L4A4_UNORM/g
s/f_rgb332/B2G3R3_UNORM/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:25 -06:00
Brian Paul
fde3258389 swrast: rename texture fetch functions (pt. 1)
Rename functions to match format names.

sed commands:
s/signed_rgba8888_rev/R8G8B8A8_SNORM/g
s/signed_rgba8888/A8B8G8R8_SNORM/g
s/f_rgba8888_rev/R8G8B8A_UNORM/g
s/f_rgba8888/A8B8G8R8_UNORM/g
s/f_rgbx8888_rev/R8G8B8X8_UNORM/g
s/f_rgbx8888/X8B8G8R8_UNORM/g
s/f_argb8888_rev/A8R8G8B8_UNORM/g
s/f_argb8888/B8G8R8A8_UNORM/g
s/f_xrgb8888_rev/X8R8G8B8_UNORM/g
s/f_xrgb8888/B8G8R8X8_UNORM/g
s/signed_rgbx8888/X8B8G8R8_SNORM/g

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:25 -06:00
Brian Paul
e0fafd1913 mesa: rename stencil/Z functions in format_unpack.c
So the function names match the format names.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-07 09:21:24 -06:00
Ilia Mirkin
89c5b56be6 nouveau: fix firmware check on nvd7/nvd9
The kernel driver expects the class to be based on chipset generation
rather than VP generation. Make sure to pass 90b1 for NVDX chipsets
instead of 95b1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77102
Fixes: 40dd777b33
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubunutu.com>
2014-04-07 08:58:15 -04:00
Thomas Hellstrom
2f6fcd65f2 winsys/svga: Fix prime surface references also for guest-backed surfaces
Implement guest-backed surface sharing using prime fds. Previously only
legacy surfaces could use this functionality. Also use the vmwgfx 2.6
single-ioctl prime fd reference if available.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-07 03:34:52 -07:00
Thomas Hellstrom
0887b499e9 winsys/svga: Update the vmwgfx_drm.h header to latest version from kernel
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2014-04-07 03:34:47 -07:00
Ilia Mirkin
159cec9dec docs: mark ARB_texture_gather as done on nvc0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:19 -04:00
Ilia Mirkin
f6579e4b17 nvc0: add support for texture gather
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:19 -04:00
Ilia Mirkin
91900c6d33 docs: mark ARB_texture_query_lod as done for nv50, nvc0
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Ilia Mirkin
423f64e83a nvc0: enable texture query lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Ilia Mirkin
d5faf8e786 nv50: enable texture query lod
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-07 01:06:18 -04:00
Dave Airlie
4dc13e3c71 st/mesa: add support for ARB_texture_query_lod
Add support for the LODQ texture instruction.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-07 01:06:18 -04:00
Dave Airlie
be5276ae7d gallium: add support for LODQ opcodes.
This opcode provide support for GL_ARB_texture_query_lod,

Signed-off-by: Dave Airlie <airlied@redhat.com>
[imirkin: rebase, docs update]
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-07 01:06:18 -04:00
Matt Turner
5d0b3ec4ae i965/vec4: Allow constant propagation into dot product.
total instructions in shared programs: 1667088 -> 1667055 (-0.00%)
instructions in affected programs:     3362 -> 3329 (-0.98%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-05 09:52:54 -07:00
Matt Turner
34ec1a24d6 glsl: Optimize (x + y cmp 0) into (x cmp -y).
Cuts a small handful of instructions in Serious Sam 3:

instructions in affected programs:     4692 -> 4666 (-0.55%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:37 -07:00
Matt Turner
6499ecafa5 i965/fs: Split out can_coalesce_vars() function.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:37 -07:00
Matt Turner
29841fbe20 i965/fs: Split out is_coalesce_candidate() function.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:37 -07:00
Matt Turner
0fbcdec2f6 i965/fs: Split fs_visitor::register_coalesce() into its own file.
The function has gotten large, and brw_fs.cpp is the largest source file
in the driver.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:37 -07:00
Matt Turner
8b1ab5c93b i965/fs: Mark appropriate fs_inst members as const.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:36 -07:00
Matt Turner
39ecfca121 i965: Mark is_tex() and friends as const.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-04-05 09:47:36 -07:00
Matt Turner
92d03f7f28 i965/fs: Don't propagate saturation modifiers if there are source modifiers.
Which would lead to translating

   mad     vgrf9:F,  vgrf3:F, u0:F, vgrf6:F
   mov.sat vgrf7:F, -vgrf9:F

into

   mad.sat vgrf9:F,  vgrf3:F, u0:F, vgrf6:F
   mov     vgrf7:F, -vgrf9:F

Fixes some lighting effects in Dota2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76749
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:36 -07:00
Matt Turner
7a7b8a02be i965/fs: Don't propagate saturate modifiers into partial writes.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:36 -07:00
Matt Turner
86ae6f477d i965/fs: Fix off-by-one in saturate propagation.
ip needs to be initialized to start_ip - 1, since the first thing in the
main loop is ip++. Otherwise we would incorrectly propagate the saturate
from the mov to the mad:

   mad     a, b, c, d
   mov.sat x, a
   add     y, z, a

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-05 09:47:36 -07:00
Matt Turner
20dee82a75 i965/vec4: Consider sources of non-GRF-dst instructions for dead channels.
Previously we'd ignore the sources of instructions with non-GRF
destinations when calculating calculating the dead channels. This would
lead to us incorrectly removing the first instruction in this sequence:

   mov vgrf11, ...
   cmp.ne.f0 null, vgrf11, 1.0
   mov vgrf11, ...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76616
2014-04-05 09:47:36 -07:00
Matt Turner
63d57f3b08 i965/fs: Name temporary ralloc contexts something other than mem_ctx.
Or else poor programmers might mistakenly use the temporary mem_ctx,
instead of the fs_visitor's mem_ctx and wonder why their code is
crashing.

Also remove the parenting. These contexts are local to the optimization
passes they're in and are freed at the end.
2014-04-05 09:44:54 -07:00
Matt Turner
26012c1673 i965/fs: Recalculate live intervals in calculate_register_pressure().
Otherwise calling dump_instructions() after declaring a new fs_reg would
segfault when calculate_register_pressure()'s loop over reg walked off
the end of the virtual_grf_start[] array that calculate_live_intervals()
would have reallocated for you, if it had known there was a new
register.
2014-04-05 09:44:54 -07:00
Jonathan Gray
c973e440d5 egl/dri2: use drm macros to construct device name
Don't hardcode /dev/dri/card0 but instead use the drm
macros which allows the correct /dev/drm0 device to be
opened on OpenBSD.

v2: use snprintf and fallback to /dev/dri/card0
v3: check for snprintf truncation

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-05 13:36:29 +01:00
Jonathan Gray
81799c82e4 configure: don't require libudev for gbm or egl drm/wayland
After the loader changes libudev is no longer required for
gbm or the egl drm/wayland platforms.  Lets these build/run
on OpenBSD.

v2: preserve the libudev requirement for Linux as suggested
by Emil Velikov.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:35:25 +01:00
Jonathan Gray
0295953c5d egl/dri2: don't require libudev to build drm/wayland platforms
After the loader changes libudev is no longer required to
build gbm or the egl drm/wayland platforms.

Remove a libudev ifdef which allows the the drm egl driver
to be loaded on OpenBSD.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:33:48 +01:00
Jonathan Gray
11623be934 automake: don't enable -Wl,--no-undefined on OpenBSD
OpenBSD does not have DT_NEEDED entries for libc by design,
over concerns how the symbols would be referenced after
changing the major version of the library.

So avoid -no-undefined checks on OpenBSD as they will fail.

v2: don't include the -no-undefined libtool option in the variable
    and change -Wl,--no-undefined references in Automake.inc as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76856
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-05 13:30:27 +01:00
Emil Velikov
e4bd00c1c6 targets/dri: move common libraries to GALLIUM_DRI_LIB_DEPS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:54 +01:00
Emil Velikov
fc91e7e4ae targets/omx: use GALLIUM_COMMON_LIB_DEPS
The targets do not require expat or selinux. Use GALLIUM_COMMON_LIB_DEPS
which provides the core requirements for each gallium target.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:48 +01:00
Emil Velikov
6b41043050 targets/xvmc: use GALLIUM_COMMON_LIB_DEPS
The targets do not require expat or selinux. Use GALLIUM_COMMON_LIB_DEPS
which provides the core requirements for each gallium target.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:46 +01:00
Emil Velikov
432b5776f2 r600/omx: drop -lstdc++ hack
The build system will use g++ to link the static library due to the
dummy.cpp source(s). Thus one does not need the explicit link against
stdc++.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:02:30 +01:00
Emil Velikov
28a4276442 drivers/nouveau: mention dummy.cpp to use g++ linker
The build system does not know that the static library is C++.
Mention the cpp file to trigger generation of the proper variable
and drop the hacky stdc++ linking.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-05 13:00:32 +01:00
Emil Velikov
16372969c7 drivers/nouveau: use GALLIUM_COMMON_LIB_DEPS
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-05 13:00:14 +01:00
Emil Velikov
c8129604ef drivers/r300: use GALLIUM_COMMON_LIB_DEPS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:00:07 +01:00
Emil Velikov
ba5eba5008 automake: introduce GALLIUM_COMMON_LIB_DEPS
Rather than copying the core four dependencies all over gallium,
introduce the above variable to avoid all the duplication.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 13:00:02 +01:00
Emil Velikov
16c13aaeb8 automake: move GALLIUM_DRI_LIB_DEPS to Automake.inc
With recent commit we started de-duplicating all of the compiler/
linker flags moving their handling inside Automake.inc.

This did not take into consideration that the above variable was set
at configure time, leading to issues on certain build combinations.

Move the variable to where it's used/handled thus cleaning up
configure.ac.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76848
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:59:44 +01:00
Johannes Nixdorf
476db98e03 configure.ac: fix the detection of expat with pkg-config
The pkg-config module was called "EXPAT" instead of "expat" in
PKG_CHECK_EXISTS. This seems to have been wrong because the wrong
argument was copied from PKG_CHECK_MODULES.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:24:01 +01:00
Jonathan Gray
1cc742d912 megadriver_stub.c: don't use _GNU_SOURCE to gate the compat code
_GNU_SOURCE is only set/required for linux*|*-gnu*|gnu*) and as the
functionality is available on other systems check for RTLD_DEFAULT instead.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:21:31 +01:00
Jonathan Gray
380f05ccc3 loader: don't limit the non-udev path to only android
Platforms that lack libudev (OpenBSD and possibly others) need
this change in order to load the correct dri driver.
Under linux we unconditionally require libudev, thus this code
will never get build.

v2: Add commit message (Emil Velikov)

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:17:28 +01:00
Jonathan Gray
727f54a76e loader: use 0 instead of FALSE which isn't defined
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-04-05 12:16:45 +01:00
Francisco Jerez
4ccff1499c clover: Document that the *obj*() helpers already take care of object validation. 2014-04-05 12:18:29 +02:00
Matt Turner
489cb0b2d1 i965: Mark SNB GT1 as a GT1.
brw->gt only seems to be used on gen >= 7, so this shouldn't have any
effect.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-04 15:07:41 -07:00
Marek Olšák
78f754b739 gallium/u_blitter: implement scaled blitting in the Z direction
So that pipe->blit can be used for 3D mipmap generation.
2014-04-04 19:38:36 +02:00
Marek Olšák
8ab7bb4707 gallium/u_blitter: don't adjust cubemap coordinates by a small number
It may cause issues with mipmap generation.
I think it was used to make some piglit tests pass on r300g.
2014-04-04 19:38:36 +02:00
Leo Liu
0817182b2f Revert "radeon: just don't map VRAM buffers at all"
This reverts commit 96e8b916a7.
In the case of VCE encoding with raw YUV file, CPU load directly
to VRAM is faster than combination of CPU writing to GTT and
then blit to VRAM with GPU.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-04-04 16:21:04 +02:00
Leo Liu
de1a59b7a7 radeon/vce: cleanup cpb handling
v2: fix whitespace errors, minor coding style changes

Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-04-04 12:35:55 +02:00
Christian König
6c59be7776 st/mesa: improve sampler view handling
Keep a dynamically increasing array of all the views
created for a texture instead of just the last one.

v2: add comments, fix array size calculation,
    release only the first sampler view found

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-04 10:25:35 +02:00
Thomas Hellstrom
61bedc3d6b st/xa: Fix advertized version number and try to avoid future discrepancies
The xa version number had to be set in two places. In configure.ac and in
xa_tracker.h. Furthermore, xa_tracker.h is an installed header so we can't
use mesa internal defines. So therefore, at configure time, modify the
xa_tracker.h header to use the version given by configure.ac

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-04-04 08:33:43 +02:00
Ian Romanick
4fa58ae5c7 glapi: Fix make check
/me puts a paper bag on his head and sits in the corner.

This was supposed to be included in 5a68f731, which added
glPointSizePointerOES back to the list of functions exposed by
libGLESv1_CM.  It looks like it was an uncommitted change in my tree
when I sent the patch out.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-03 20:12:19 -07:00
Brian Paul
177c9be615 llvmpipe: remove no-op checks in sampler, sampler_view functions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 20:05:56 -06:00
Brian Paul
61a3e9936c softpipe: remove no-op checks in sampler, sampler_view functions
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 19:39:23 -06:00
Brian Paul
4105ad825f svga: remove no-op checks in sampler, sampler_view functions
We are checking for no-ops in the CSO module for both of these items
so there's no reason to do it in the driver.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 19:39:23 -06:00
Brian Paul
5a2f8b2c48 cso: check for no sampler view changes in cso_set_sampler_views()
As we do for sampler states in single_sampler_done() and many other
CSO functions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-03 19:39:23 -06:00
Timothy Arceri
ffa39ab067 docs: Add note about updating tests to dev info
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
2014-04-04 06:48:11 +11:00
José Fonseca
c6050ce7da st/wgl: Remove wgl*Gallium*MESA().
These were only used by the Python state tracker, which was removed, hence
they have no practical use.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-03 12:52:09 +01:00
Ian Romanick
572a25be2f glapi: Fix scons build
Put the -c in the correct place (and match Makefile.am).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76960
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-03 12:52:09 +01:00
Adel Gadllah
d120506e15 glx: Do not advertise buffer_age on dri2
Previously GLX_EXT_buffer_age has always been advertised as supported because
both client_glx_support and client_glx_only where set. So it did not matter
that direct_support is only set when running dri3 and we ended up always
advertising it.

Fix that by not setting client_glx_only for buffer_age in known_glx_extensions.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-04-02 21:28:26 +01:00
Brian Paul
2355a64414 cso: fix sampler view count in cso_set_sampler_views()
We want to call pipe->set_sampler_views() with count being the
maximum of the old number of sampler views and the new number.
This makes sure we null-out any old sampler views.

We already do the same thing for sampler states in single_sampler_done().
Fixes some assertions seen in the VMware driver with XA tracker.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Tested-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-02 13:58:05 -06:00
Ian Romanick
5a68f73102 glapi: Add static dispatch for glPointSizePointerOES
The OpenGL ES 1.1 conformance tests expect this function to be
statically available form libGLESv1_CM.so.  The comment "required for
es1.1" in the XML file should have been a clue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76926
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Lu Hua <huax.lu@intel.com>
2014-04-02 11:30:52 -07:00
Ian Romanick
065ca63043 Revert "Revert "glapi/es1: Don't mark core functions as static_dispatch=false""
This reverts commit 526e49290c.

The original build problem should be fixed by the previous commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
2014-04-02 11:30:49 -07:00
Ian Romanick
cecffa08d1 glapi: Enable ES compatibility mode
Ages ago Chia-I added an ES compatibility flag to several of the various
generator scripts.  The intention was to bridge differences between ES
and desktop in Mesa builds without ES.  It doesn't appear that it has
ever been used.  Recent changes to static_dispatch status of several ES1
functions caused problems in desktop-only, non-shared-glapi builds.
Enabling the ES compatibility mode appears to fix these build problems.

This is kind of a duct tape solution to this problem.  As I mentioned in
the cover letter for the series that triggered the build problem, I
would like to make some major changes to the generator architecture and
the XML.  The whole point of the proposed architecture changes is to
better handle the differences between desktop GL and ES.  I think duct
tape is okay for now.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76869
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
Cc: Chia-I Wu <olv@lunarg.com>
2014-04-02 11:30:45 -07:00
Ian Romanick
8e3a7c6204 glapi: Fix build break in 'make check' on non-shared-glapi builds
Commit fb78fa58 made the GL_ARB_debug_output functions aliases of the
GL_KHR_debug output functions.  As a result, the function names in
struct _glapi_table also changed.  The table in check_table.cpp used the
ARB names.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-04-02 11:30:42 -07:00
Ian Romanick
4e18279fae glapi: Remove support for "short string" mode
C89 has a fairly short minimum-maximum string length.  To support
compilers limited by the C89 limits, this script had a mode where it
would generate a character array instead of a giant string.  These were
functionally the same, but the code generated for the character array is
HUGE and difficult to read.

As far as I can tell, nothing in Mesa uses '-m short' any more.  The
generated files used to be tracked in revision control, but I think we
stopped using '-m short' when we stopped tracking the generated files.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Cc: Vinson Lee <vlee@freedesktop.org>
2014-04-02 11:30:37 -07:00
Juha-Pekka Heikkila
0f641b2d50 mesa: remove redundant running of check_symbol_table()
Nested for loops running through tables against which they
finally do an assert were ran also with optimized builds.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
17e7cbe078 mesa: Add missing null check in _mesa_parse_arb_program()
Add missing null check in program_parse.tab.c through
program_parse.y

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
68a45b130e mesa: Prevent negative indexing on noise2, noise3 and noise4
% operator could return negative value which would cause
indexing before perm table. Change %256 to &0xff

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
1056c50d57 glx: add extra null check in getFBConfigs
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-02 19:54:37 +03:00
Juha-Pekka Heikkila
88976daea9 glx: remove unused __glXClientInfo()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:54:37 +03:00
Tapani Pälli
e14cc504f3 i965/vec4: do not trim dead channels on gen6 for math
Do not set a writemask on Gen6 for math instructions, those are
executed using align1 mode that does not support a destination mask.

v2: cleanups, better comment (Matt)

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-02 19:50:48 +03:00
Thomas Hellstrom
5dc206525b winsys/svga: Replace the query mm buffer pool with a slab pool v3
This is to avoid running out of query buffer space due to winsys
limitations. Instead of a fixed size per screen pool of query buffers,
use a slab allocator that allocates a new slab if we run out of space
in the first one.

v2: Correct email addresses.
v3: s/8192/VMW_QUERY_POOL_SIZE/. Improve documentation and log message.

Reported-and-tested-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-04-02 18:32:44 +02:00
Dave Airlie
76ba50a25a mesa/soft/llvmpipe: add fake MSAA support
This adds a gallium cap that allows us to fake GL3.0 by
not exposing MSAA on sw rendering.
It also forces the extra extensions needed for GL3.2.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-04-02 12:12:04 +10:00
Kristian Høgsberg
882b46a42e gbm: Add gbm_bo_get_fd to gbm-symbols-check script 2014-04-01 14:08:38 -07:00
Kristian Høgsberg
a43d286ef7 gbm: Add import from fd
Add a new import type that lets us create a gbm bo from a
DMA-BUF file descriptor.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-01 12:27:26 -07:00
Kristian Høgsberg
f54f5891be gbm: Add gbm_bo_get_fd()
Add gbm function to get a DMA-BUF file descriptor for a gbm bo.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-01 12:27:13 -07:00
Jordan Justen
7c379ebe17 include/GLES3: add OpenGL ES 3.1 Headers
From:
http://www.khronos.org/registry/gles/api/GLES3/gl31.h
http://www.khronos.org/registry/gles/api/GLES2/gl2ext.h
http://www.khronos.org/registry/gles/api/GLES3/gl3platform.h

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 09:30:32 -07:00
Brian Paul
526e49290c Revert "glapi/es1: Don't mark core functions as static_dispatch=false"
This reverts commit f6e290f80c.

To fix the broken build.  The DRI-enabled build seems OK after reverting.
Th non-DRI/gallium build is still suffering from an unrelated issue in
the pipe-loader code.
2014-04-01 08:42:15 -06:00
Iago Toral Quiroga
f5904b732e mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.
Currently, we raise an error when doing this which breaks a conformance
test from the OpenGL samples pack. Even if this is a bit silly it is not
an error.

From http://www.opengl.org/wiki/Rectangle_Texture:

"Rectangle textures contain exactly one image; they cannot have mipmaps.
Therefore, any texture parameters that depend on LODs are irrelevant
when used with rectangle textures; attempting to set these parameters to
any value other than 0 will result in an error."

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

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 08:37:06 -06:00
Ilia Mirkin
c13ff5a763 gallium/docs: fix silent math failures due to ~ and &
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
b4cf180695 gallium/docs: line up some of the equations
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
05d0223da3 gallium/docs: fix incorrect/missing references
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
45e383bfae gallium/docs: fix use of _ in math sections
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
2f14e5eb09 gallium/docs: add format to index
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Ilia Mirkin
4ca110a7b9 gallium/docs: fix a lot of bad formatting
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 10:17:13 -04:00
Chia-I Wu
5d76e44643 glsl: remove UBO fields from _mesa_glsl_parse_state
They are not needed since 514f8c7ec7.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-04-01 13:41:20 +08:00
Ilia Mirkin
010171b562 nv50: implement clear_buffer to accelerate ARB_clear_buffer_object
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-31 21:55:03 -04:00
Ilia Mirkin
f5ba1a1f7f mesa/st: Accelerate ARB_clear_buffer_object with clear_buffer
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-31 21:21:11 -04:00
Ilia Mirkin
24b86cb304 gallium: add interface to clear buffers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-31 21:20:02 -04:00
Ian Romanick
4c035706dc mapi_abi: Remove ABI-check work arounds for functions that are no longer exported
The previous commit stopped exporting 21 libGLESv2 and 88 libGLESv1_CM
functions.  This removes the work-arounds for those functions from
ABI-check.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:47:25 -07:00
Ian Romanick
1a59f9a131 mapi_abi: Make ES1 and ES2 static_dispatch=false functions hidden
This has been a long standing issue with the ES libraries.  Functions
marked in the XML with 'static_dispatch=false' were still incorrectly
exported.  ABI-check is supposed to detect this case, but we have to
paper over failures every time a new extension is added.

This change will cause a big pile of functions to disappear from
libGLESv2 and libGLESv1_CM.

libGLESv2 loses (20 functions):

    glBindVertexArrayOES
    glCompressedTexImage3DOES
    glCompressedTexSubImage3DOES
    glCopyTexSubImage3DOES
    glDeleteVertexArraysOES
    glDiscardFramebufferEXT
    glDrawBuffersNV
    glFlushMappedBufferRangeEXT
    glFramebufferTexture3DOES
    glGenVertexArraysOES
    glGetBufferPointervOES
    glGetProgramBinaryOES
    glIsVertexArrayOES
    glMapBufferOES
    glMapBufferRangeEXT
    glProgramBinaryOES
    glReadBufferNV
    glTexImage3DOES
    glTexSubImage3DOES
    glUnmapBufferOES

libGLESv1_CM loses (88 functions):

    glAlphaFuncxOES
    glBindFramebufferOES
    glBindRenderbufferOES
    glBlendEquationOES
    glBlendEquationSeparateOES
    glBlendFuncSeparateOES
    glCheckFramebufferStatusOES
    glClearColorxOES
    glClearDepthfOES
    glClearDepthxOES
    glClipPlanefOES
    glClipPlanexOES
    glColor4xOES
    glDeleteFramebuffersOES
    glDeleteRenderbuffersOES
    glDepthRangefOES
    glDepthRangexOES
    glDiscardFramebufferEXT
    glDrawTexfOES
    glDrawTexfvOES
    glDrawTexiOES
    glDrawTexivOES
    glDrawTexsOES
    glDrawTexsvOES
    glDrawTexxOES
    glDrawTexxvOES
    glFlushMappedBufferRangeEXT
    glFogxOES
    glFogxvOES
    glFramebufferRenderbufferOES
    glFramebufferTexture2DOES
    glFrustumfOES
    glFrustumxOES
    glGenerateMipmapOES
    glGenFramebuffersOES
    glGenRenderbuffersOES
    glGetBufferPointervOES
    glGetClipPlanefOES
    glGetClipPlanexOES
    glGetFixedvOES
    glGetFramebufferAttachmentParameterivOES
    glGetLightxvOES
    glGetMaterialxvOES
    glGetRenderbufferParameterivOES
    glGetTexEnvxvOES
    glGetTexGenfvOES
    glGetTexGenivOES
    glGetTexGenxvOES
    glGetTexParameterxvOES
    glIsFramebufferOES
    glIsRenderbufferOES
    glLightModelxOES
    glLightModelxvOES
    glLightxOES
    glLightxvOES
    glLineWidthxOES
    glLoadMatrixxOES
    glMapBufferOES
    glMapBufferRangeEXT
    glMaterialxOES
    glMaterialxvOES
    glMultiTexCoord4xOES
    glMultMatrixxOES
    glNormal3xOES
    glOrthofOES
    glOrthoxOES
    glPointParameterxOES
    glPointParameterxvOES
    glPointSizePointerOES
    glPointSizexOES
    glPolygonOffsetxOES
    glQueryMatrixxOES
    glRenderbufferStorageOES
    glRotatexOES
    glSampleCoveragexOES
    glScalexOES
    glTexEnvxOES
    glTexEnvxvOES
    glTexGenfOES
    glTexGenfvOES
    glTexGeniOES
    glTexGenivOES
    glTexGenxOES
    glTexGenxvOES
    glTexParameterxOES
    glTexParameterxvOES
    glTranslatexOES
    glUnmapBufferOES

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Cc: Paul Berry <stereotype441@gmail.com>
2014-03-31 14:47:00 -07:00
Ian Romanick
dfccd5ccd7 mapi: Hack around glGetInternalformativ not being hidden in GLES
This is hella ugly.  The same-named function in desktop OpenGL is
hidden, but it needs to be exposed by libGLESv2 for OpenGL ES 3.0.
There's no way to express in the XML that a function should be be hidden
in one API but exposed in another.

This won't affect any change now, but it will prevent a regression in a
later patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:46:48 -07:00
Ian Romanick
f6e290f80c glapi/es1: Don't mark core functions as static_dispatch=false
Functions that are part of OpenGL ES 1.0 or 1.1 should have static
dispatch functions in libGLESv1_CM.  This doesn't affect any change yet,
but it will prevent later regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:46:39 -07:00
Ian Romanick
d457eb193c glapi: Mark all GL_ARB_separate_shader_objects functions with static_dispatch=false
This prevents the entrypoints from being (incorrectly) advertised by
libGL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:46:32 -07:00
Ian Romanick
5ccc4e7a8d glapi: Remove some duplicate ignore="true" lines
It looks like these were added accidentally by Paul in commit 1a1db174.
From the commit message and the look of the patch, I think this was just
some sed-job left overs.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-31 14:45:37 -07:00
Matt Turner
3a8bd97241 i965/vec4: Don't trim writemasks of texture instructions.
It was my understanding that the writemask works in SIMD4x2 mode for
texturing instructions and doesn't require a message header. Some bit of
this logic must be wrong, so disable it until it's understood.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76617
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-31 10:24:10 -07:00
Emil Velikov
d681b22ed7 automake: ask the linker to do garbage collection
By doing GC the linker removes all the symbols that are not referenced
and/or used by the final library. This results in a saving of ~100K
up-to ~600K per (stripped) binary (classic vs gallium drivers).

If interested one can ask the compiler to print the sections that are
removed using -Wl,--print-gc-sections.

v2: Check if ld supports the flag before using it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com> (v1)
2014-03-31 14:56:14 +01:00
Emil Velikov
d187a150d4 automake: add -Wl,--no-undefined to all libraries
... apart from the dri drivers.
With this final change we can build mesa without fear that
the resulting libraries will have unresolved symbols.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:09:23 +01:00
Emil Velikov
902dc61f88 gallium/targets: add missing library dependencies
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:08:55 +01:00
Emil Velikov
354a5cad74 pipe-loader: reorder PIPE_LIBS
Reorder -lm, -lrt, -lpthreads and -ldl to be consistent with the
rest of mesa.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-31 13:05:36 +01:00
Emil Velikov
0177ff0039 pipe-loader: use PTHREAD_LIBS over -lpthread
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:02:47 +01:00
Emil Velikov
501af7a1a0 dri/i965: use CLOCK_LIBS over -lrt
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 13:01:10 +01:00
Emil Velikov
5503c227d9 automake: consistently use -no-undefined
Set the flag for all but the dri targets. They have missing
glapi symbols which are required for the normal operation with
the X server.

Jon, I fear that you'll need to carry the "no-undefined" hunk
locally when building the dri drivers under cygwin.

Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:59:16 +01:00
Emil Velikov
6c8d8119ca targets/egl-static: move the common LDFLAGS into AM_LDFLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:56:25 +01:00
Emil Velikov
c323273201 targets/omx: do not link against the trace driver
Unused due to the missing GALLIUM_TRACE define.

Requested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-31 12:55:29 +01:00
Emil Velikov
0484b8446a gallium/targets: explicitly include a dummy.cpp and remove all the LINK mayhem
Explicitly setting the linker variable was required for old and broken
build toolchains. At this point this should no longer be needed, and
setting the sources lists will trigger generation of the correct LINK
variables.

Explicitly include dummy.cpp to use g++ to link the static library which
in most cases is based upon C++ code.

v2: Reword commit message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:26:47 +01:00
Emil Velikov
2d9c33009a gallium/targets: move LLVM_LIBS handling inside Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-31 12:26:32 +01:00
Emil Velikov
2328900f66 gallium/targets: fold LLVM_LDFLAGS inside Automake.inc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-31 12:26:16 +01:00
Emil Velikov
1ea1767f72 targets/omx: use GALLIUM_OMX_LINKER_FLAGS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-31 12:25:34 +01:00
Emil Velikov
e6f8db1e56 targets/omx: introduce GALLIUM_OMX_LIB_DEPS
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-31 12:25:04 +01:00
Emil Velikov
55bc658e4b targets/pipe-loader: move LLVM_LIBS handling inside PIPE_LIBS
This lets us have only one if HAVE_MESA_LLVM block, rather than
one for each driver.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:23:59 +01:00
Emil Velikov
e36cc99880 targets/pipe-loader: include dummy.cpp irrespective of HAVE_MESA_LLVM
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:22:58 +01:00
Emil Velikov
029bc4510b targets/pipe-loader: compact duplicating LDFLAGS
Every library uses the same libtool/linker flags. Compact those
into AM_LDFLAGS and append the version script to it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:22:30 +01:00
Joakim Sindholt
e6545aaaeb pipe-loader/swrast: add soft/llvmpipe defines
Or it compiles them in, but pretends they don't exist

v2: Rebase (Emil)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:22:08 +01:00
Emil Velikov
613b4d59e4 targets/xa: drop libudev references from automake build
Mesa does _not_ link against libudev. Additionally the only place
that deals with it is the loader, thus we can drop the CFLAGS.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:47 +01:00
Emil Velikov
f5466b7b93 dri/common: LIBDRM_LIBS is not a linker/libtool flag, add it to LIBADD
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:42 +01:00
Emil Velikov
46ae286b9d drivers/x11: GL_LIB_DEPS is not a linker/libtool flag, add it to LIBADD
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:36 +01:00
Emil Velikov
e62b7d38a1 configure: autodetect video state-trackers when non swrast driver is present
It makes little sense to enable the vdpau, xvmc and omx state-trackers
as they do not make use of (don't work with) the software driver.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:21:30 +01:00
Emil Velikov
3dc174e85e configure: use grep in quiet mode, rather than piping stderr/stdout to /dev/null
grep -q is easier to read and consistent with the rest of configure.ac.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:20:10 +01:00
Emil Velikov
e8e1158ac3 configure: error out when building gallium-osmesa without softpipe
Gallium osmesa links against the softpipe driver, thus the build
will fail if it's missing.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:18:39 +01:00
Emil Velikov
4d8267ef20 Partially revert "automake: allow only shared builds"
Evidently at least static OSMesa is still used as shared one
causes substantial increase in the load time for some programs
that use it (from seconds up-to ~30min).

Rather than forcing everyone to use shared mesa, revert commit
a6efbac9fb and default to shared
build when both shared and static are disabled.

v2: Whitespace cleanup, drop silly comment.

Reported-by: Burlen Loring <burlen.loring@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:18:17 +01:00
Emil Velikov
23740ed031 configure: enable dri3 only for linux
Currently only linux can make use of dri3, so it would make sense to
enable it explicitly for the platform.
Drop a duplicated libudev check while we're at it.

v3: Properly handle dri3 and reword commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76377
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-31 12:11:37 +01:00
Chris Forbes
ec4b8d1697 mesa: Fix format matching checks for GL_INTENSITY* internalformats.
GL_INTENSITY has never been valid as a pixel format -- to get the memcpy
pack/unpack paths, the app needs to specify GL_RED as the pixel format
(or GL_RED_INTEGER for the integer formats).

Note: This was briefly merged before, but exposed some breakage in gallium, so
was reverted. Hopefully it will stick this time.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 11:56:48 +13:00
Chris Forbes
e3cdbdb14b st: fix st_choose_matching_format to ignore intensity
_mesa_format_matches_format_and_type() returns true for
GL_RED/GL_RED_INTEGER (with an appropriate type) into an intensity
mesa_format.

We want the `red`-based format instead, regardless of the order we find
them in our walk of the mesa formats list.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-04-01 11:56:18 +13:00
Chris Forbes
3196c53c5d mesa: fix texstore for MESA_FORMAT_R8G8B8A8_SRGB
The case for this was in the wrong function, and this format's store
func was not set in the table at all.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-01 11:54:56 +13:00
Rob Clark
db414c4686 freedreno/a3xx/compiler: fix RECT textures
Whether or not the coords are normalized is handled in the texture
state.  But we otherwise need to treat RECT sample instructions as 2D.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 12:10:26 -04:00
Rob Clark
83808a90be freedreno/a3xx/compiler: avoid negative register ids
In some cases, we need a register to be assigned up to three components
before the base.  Since we can't have negative register #'s, just shift
everything up.  May increase register usage for trivial shaders, but I
don't think we are shader limited in those cases.  A proper solution is
going to require a better register assignment algorithm (which is on the
TODO list), this is just a hack to get us by until then.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:53:32 -04:00
Rob Clark
2346ea6347 freedreno/a3xx: missing wfi
RB_FRAME_BUFFER_DIMENSION is not a banked context register, so we need
to wait for the GPU to idle before updating it.  But we'd rather not
have unnecessary WFI's, so actually keep track if we need to emit it or
not.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:50:24 -04:00
Rob Clark
ae5efaf285 freedreno/a3xx: little extra debug
Catch things which should not happen in debug builds.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:40:00 -04:00
Rob Clark
92141afd0e freedreno: handle null sampler
This is something that XA triggers.  In some cases it will only use
SAMP[1] (composite mask) but not SAMP[0] (composite src).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-30 09:38:16 -04:00
Kenneth Graunke
9b6b084eb7 i965: Add Cherryview support.
Based on a patch by Ville Syrjälä.

As usual, these are placeholder values; actual values will come later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 17:10:09 -07:00
Ian Romanick
4047263cb1 glsl: Clean up "unused parameter" warnings
../../src/glsl/builtin_functions.cpp:72:1: warning: unused parameter 'state' [-Wunused-parameter]

../../src/glsl/ir_clone.cpp:31:1: warning: unused parameter 'ht' [-Wunused-parameter]

../../src/glsl/ir_equals.cpp:44:1: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/ir_equals.cpp:50:1: warning: unused parameter 'ignore' [-Wunused-parameter]
../../src/glsl/ir_equals.cpp:68:1: warning: unused parameter 'ignore' [-Wunused-parameter]

../../src/glsl/ir_print_visitor.cpp:149:6: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/ir_print_visitor.cpp:556:1: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/ir_print_visitor.cpp:562:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/link_uniforms.cpp:213:1: warning: unused parameter 'record_type' [-Wunused-parameter]

../../src/glsl/loop_analysis.cpp:225:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/loop_unroll.cpp:73:30: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/loop_unroll.cpp:79:30: warning: unused parameter 'ir' [-Wunused-parameter]
../../src/glsl/loop_unroll.cpp:85:30: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_copy_propagation_elements.cpp:189:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_cse.cpp:402:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_dead_code_local.cpp:117:30: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_redundant_jumps.cpp:53:1: warning: unused parameter 'ir' [-Wunused-parameter]

../../src/glsl/opt_vectorize.cpp:301:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:58 -07:00
Ian Romanick
1b28c8d77a mesa: Clean up "unused parameter" warnings
program/ir_to_mesa.cpp:2008:1: warning: unused parameter 'ir' [-Wunused-parameter]
program/ir_to_mesa.cpp:2272:1: warning: unused parameter 'ir' [-Wunused-parameter]
program/ir_to_mesa.cpp:2278:1: warning: unused parameter 'ir' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:55 -07:00
Ian Romanick
1bdf65f743 mesa/program: Constify find_variable_storage
Also clean up an old whitespace blooper.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:53 -07:00
Ian Romanick
22128e30f3 glsl: Move Doxygen block closing ot the correct place
This is the closing for the "\defgroup IR Intermediate representation
nodes" all the way at the top of the file.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 10:57:49 -07:00
Iago Toral Quiroga
029ccd773d i965: Make sure we always compute valid index bounds before drawing.
When doing software rendering (i.e. rendering to the selection buffer) we need
to make sure that we have valid index bounds before calling _tnl_draw_prims(),
otherwise we can crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59455
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-28 08:48:14 -07:00
Chia-I Wu
e7f7574598 glsl: remove {add,get}_type_ast from glsl_symbol_table
They are not needed since 0da1a2cc36.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-28 10:59:49 +08:00
Brian Paul
e341856294 mesa: fix glMultiDrawArrays inside a display list
The underlying glDrawArrays() calls weren't getting compiled into
the display list.  We simply need to use the current dispatch table
so the CALL_DrawArrays() is routed to the display list save function.

This patch also fixes glMultiModeDrawArraysIBM and
glMultiModeDrawElementsIBM.

Fixes the new piglit gl-1.4-dlist-multidrawarrays test.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-27 11:09:30 -06:00
Brian Paul
12b959c351 st/mesa: overhaul texture / sample swizzle code
Previously we only examined the GL_DEPTH_MODE state to determine the
sampler view swizzle for depth textures.  Now we also consider the
texture base format for color textures too.

The basic idea is if we're sampling from a RGB texture we always
want to get A=1, even if the actual hardware format might be RGBA.
We had assumed that the texture's A values were always one since that's
what Mesa's texstore code does.  But if we render to the RGBA texture,
the A values might not be 1.  Subsequent sampling didn't return the
right values.

Now we examine the user-specified texture base format vs. the actual
gallium format to determine the right swizzle.

Fixes several fbo-blending-formats, fbo-clear-formats and fbo-tex-rgbx
failures with VMware/svga driver (and possibly other drivers).
No other piglit regressions with softpipe or VMware/svga.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2014-03-27 09:45:25 -06:00
Brian Paul
0151707cfc st/mesa: simplify apply_depthmode()
In preparation for following changes.

I used a temporary test harness to compare the old code to the new
for all possible swizzle inputs.  No change in results.
2014-03-27 08:08:26 -06:00
Eric Anholt
b02bcea715 i965: Use intel_upload_space() for pull constant uploads.
This also happens to fix a leak of the current GS pull constant BO on
context destroy, by just not holding on to the pull const bos after the
surface state is generated.

No statistically significant performance difference on GLB2.7 on HSW at
1024x768 (n=40) or 320x240 (n=44), or on BYT at 320x240 (n=47).

v2: Rebase on intel_upload simplification.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-26 13:14:57 -07:00
Eric Anholt
3b57988290 i965: Massively simplify the intel_upload implementation.
The implementation kept a page-sized area for uploading data, and
uploaded chunks from that to a 64kb-sized streamed buffer.  This wasted
cache footprint (and extra state tracking to do so) when we want to just
write our data into the buffer immediately.

Instead, build it around an interface like brw_state_batch() that just
gets you a pointer to BO memory to upload your stuff immediately.

Improves OpenArena on HSW by 1.62209% +/- 0.355299% (n=61) and on BYT by
1.7916% +/- 0.415743% (n=31).

v2: Rebase on Mesa master, drop old prototypes.  Re-do performance
    comparison on a kernel that doesn't punish CPU efficiency
    improvements.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-26 13:13:26 -07:00
Zack Rusin
b1909b260f draw/llvm: improve debugging output a bit
it's useful to know what the llvmbuildstore arguments are going to
be before executing it because it can crash and make sure to
print out the inputs only if we're not generating a gs because
it fetches inputs differently.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 15:58:59 -04:00
Zack Rusin
a3c0fa2d22 draw/gs: reduce the size of the gs output buffer
We used to overallocate the output buffer sometimes running out
of memory with applications rendering large geometries. The actual
maximum number of vertices out is simply the maximum number of
primitives in (number of gs invocations) multiplied by the maximum
number of output vertices per gs input primitive (i.e. gs invocation).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 15:58:32 -04:00
Brian Paul
c875d6e57a svga: add work-around for Sauerbraten Z fighting issue
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
070951b6ba svga: null out query's hwbuf pointer after destroying
Just to be extra safe.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
8bbc84d1e5 svga: add some debug_printf() calls in the query object code
To help debug failures.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
488d4c4826 st/mesa: add null pointer checking in query object functions
Don't pass null query object pointers into gallium functions.
This avoids segfaulting in the VMware driver (and others?) if the
pipe_context::create_query() call fails and returns NULL.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
82246f7939 svga: fix a comment (sampler vs. sampler_view) 2014-03-26 10:31:13 -06:00
Brian Paul
1f4ebfaa88 mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up
And use the z32f_x24s8 helper struct in unpack_Z32_FLOAT_X24S8().
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:31:13 -06:00
Brian Paul
c1377ed464 mesa: fix indentation, formatting, etc in fbobject.c 2014-03-26 10:31:13 -06:00
Brian Paul
f5e0d024d1 mesa: rename format_(un)pack.c functions to match format names (pt. 7)
sed commands:
s/z_Z24_S8\b/S8_UINT_Z24_UNORM/g
s/z_S8_Z24\b/Z24_UNORM_S8_UINT/g
s/z_Z16\b/Z_UNORM16/g
s/z_Z32\b/Z_UNORM32/g
s/z_Z32_FLOAT/Z_FLOAT32/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
7f37802c8a mesa: rename format_(un)pack.c functions to match format names (pt. 6)
sed commands:
s/ARGB2101010_UINT\b/B10G10R10A2_UINT/g
s/ABGR2101010_UINT\b/R10G10B10A2_UINT/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
e51c3f9523 mesa: rename format_(un)pack.c functions to match format names (pt. 5)
sed commands:
s/SIGNED_R_UNORM8\b/R_SNORM8/g
s/SIGNED_RG88_REV\b/R8G8_SNORM/g
s/SIGNED_RGBX8888\b/X8B8G8R8_SNORM/g
s/SIGNED_A8B8G8R8_UNORM\b/A8B8G8R8_SNORM/g
s/SIGNED_R8G8B8A8_UNORM\b/R8G8B8A8_SNORM/g
s/SIGNED_R_UNORM16\b/R_SNORM16/g
s/SIGNED_R16G16_UNORM\b/R16G16_SNORM/g
s/SIGNED_RGB_16\b/RGB_SNORM16/g
s/SIGNED_RGBA_16\b/RGBA_SNORM16/g
s/SIGNED_A_UNORM8\b/A_SNORM8/g
s/SIGNED_L_UNORM8\b/L_SNORM8/g
s/SIGNED_L8A8_UNORM\b/L8A8_SNORM/g
s/SIGNED_L_UNORM8\b/I_SNORM8/g
s/SIGNED_A_UNORM16\b/A_SNORM16/g
s/SIGNED_L_UNORM16\b/L_SNORM16/g
s/SIGNED_L16A16_UNORM\b/LA_SNORM16/g
s/SIGNED_L_UNORM16\b/I_SNORM16/g
s/XBGR16161616_SNORM\b/RGBX_SNORM16/g
s/SIGNED_G8R8_UNORM\b/G8R8_SNORM/g
s/SIGNED_G16R16_UNORM\b/G16R16_SNORM/g
s/SIGNED_I_UNORM8\b/I_SNORM8/g
s/SIGNED_I_UNORM16\b/I_SNORM16/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
f10f5b8822 mesa: rename format_(un)pack.c functions to match format names (pt. 4)
sed commands:
s/SRGBA_UNORM8\b/A8B8G8R8_SRGB/g
s/SABGR_UNORM8\b/R8G8B8A8_SRGB/g
s/SARGB8\b/B8G8R8A8_SRGB/g
s/XBGR8888_SRGB\b/R8G8B8X8_SRGB/g
s/XRGB8888_SRGB\b/B8G8R8X8_SRGB/g
s/SL_UNORM8\b/L_SRGB8/g
s/SLA_UNORM8\b/L8A8_SRGB/g

manually changed SRGB8 -> BGR_SRGB8

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
be9eee3bcf mesa: rename format_(un)pack.c functions to match format names (pt. 3)
sed commands:
s/LUMINANCE_FLOAT32\b/L_FLOAT32/g
s/LUMINANCE_FLOAT16\b/L_FLOAT16/g
s/LUMINANCE_ALPHA_FLOAT32\b/LA_FLOAT32/g
s/LUMINANCE_ALPHA_FLOAT16\b/LA_FLOAT16/g
s/ALPHA_FLOAT32\b/A_FLOAT32/g
s/ALPHA_FLOAT16\b/A_FLOAT16/g
s/XBGR32323232_FLOAT\b/RGBX_FLOAT32/g
s/RGB9_E5_FLOAT\b/R9G9B9E5_FLOAT/g
s/R11_G11_B10_FLOAT\b/R11G11B10_FLOAT/g
s/INTENSITY_FLOAT16\b/I_FLOAT16/g
s/INTENSITY_FLOAT32\b/I_FLOAT32/g

v2: removed a few redundant/no-op substitutions

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
a49f46b15a mesa: rename format_(un)pack.c functions to match format names (pt. 2)
sed commands:
s/ABGR2101010\b/R10G10B10A2_UNORM/g
s/XRGB2101010_UNORM\b/B10G10R10X2_UNORM/g
s/XBGR16161616_UNORM\b/RGBX_UNORM16/g
s/ABGR2101010\b/R10G10B10A2_UNORM/g
s/I8\b/I_UNORM8/g
s/I16\b/I_UNORM16/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Brian Paul
5c619ace6f mesa: rename format_(un)pack.c functions to match format names (pt. 1)
sed commands:
s/RGBA8888\b/A8B8G8R8_UNORM/g
s/RGBA8888_REV\b/R8G8B8A8_UNORM/g
s/ARGB8888\b/B8G8R8A8_UNORM/g
s/ARGB8888_REV\b/A8R8G8B8_UNORM/g
s/RGBA8888\b/X8B8G8R8_UNORM/g
s/RGBA8888_REV\b/R8G8B8X8_UNORM/g
s/XRGB8888\b/B8G8R8X8_UNORM/g
s/XRGB8888_REV\b/X8R8G8B8_UNORM/g
s/RGB888\b/BGR_UNORM8/g
s/BGR888\b/RGB_UNORM8/g
s/RGB565\b/B5G6R5_UNORM/g
s/RGB565_REV\b/R5G6B5_UNORM/g
s/ARGB4444\b/B4G4R4A4_UNORM/g
s/ARGB4444_REV\b/A4R4G4B4_UNORM/g
s/RGBA5551\b/A1B5G5R5_UNORM/g
s/ARGB1555\b/B5G5R5A1_UNORM/g
s/ARGB1555_REV\b/A1R5G5B5_UNORM/g
s/AL44\b/L4A4_UNORM/g
s/AL88\b/L8A8_UNORM/g
s/AL88_REV\b/A8L8_UNORM/g
s/AL1616\b/L16A16_UNORM/g
s/AL1616_REV\b/A16L16_UNORM/g
s/RGB332\b/B2G3R3_UNORM/g
s/A8\b/A_UNORM8/g
s/A16\b/A_UNORM16/g
s/L8\b/L_UNORM8/g
s/L16\b/L_UNORM16/g
s/L8\b/I_UNORM8/g
s/L16\b/I_UNORM16/g
s/R8\b/R_UNORM8/g
s/GR88\b/R8G8_UNORM/g
s/RG88\b/G8R8_UNORM/g
s/R16\b/R_UNORM16/g
s/GR1616\b/R16G16_UNORM/g
s/RG1616\b/G16R16_UNORM/g
s/ARGB2101010\b/B10G10R10A2_UNORM/g

Reviewed-by: Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-26 10:29:12 -06:00
Zack Rusin
bbdefabfc9 llvmpipe: Fix llvmpipe_create_gs_state.
Revert unintended behaviour change from commit
b995a010e6.

Tested-by: José Fonseca <jfonseca@vmware.com>
2014-03-26 16:11:28 +00:00
Christian König
aa2274c1d2 st/omx/dec: fix possible segfault at eos
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-03-26 16:29:20 +01:00
José Fonseca
2de70fe23f mapi/glapi: Use ElementTree instead of libxml2.
It is quite hard to meet the dependency of the libxml2 python bindings
outside Linux, and in particularly on MacOSX; whereas ElementTree is
part of Python's standard library.  ElementTree is more limited than
libxml2: no DTD verification, defaults from DTD, or XInclude support,
but none of these limitations is serious enough to justify using
libxml2.

In fact, it was easier to refactor the code to use ElementTree than to
try to get libxml2 python bindings.

In the process, gl_item_factory class was refactored so that there is
one method for each kind of object to be created, as it simplifies
things substantially.

I confirmed that precisely the same output is generated for GL/GLX/GLES.

v2: Remove m4/ax_python_module.m4 as suggested by Matt Turner.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-26 13:51:32 +00:00
José Fonseca
b761dfa0c3 mapi/glapi: Remove glX_doc.py.
As suggested by Ian Romanick, given it's no longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-26 12:32:57 +00:00
Christian König
d117ddbe31 st/mesa: fix sampler view handling with shared textures v4
Release the references to the sampler views before
destroying the pipe context.

v2: remove TODO and unrelated change
v3: move to st_texture.[ch], rename callback, add comment
v4: fix rebase mess up and add further cleanups

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-26 12:06:43 +01:00
Roland Scheidegger
3b421daf32 gallivm: fix no-op n:n lp_build_resize()
This can get called in some circumstances if both src type and dst type
have same width (seen with float32->unorm32). While this particular case
was bogus anyway let's just fix that as it can work trivially (due to the
way it was called it actually worked anyway apart from the assert).

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-26 01:44:23 +01:00
Kevin Rogovin
fe635d51ff i965: For fast color clears, only check the color of live channels.
When deciding if a clear color is suitable for fast clear,
take into account if a color channel is active in the
buffer format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-25 15:34:28 -07:00
Kenneth Graunke
ee4484be3d i965: Set Broadwell MOCS values everywhere it's possible.
This patch introduces two pre-canned MOCS values: BDW_MOCS_WB
(write-back, all caches) and BDW_MOCS_WT (write-through, all caches).

We use write-through caching for render targets, and write-back for
all other data.  (At least on Haswell, I believe write-back LLC/eLLC
didn't work for scan-out buffers, while write-through did.)

No performance analysis has been done on the impact of this patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2014-03-25 15:14:08 -07:00
Kenneth Graunke
1afe335925 mesa: In core profile, refuse to draw unless a VAO is bound.
Core profile requires a non-default VAO to be bound.  Currently, calls
to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound,
and we never actually get any vertex data set.  Trying to draw without
any vertex data can only cause problems.  In i965, it causes a crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
2014-03-25 15:13:49 -07:00
Ilia Mirkin
29bcc73d4d Revert "build: llvm libs may not be in system search path, add rpath"
This reverts commit d9b983519c.

Unfortunately it seems like rpath is evaluated before LD_LIBRARY_PATH,
so this breaks e.g. steam, as well as any other user of that env var,
if the llvm path happens to be where other libs also reside.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76082
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-25 17:18:46 -04:00
Chris Forbes
4002daf095 Revert "mesa: Fix format matching checks for GL_INTENSITY* internalformats."
This reverts commit 40d7b51953.
2014-03-26 10:06:10 +13:00
Brian Paul
64278b36d6 mesa: move GLbitfield any_valid_stages declaration before code
To fix MSVC build.
2014-03-25 13:33:10 -06:00
Ian Romanick
c4cec40883 glsl: Clean up "unused parameter" warnings
../../src/glsl/ir_constant_expression.cpp:486:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1633:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1752:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1761:1: warning: unused parameter 'variable_context' [-Wunused-parameter]
../../src/glsl/ir_constant_expression.cpp:1769:1: warning: unused parameter 'variable_context' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
f3ab987b70 glsl: Minor clean ups in constant_referenced
These could probably be squashed into one of the previous commits.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
6429d6276d glsl: Remove ir_dereference::constant_referenced
All of the functionality is implemented in a private function in the one
file where it is used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
bb0d6db974 glsl: Fold implementation of ir_dereference_array::constant_referenced into wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
35bf94f901 glsl: Fold implementation of ir_dereference_record::constant_referenced into wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
b66319b006 glsl: Fold implementation of ir_dereference_variable::constant_referenced into wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
14f0faacb6 glsl: Add wrapper function that calls ir_dereference::constant_referenced
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Ian Romanick
c11c7e4f01 glsl: Group all of the constant_referenced functions together
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-25 12:09:36 -07:00
Gwenole Beauchesne
3bd65dc8a1 i965: fix dma_buf import with non-zero offset.
Fix eglCreateImage() from a packed dma_buf surface with a non-zero offset
to pixels data. In particular, this fixes support for planar YUV surfaces
when they are individually mapped on a per-plane basis, i.e. when the
OES_EGL_image_external is not used and user application wants to use its
own shader code for composition, or processing on individual plane (OCL).

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 18:56:41 +01:00
Gregory Hainaut
1c29068074 mesa/sso: Implement ValidateProgramPipeline
Implementation note:
I don't use context for ralloc (don't know how).

The check on PROGRAM_SEPARABLE flags is also done when the pipeline
isn't bound.  It doesn't make any sense in a DSA style API.

Maybe we could replace _mesa_validate_program by
_mesa_validate_program_pipeline.  For example we could recreate a dummy
pipeline object.  However the new function checks also the
TEXTURE_IMAGE_UNIT number not sure of the impact.

V2:
Fix memory leak with ralloc_strdup
Formatting improvement

V3 (idr):
* Actually fix the leak of the InfoLog. :)
* Directly generate logs in to gl_pipeline_object::InfoLog via
  ralloc_asprintf isntead of using a temporary buffer.
* Split out from previous uber patch.
* Change spec references to include section numbers, etc.
* Fix a bug in checking that a different program isn't active in a stage
  between two stages that have the same program.  Specifically,

 if (pipe->CurrentVertexProgram->Name == pipe->CurrentGeometryProgram->Name &&
     pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name)

should have been

 if (pipe->CurrentVertexProgram->Name == pipe->CurrentFragmentProgram->Name &&
     pipe->CurrentGeometryProgram->Name != pipe->CurrentVertexProgram->Name)

v4 (idr): Rework to use CurrentProgram array in loops.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
95426b28ac mesa/sso: Add _mesa_sampler_uniforms_pipeline_are_valid
This is much like _mesa_sampler_uniforms_are_valid, but it operates
across an entire pipeline object.

This function differs from _mesa_sampler_uniforms_are_valid in that it
directly creates the gl_pipeline_object::InfoLog instead of writing to
some temporary buffer.

This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr): Fix the loop bounds.  shProg isn't an array, so
ARRAY_SIZE(shProg) was 1, so only the vertex program was validated.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
aa46ad26b1 mesa/sso: Add gl_pipeline_object::InfoLog support
V2 (idr):
* Keep the behavior of other info logs in Mesa: and empty info log
  reports a GL_INFO_LOG_LENGTH of zero.
* Use a NULL pointer to denote an empty info log.
* Split out from previous uber patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
658eaa3229 mesa/sso: Implement GL_PROGRAM_PIPELINE_BINDING for glGet
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:26 -07:00
Gregory Hainaut
9e9fac4714 mesa/sso: Implement _mesa_BindProgramPipeline
Test become green in piglit:

The updated ext_transform_feedback-api-errors:useprogstage_noactive useprogstage_active bind_pipeline
arb_separate_shader_object-GetProgramPipelineiv
arb_separate_shader_object-IsProgramPipeline

For the moment I reuse Driver.UseProgram but I guess it will be better
to create a UseProgramStages functions. Opinion is welcome

V2: formatting & rename

V3 (idr):
* Change spec references to core OpenGL versions instead of issues in the
  extension spec.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
78578b7599 mesa/sso: Implement _mesa_UseProgramStages
Now arb_separate_shader_object-GetProgramPipelineiv should pass.

V3 (idr):
* Change spec references to core OpenGL versions instead of issues in
  the extension spec.
* Split out from previous uber patch.

v4 (idr): Use _mesa_has_geometry_shaders in _mesa_UseProgramStages to
detect availability of geometry shaders.

v5 (idr): Whitespace cleanup, use _mesa_lookup_shader_program_err
instead of open-coding it again, and update some comments at the end of
_mesa_UseProgramStages.  All suggested by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
4caa9db71c mesa/sso: Add gl_pipeline_object parameter to _mesa_use_shader_program
Extend use_shader_program to support a different target. Allow to reuse the
function to update the pipeline state. Note I bypass the flush when target
isn't current. Maybe it would be better to create a new UseProgramStages
driver function

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
de4f85f52d meta/sso: Update meta to save and restore SSO state.
save and restore _Shader/Pipeline binding point. Rational we don't want any
conflict when the program will be unattached.

V2: formatting improvement

V3 (idr):
* Build fix.  The original patch added calls to _mesa_use_shader_program
  with 4 parameters, but the fourth parameter isn't added to that
  function until a much later patch.  Just drop that parameter for now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
c03477050a mesa/sso: rename Shader to the pointer _Shader
Basically a sed but shaderapi.c and get.c.
get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior
shaderapi.c => the old api stil update the Shader object directly

V2: formatting improvement

V3 (idr):
* Rebase fixes after a block of code was moved from ir_to_mesa.cpp to
  shaderapi.c.
* Trivial reformatting.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
Gregory Hainaut
b2bddaf7a0 mesa/sso: replace Shader binding point with _Shader
To avoid NULL pointer check a default pipeline object is installed in
_Shader when no program is current

The spec say that UseProgram/UseShaderProgramEXT/ActiveProgramEXT got an
higher priority over the pipeline object. When default program is
uninstall, the pipeline is used if any was bound.

Note: A careful rename need to be done now...

V2: formating improvement

V3 (idr):
* Build fix.  The original patch added calls to _mesa_use_shader_program
  with 4 parameters, but the fourth parameter isn't added to that
  function until a much later patch.  Just drop that parameter for now.
* Trivial reformatting.
* Updated comment of gl_context::_Shader

v4 (idr): Reformat spec quotations to look like spec quotations.  Update
comments describing what gl_context::_Shader can point to.  Bot
suggested by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-25 10:25:25 -07:00
José Fonseca
b995a010e6 llvmpipe: Simplify vertex and geometry shaders.
Eliminate lp_vertex_shader, as it added nothing over draw_vertex_shader.

Simplify lp_geometry_shader, as most of the incoming state is unneeded.
(We could also just use draw_geometry_shader if we were willing to peek
inside the structure.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-03-25 12:54:39 +00:00
José Fonseca
ee89432a47 draw: Duplicate TGSI tokens in draw_pipe_pstipple module.
As done in draw_pipe_aaline and draw_pipe_aapoint modules.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-25 12:54:39 +00:00
Alexander von Gluck IV
7683fce878 haiku: Fix build through scons corrections and viewport fixes
* Add HAVE_PTHREAD, we do have pthread support wrappers now for
  non-native Haiku threaded applications.
* Viewport changed behavior recently breaking the build.
  We fix this by looking at the gl_context ViewportArray
  (Thanks Brian for the idea)

Acked-by: Brian Paul <brianp@vmware.com>
2014-03-24 19:01:53 -05:00
Kenneth Graunke
eccad18bd8 i965: For color clears, only disable writes to components that exist.
The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 50%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

v2: Use _mesa_format_has_color_component() to properly handle ALPHA
    formats (and generally be less fragile).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-24 14:46:05 -07:00
Kenneth Graunke
630bf288de mesa: Skip clearing color buffers when color writes are disabled.
WebGL Aquarium in Chrome 24 actually hits this.

v2: Move to core Mesa (wisely suggested by Ian); only consider
    components which actually exist.

v3: Use _mesa_format_has_color_component to determine whether components
    actually exist, fixing alpha format handling.

v4: Add a comment, as requested by Brian.  No actual code changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-24 14:45:03 -07:00
Kenneth Graunke
92234b1b2a mesa: Introduce a _mesa_format_has_color_component() helper.
When considering color write masks, we often want to know whether an
RGBA component actually contains any meaningful data.  This function
provides an easy way to answer that question, and handles luminance,
intensity, and alpha formats correctly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-24 14:38:51 -07:00
Eric Anholt
0d99aef6c8 i965: Fix compiler warning about signed/unsigned.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:16:38 -07:00
Eric Anholt
4545ec1691 i965/gen8: Change the winsys MSAA blits from blorp to meta.
This gets us equivalent code paths on BDW and pre-BDW, except for stencil
(where we don't have MSAA stencil resolve code yet)

Improves MSAA-forced citybench by 7.94496% +/- 2.38429% (n=16).  Reduces
DRI2 MSAA glxgears performance by -12.3559% +/- 1.52845% (n=9).

v2: Move the new meta code to brw_meta_updownsample.c, name it
    brw_meta_updownsample(), add a comment about
    intel_rb_storage_first_mt_slice(), and rename that function and move
    the RB generation into it (review ideas by Ken).
v3: Fix 2 src vs dst pasteos in previous change.
v4: Skip this path pre-gen8 for now, until we can analyze the glxgears
    performance delta some more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:05 -07:00
Eric Anholt
7ccb26fdec mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.
Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys
FBOs *can* have NeedsFinishRenderTexture set.

v2: Keep the short-circuit for non-BindRenderbufferTexImage() drivers
    (review by Ken).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
dd4b226184 i965: Skip reallocating the private MSAA miptree, unless it's resized.
Even if the singlesample_mt got reopened from DRI due to
pageflipping/buffer swapping, our private miptree shouldn't need any
changes.

Improves performance of a little swapbuffers-loving microbenchmark with
MSAA forced on, by 1.2371% +/- 0.624802% (n=102)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
44e944c87c i965: Simplify the no-reopening-the-winsys-buffer tests.
The formatting was weird, and the tests were duplicated, and it is
guaranteed that mt->region exists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
e07e7e9f89 i965: Don't forget to free the old singlesample_mt.
Fixes a memory leak with MSAA winsys buffers since my move of
singlesample_mt to the rb in 4e0924c5de

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Eric Anholt
41033509f2 i965: Add an env var for forcing window system MSAA.
Sometimes it would be nice to benchmark some app with MSAA versus not, but
it doesn't offer the controls you want.  Just provide a handy knob to
force the issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-24 11:15:04 -07:00
Matt Turner
764e25d79d i965/vec4: Eliminate dead writes to the flag register.
For each write, search previous instructions for unread writes to the
flag register and remove them. Note that this will not eliminate the
last unread write.

total instructions in shared programs: 788074 -> 788004 (-0.01%)
instructions in affected programs:     4930 -> 4860 (-1.42%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
9cd51bb0c4 i965/vec4: Eliminate writes that are never read.
With an awful O(n^2) algorithm that searches previous instructions for
dead writes.

total instructions in shared programs: 805582 -> 788074 (-2.17%)
instructions in affected programs:     144561 -> 127053 (-12.11%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
1b8f143a23 i965/vec4: Factor code out of DCE into a separate function.
Will be reused in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
9630ba6c6e i965/vec4: Let dead code eliminate trim dead channels.
That is, modify

   mad dst, a, b, c

to be

   mad dst.xyz, a, b, c

if dst.w is never read.

total instructions in shared programs: 811869 -> 805582 (-0.77%)
instructions in affected programs:     168287 -> 162000 (-3.74%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
dc0f5099fa i965/vec4: Track live ranges per-channel, not per vgrf.
Will be squashed with the next patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
89ccd11eeb i965/vec4: Don't dead code eliminate instructions writing the flag.
A future patch adds support for removing dead writes to the flag
register. This patch simplifies the logic until then.

total instructions in shared programs: 811813 -> 811869 (0.01%)
instructions in affected programs:     3378 -> 3434 (1.66%)

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
3a12f50f9c i965/vec4: Preparatory clean up of dead_code_eliminate().
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:26 -07:00
Matt Turner
10dd6eca89 i965/vec4: Add is_null() method to dst_reg.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
0884ce8f42 i965/vec4: Print the predicate in dump_instructions().
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
a6367dfc15 i965/vec4: Rename depends_on_flags() to reads_flag().
To be consistent with the fs backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
de4692f56c i965/vec4: Add and use vec4_instruction::writes_flag().
To be consistent with the fs backend. Also the instruction scheduler
incorrectly considered SEL with a conditional modifier to read the flag
register.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Matt Turner
b0d3205c2a i965/vec4: Add missing doxygen close brace.
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-24 11:06:25 -07:00
Chris Forbes
a419a1c565 mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlier
The ARB_framebuffer_object spec lists this case before the
FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases.

Fixes two broken cases in piglit's fbo-incomplete test, if
ARB_ES2_compatibility is not advertised. (If it is, this is masked
because the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER /
FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases are removed by that extension)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-25 06:49:25 +13:00
Chris Forbes
40d7b51953 mesa: Fix format matching checks for GL_INTENSITY* internalformats.
GL_INTENSITY has never been valid as a pixel format -- to get the memcpy
pack/unpack paths, the app needs to specify GL_RED as the pixel format
(or GL_RED_INTEGER for the integer formats).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-25 06:47:50 +13:00
Christian König
92e543c45d st/mesa: recreate sampler view on context change v3
With shared glx contexts it is possible that a texture is create and used
in one context and then used in another one resulting in incorrect
sampler view usage.

v2: avoid template copy
v3: add XXX comment

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-24 17:50:38 +01:00
Kenneth Graunke
eabfadf4af i965: Report the type of color clear in INTEL_DEBUG=blorp.
It's useful to know whether a clear is fast (MCS-based), using the
SIMD16 repdata message, or slow.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-23 00:32:53 -07:00
Marek Olšák
011569b5b7 radeonsi: disable fast color clear for 1D-tiled surfaces on CIK
This will be re-enabled once my kernel fix lands.
2014-03-22 18:44:58 +01:00
Kenneth Graunke
4c79f088c0 Revert "i965: For color clears, only disable writes to components that exist."
This reverts commit 2919c3fdb4.

For formats like BGRX, looping through 0..num_components works fine.
But for formats like XRGB, we'd check the color mask for X and fail to
check it for B.
2014-03-21 17:03:20 -07:00
Kenneth Graunke
2919c3fdb4 i965: For color clears, only disable writes to components that exist.
The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 40%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
2014-03-21 15:35:08 -07:00
Kenneth Graunke
a63db538ad i965: Print number of multisamples in INTEL_DEBUG=blorp output.
This lets us distinguish MSAA resolves from other ordinary blits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-03-21 15:34:59 -07:00
Kenneth Graunke
9834058a91 i965: Drop BLT TexSubImage Y-tiling restriction on Gen6+.
Currently, we don't use this path on Sandybridge because we suspect
other paths will be faster.  But we potentially could.  If we do, we
should allow it to support Y-tiled BLTs.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-21 15:31:45 -07:00
Chris Forbes
351e13c5ad i965: Enable ARB_vertex_type_10f_11f_11f_rev for Gen4/5 also.
Tested on ILK and CTG (with the GL3isms taken out of the piglits).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-22 09:19:55 +13:00
Tom Stellard
8d8d0cb09e clover: Fix typo in validate_object()
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-03-21 19:12:12 +01:00
Roland Scheidegger
9477d8c862 llvmpipe: add support for b5g6r5_srgb
The conversion code for srgb was tuned for n x 4x8bit AoS -> 4 x nxfloat SoA
(and vice versa), fix this to handle also 16bit 565-style srgb formats.
Still not really all that generic, things like r10g10b10a2_srgb or
r4g4b4a4_srgb wouldn't work (the latter trivial to fix, the former would not
require more work to not crash but near certainly need some higher precision
calculation) but not needed right now.
The code is not fully optimized for this (could use more direct calculation
instead of expanding to 8-bit range first) but should be good enough.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-21 17:23:38 +01:00
Roland Scheidegger
2aa77f2777 gallium: add b5g6r5 srgb format
GL generally doesn't seem to allow srgb formats with less (or more) than 8 bit
for the rgb channels, though some hw could easily do it (typically for formats
with up to 10 bits for the rgb channels, at least for formats with less than 8
bits support is likely widespread even). While it may be true there aren't
really any benefits for such formats, we need for it for d3d, though luckily
only for b5g6r5_srgb it seems.
So add this format along with the util code for conversion - since that util
code is heavily tuned for 8bit srgb this isn't really all that well optimized
and rounding doesn't seem right but at least it should give some halfway
meaningful results.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-21 17:23:38 +01:00
Ilia Mirkin
19ba573a57 nvc0/ir: move sample id to second source arg to fix sampler2DMS
The nvc0 texfetch instruction expects the sample id to be in the second
source (usually used for the offset) rather than as part of the texture
coordinate.

This fixes all the sampler2DMS/Array tests on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-20 20:47:47 -04:00
Marek Olšák
e5f6b6d0fe st/mesa: drop the lowering of quad strips to triangle strips
This fallback to triangle strips is silly and should be done in drivers
if they need it.

This should fix the case when quad strips are used with flatshading that is
enabled by the "flat" GLSL varying modifier. It also fixes primitive restart
for quad strips.

This fixes piglit:
  NV_primitive_restart/primitive-restart-draw-mode-quad_strip

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
2706448a10 gallium/u_gen_mipmap: remove the software fallback
The last changes to it are from 2008 and 2009.
It doesn't support most texture formats and some texture targets.
Nobody can possibly be using this.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
db722bdcab st/mesa: fix generating mipmaps for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
91df26842f mesa: fix software fallback for generating mipmaps for 3D textures
It didn't use the driver-provided src/dstRowStride at all.
This was broken for the cases when stride != width*bpp.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
78c60d1b63 mesa: fix software fallback for generating mipmaps for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
185ad78ffd mesa: allow generating mipmaps for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
55cf320ed8 mesa: fix texture border handling for cube arrays
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-21 00:50:53 +01:00
Marek Olšák
54690a5f3b r600g: use more appropriate names for async DMA functions
*_dma_copy calls either *_dma_copy_buffer or *_dma_copy_tile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-20 19:03:40 +01:00
Marek Olšák
6c487ff3bd r600g: deobfuscate async DMA code
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-20 18:56:11 +01:00
Marek Olšák
2c703ee8ad r600g: don't flush the gfx IB explicitly before doing DMA
It's flushed by calling r600_context_bo_reloc.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-20 18:41:18 +01:00
Marek Olšák
e914d0052f winsys/radeon: only add duplicate relocations for DMA if VM isn't supported
Also rewrite the comment for it to be readable and reorder the code.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-20 18:41:17 +01:00
Niels Ole Salscheider
71254732db radeonsi: Implement DMA blit
This code is a slightly modified version of evergreen_dma_blit (and
evergreen_dma_copy as well as evergreen_dma_copy_tile).
It would be nice to share some of the code in the long term.

I have reused some "cik"-prefixed functions that also return the right
value for SI. I am not sure if they should be renamed.

v2: Marek> removed gfx.flush in si_dma_copy_tile

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-20 17:21:16 +01:00
Niels Ole Salscheider
acf55e7325 radeon: Move r600_need_dma_space to common code
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-20 17:21:16 +01:00
Richard Sandiford
f4b3430a36 llvmpipe: Tighten check for alpha-only formats
The AoS version of ld_build_blend_factor was assuming that if the first
channel was alpha, there were no rgb components.

Fixes glean/blendFunc on System z.  No piglit regressions on x86_64.
The shortcut is still used in tests like spec/ARB_framebuffer_object/
fbo-alpha.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
2014-03-20 16:50:40 +01:00
Jonathan Gray
8044fd6769 nouveau: don't assume libdrm include prefix
drm headers may be installed in a different directory

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-20 08:32:12 -04:00
Jonathan Gray
8fbc9d9b6f nouveau: use DLOPEN_LIBS instead of -ldl
libdl does not exist on many platforms which have dlopen in libc.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-20 08:32:12 -04:00
Brian Paul
eaf9affa5e c11/threads: don't include assert.h if the assert macro is already defined
In the gallium code, the assert() macro could come from either the
system's assert.h file (via c11/threads.h) or from gallium's u_debug.h.
It looks like all known assert.h files unconditionally #undef assert
before defining their own version.  So the assert you get depends on
whether threads.h or u_debug.h was included last.

In the gallium code we really want to use the assert() from u_debug.h
(it behaves better on Windows).  In gallium, c11/threads.h is only
included after u_debug.h in the os_thread.h wrapper.  So Adding
an #ifndef assert test in the threads*.h files avoids using the system's
assert().

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-19 17:13:31 -06:00
Ilia Mirkin
e58071355e nouveau: there may not have been a texture if the fbo was incomplete
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-19 18:20:29 -04:00
Ilia Mirkin
b676df9abf nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-19 18:17:40 -04:00
Ilia Mirkin
18690995a6 mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture
EXT_packed_depth_stencil is supported by all drivers, but
ARB_depth_texture isn't (notably nouveau_vieux). This should avoid
passing unexpected values down to ChooseTextureFormat.

The EXT_packed_depth_stencil spec does not make any explicit references
to requiring ARB_depth_texture in order to allow textures with that
format, however if there is no dependency, ARB_depth_texture would be
practically implied by the extension.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>

Note for 10.0 backport: This will produce a conflict, the solution is to
move the surrounding if as well.
2014-03-19 18:17:40 -04:00
Ilia Mirkin
51989817e6 loader: add special logic to distinguish nouveau from nouveau_vieux
There are a lot of different pci ids supported by nouveau, and more are
added all the time. The relevant distinguisher between drivers is the
chipset id.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-19 18:17:40 -04:00
Matt Turner
c049dd4396 glsl: Allow dot() on scalars, and throw out dotlike().
In all uses of dotlike() we're writing generic code that operates on 1-4
component vectors. That our IR requires ir_binop_dot expressions'
operands to be 2+ component vectors is an implementation detail that's
not important when implementing built-in functions with dot(), which is
defined for scalar floats in GLSL.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 23:20:29 -07:00
Matt Turner
6cbc64c3cb glsl: Optimize pow(x, 2) into x * x.
Cuts two instructions out of SynMark's Gl32VSInstancing benchmark.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 23:20:29 -07:00
Matt Turner
9a9eaaa79a glsl: Match whitespace changes from previous patch.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 23:20:29 -07:00
Matt Turner
7988b4804f glsl: Expose pack/unpack built-ins for ARB_gpu_shader5.
ARB_gpu_shader5 and ES 3.0 expose different subsets of
ARB_shading_language_packing.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 23:20:29 -07:00
Eric Anholt
651b8baa82 i965: Drop some more dead code from the old CACHED_BATCH feature.
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 14:45:09 -07:00
Eric Anholt
512c88f826 i965: Drop special case for edgeflag thanks to Marek's change to core.
As of 780ce576bb, we end up with R8_SSCALED
anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 14:45:09 -07:00
Brian Paul
f4435da940 mesa: include stdbool.h in register_allocate.h to fix build
https://bugs.freedesktop.org/show_bug.cgi?id=76331
2014-03-18 13:28:17 -06:00
Ian Romanick
f74cf5f80e i965: Enable EWA anisotropic filtering algorithm
Volume 4, part 1 of the Ivybridge PRM says, "Generally, the EWA
approximation algorithm results in higher image quality than the legacy
algorithm."  Using a classic anisotropic filtering "tunnel" demo, it
appears that there is *no* anisotropic filtering on IVB without this bit
set.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 10:56:38 -07:00
Kenneth Graunke
dd2e5d3999 i965: Actually initialize simd16_unsupported and no16_msg.
I meant to include this fixes in v3 of commit
de7ad2c88f, but accidentally pushed a
previous version.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-18 10:50:48 -07:00
Kenneth Graunke
91f4528da6 i965/upload: Refactor open-coded ALIGN-like computations.
Sadly, we can't use actual ALIGN(), since that only supports
power-of-two values for the alignment parameter.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-18 10:39:04 -07:00
Kenneth Graunke
b8b4e280b4 i965: Fix indentation in brw_upload_indices().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-18 10:38:48 -07:00
Kenneth Graunke
051edcc144 i965: Consolidate code for setting brw->ib.start_vertex_offset.
This was set identically in three places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-18 10:38:44 -07:00
Kenneth Graunke
7a0fd3ca1d i965: Allocate register sets at screen creation, not context creation.
Register sets depend on the particular hardware generation, but don't
depend on anything in the actual OpenGL context.  Computing them is
fairly expensive, and they take up a large amount of memory.  Putting
them in the screen allows us to compute/allocate them once for all
contexts, saving both time and space.

Improves the performance of a context creation/destruction
microbenchmark by about 3x on my Haswell i7-4750HQ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:35:53 -07:00
Kenneth Graunke
b3e4b769dd i965: Allocate the screen using ralloc rather than calloc.
This will allow us to use the screen as a memory context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:31:12 -07:00
Eric Anholt
41097db91b ra: Convert another bool array to bitsets.
This one saves about 2MB peak allocation in glsl-fs-algebraic-add-add-1,
with no performance difference on timing short shader-db runs (n=9/10,
warmup outlier removed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-18 10:20:28 -07:00
Kenneth Graunke
da1cce2d68 ra: Use a bitset for storing which registers belong to a class.
This should use 1/8 the memory.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>
2014-03-18 10:15:24 -07:00
Kenneth Graunke
8d856c3937 ra: Create a reg_belongs_to_class() helper function.
This is a little easier to read.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Christoph Brill <egore911@gmail.com>
2014-03-18 10:15:23 -07:00
Kenneth Graunke
786a647245 ra: Use bool instead of GLboolean.
This isn't the GL API, so there's no reason to use GLboolean.

Using bool is safer: any non-zero value is treated as "true".  When
converting a value to a GLboolean, all but the low byte is discarded,
which means that values like 256 will be incorrectly rendered as false.

Done via the following vim commands:
:%s/GLboolean/bool/g
:%s/GL_TRUE/true/g
:%s/GL_FALSE/false/g
and one line of manual whitespace tidying.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-18 10:15:18 -07:00
Kenneth Graunke
de7ad2c88f i965: Accurately bail on SIMD16 compiles.
Ideally, we'd like to never even attempt the SIMD16 compile if we could
know ahead of time that it won't succeed---it's purely a waste of time.
This is especially important for state-based recompiles, which happen at
draw time.

The fragment shader compiler has a number of checks like:

   if (dispatch_width == 16)
      fail("...some reason...");

This patch introduces a new no16() function which replaces the above
pattern.  In the SIMD8 compile, it sets a "SIMD16 will never work" flag.
Then, brw_wm_fs_emit can check that flag, skip the SIMD16 compile, and
issue a helpful performance warning if INTEL_DEBUG=perf is set.  (In
SIMD16 mode, no16() calls fail(), for safety's sake.)

The great part is that this is not a heuristic---if the flag is set, we
know with 100% certainty that the SIMD16 compile would fail.  (It might
fail anyway if we run out of registers, but it's always worth trying.)

v2: Fix missing va_end in early-return case (caught by Ilia Mirkin).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> [v1]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:38 -07:00
Kenneth Graunke
b207e88b25 i965/fs: Support pull parameters in SIMD16 mode.
This is just a matter of reusing the pull/push constant information set
up by the SIMD8 compile.

This gains us 78 SIMD16 programs in shader-db.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:36 -07:00
Kenneth Graunke
229319e0f0 i965/fs: Use a single instance of the pull_constant_loc[] array.
Now that we don't renumber uniform registers, assign_constant_locations
and move_uniform_array_access_to_pull_constants use the same names.
So, they can share a single copy of the pull_constant_loc[] array.

This simplifies the code considerably.  assign_constant_locations()
doesn't need to walk through pull_params[] to rediscover reladdr
demotions; it just has that information in pull_constant_loc[].  We also
only need to rewrite the instruction stream once, instead of twice.

Even better, we now have a single array describing the layout of
all pull parameters, which we can pass to the SIMD16 program.

This actually hurts a few shaders in Serious Sam 3, and one in KWin:
total instructions in shared programs: 1841957 -> 1842035 (0.00%)
instructions in affected programs:     1165 -> 1243 (6.70%)
Comparing dump_instructions() before and after the pull constant
transformations with and without this patch, it appears that there is
a uniform array with variable indexing (reladdr) and constant indexing
(of array element 0).  Previously, we uploaded array element 0 as both
a pull constant (for reladdr) /and/ a push constant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:32 -07:00
Kenneth Graunke
542f2e47f2 i965/fs: Don't renumber UNIFORM registers.
Previously, remove_dead_constants() would renumber the UNIFORM registers
to be sequential starting from zero, and the resulting register number
would be used directly as an index into the params[] array.

This renumbering made it difficult to collect and save information about
pull constant locations, since setup_pull_constants() and
move_uniform_array_access_to_pull_constants() used different names.

This patch generalizes setup_pull_constants() to decide whether each
uniform register should be a pull constant, push constant, or neither
(because it's unused).  Then, it stores mappings from UNIFORM register
numbers to params[] or pull_params[] indices in the push_constant_loc
and pull_constant_loc arrays.  (We already did this for pull constants.)

Then, assign_curb_setup() just needs to consult the push_constant_loc
array to get the real index into the params[] array.

This effectively folds all the remove_dead_constants() functionality
into assign_constant_locations(), while being less irritable to work
with.

v2: Add assert(remapped <= i), requested by Topi.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:29 -07:00
Kenneth Graunke
d9f339eccd i965/fs: Split pull parameter decision making from mechanical demoting.
move_uniform_array_access_to_pull_constants() and setup_pull_constants()
both have two parts:

1. Decide which UNIFORM registers to demote to pull constants, and
   assign locations.
2. Mechanically rewrite the instruction stream to pull the uniform
   value into a temporary VGRF and use that, eliminating the UNIFORM
   file access.

In order to support pull constants in SIMD16 mode, we will need to make
decisions exactly once, but rewrite both instruction streams.
Separating these two tasks will make this easier.

This patch introduces a new helper, demote_pull_constants(), which
takes care of rewriting the instruction stream, in both cases.

For the moment, a single invocation of demote_pull_constants can't
safely handle both reladdr and non-reladdr tasks, since the two callers
still use different names for uniforms due to remove_dead_constants()
remapping of things.  So, we get an ugly boolean parameter saying
which to do.  This will go away.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:26 -07:00
Kenneth Graunke
2163e0fd5a i965/fs: Record pull constant locations for all array elements.
When demoting a variably indexed uniform array to pull constants, we
only recorded the location for the base of the array (element 0).

Recording locations for all array elements is a trivial amount of code
and will make subsequent refactoring easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:24 -07:00
Kenneth Graunke
7c7627781f i965/fs: Save push constant location information.
Previously, both move_uniform_array_access_to_pull_constants() and
setup_pull_constants() maintained stack-local arrays with this
information.  Storing this information will allow it to be used from
multiple functions, allowing us to split and move code around.

We'll also eventually want to pass pull constant location information
to the SIMD16 compile.  Saving this information will help us do that.

Unfortunately, the two functions *cannot* share the contents of the
array just yet.  remove_dead_constants() renumbers all the UNIFORM
registers to be contiguous starting at zero, so the two functions
talk about uniforms using different names.  We can't even remap them,
since move_uniform_array_access_to_pull_constants() deletes UNIFORM
registers that are only accessed with reladdr, so remove_dead_constants
can't even see them.

This situation will improve in the next few patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:21 -07:00
Kenneth Graunke
de77efde91 i965/fs: Delete dead code to fail compiles with SIMD16 pull parameters.
The SIMD8 compile will determine whether pull parameters are necessary.
If so, it will set prog_data->nr_pull_params to a value greater than 0.

brw_wm_fs_emit checks if nr_pull_params > 0 and skips the SIMD16 compile
altogether.  So, this code should never occur.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-18 10:11:08 -07:00
Brian Paul
63e7b51912 gallium/docs: update SLT, SGE, SFL, STR opcode docs
To emphasize that the result is floating point 1.0 or 0.0, to match
other opcodes like SLE and SEQ.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-18 08:03:27 -06:00
Charmaine Lee
81f342ce64 glx: Fix incorrect pdp assignment in dri2_bind_context().
pdp should be set to dpyPriv->dri2Display.
Fixes blank frame failure running glretrace ClearView.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-18 08:03:27 -06:00
Maarten Lankhorst
8fe888fafd nvc0: Handle user mapped vertex buffer for edgeflag
Handle mapping edgeflag data similar to the code around it.
This fixes a crash in piglit test gl-2.0-edgeflag.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-03-18 14:51:06 +01:00
Francisco Jerez
d70ad1a4f9 clover: Fix region size error checking in some buffer transfer commands.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-18 12:14:46 +01:00
Ilia Mirkin
c8309cde30 nv50/ir/gk110: add postfactor support for fmul
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
d8e0d1e882 nv50/ir/gk110: set not modifier on first source of logic op
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
b56e50b8af nv50/ir/gk110: use shl/shr instead of lshf/rshf so that c[] is supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
34bf5e27c6 nv50/ir/gk110: add 64/128-bit fetch/export support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:55 -04:00
Ilia Mirkin
3c40be2615 nv50/ir/gk110: fix handling of OP_SUB for floating point ops
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
72310869f0 nv50/ir/gk110: presin/preex2 take their source at bit 23
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
48a9ba63f5 nv50/ir/gk110: add implementations of div u32/s32
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
4bb14aca29 nv50/ir/gk110: implement quadop
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
67cb8a6996 nv50/ir/gk110: fill in mov from predicate
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
563083ef57 nv50/ir/gk110: handle derivAll flag, fix useOffsets for non-txf
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
ece734b3c1 nv50/ir/gk110: fix setting texture for txd/txf/txq
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
08505549ab nv50/ir/gk110: add texcsaa implementation
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
c17f7247ec nv50/ir/gk110: add pfetch support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:54 -04:00
Ilia Mirkin
15b1f420d0 nv50/ir/gk110: add emit/restart implementations
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
1b68009466 nv50/ir/gk110: add missing break in sched emit
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
76554d2d1f nv50/ir/gk110: implement partial txq support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
cb3dcb1430 nv50/ir/gk110: fill out texture instruction support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:53 -04:00
Ilia Mirkin
ce75a3e8d3 nv50/ir/gk110: fix control flow opcode emission, add sat flag
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-18 05:56:34 -04:00
Chad Versace
468cc866b4 egl/main: Enable Linux platform extensions
Enable EGL_EXT_platform_base and the Linux platform extensions layered
atop it: EGL_EXT_platform_x11, EGL_EXT_platform_wayland,
and EGL_MESA_platform_gbm.

Tested with Piglit's EGL_EXT_platform_base tests under an X11 session.
To enable running the Wayland and GBM tests, windowed Weston was running
and the kernel had render nodes enabled.

I regression tested my EGL_EXT_platform_base patch set with Piglit on
Ivybridge under X11/EGL, standalone Weston, and GBM with rendernodes. No
regressions found.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:49:06 -07:00
Chad Versace
9a40ee16d0 egl/wayland: Emit EGL_BAD_PARAMETER for eglCreatePlatformPixmapSurface
From the EGL_EXT_wayland_spec, version 3:

  It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
  that belongs to Wayland. Any such call fails and generates
  EGL_BAD_PARAMETER.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
1787f5632f egl/gbm: Emit EGL_BAD_PARAMETER for eglCreatePlatformPixmapSurface
From the EGL_MESA_platform_gbm spec, version 5:

  It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
  that belongs to the GBM platform. Any such call fails and generates
  EGL_BAD_PARAMETER.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
6d1f83ec09 egl/main: Stop using EGLNative types internally
Internally, much of the EGL code uses EGLNativeDisplayType,
EGLNativeWindowType, and EGLPixmapType. However, the EGLNative type
often does not match the variable's actual type.

The concept of EGLNative types are a bad match for Linux, as explained
below. And the EGL platform extensions don't use EGLNative types at all.
Those extensions attempt to solve cross-platform issues by moving the
EGL API away from the EGLNative types.

The core of the problem is that eglplatform.h can define each EGLNative
type once only, but Linux supports multiple EGL platforms.

To work around the problem, Mesa's eglplatform.h contains multiple
definitions of each EGLNative type, selected by feature macros. Mesa
expects EGL clients to set the feature macro approrpiately. But the
feature macros don't work when a single codebase must be built with
support for multiple EGL platforms, *such as Mesa itself*.

When building libEGL, autotools chooses the EGLNative typedefs based on
the first element of '--with-egl-platforms'. For example,
'--with-egl-platforms=x11,drm,wayland' defines the following:

    typedef Display* EGLNativeDisplayType;
    typedef Window   EGLNativeWindowType;
    typedef Pixmap   EGLNativePixmapType;

Clearly, this doesn't work well for Wayland and GBM.  Mesa works around
the problem by casting the EGLNative types to different things in
different files.

For sanity's sake, and to prepare for the EGL platform extensions, this
patch removes from egl/main and egl/dri2 all internal use of the
EGLNative types. It replaces them with 'void*' and checks each explicit
cast with a static assertion. Also, the patch touches egl_gallium the
minimal amount to keep it compatible with eglapi.h.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
cefa06cd69 egl: Add STATIC_ASSERT() macro
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
eef68a9094 egl/dri2: Dispatch eglCreateImageKHR by display, not driver
Add dri2_egl_display_vtbl::create_image, set it for each platform, and
let egl_dri2 dispatch eglCreateImageKHR to that.

To remove ambiguity, rename egl_dri2.c:dri2_create_image() to
dri2_create_image_from_dri().

This prepares for the EGL platform extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
88b9e600a6 egl/dri2/x11: Don't clobber _EGLDriver::API
dri2_initialize_x11_swrast() does a strange thing. For some extensions
it doesn't support, it sets the corresponding functions in
_EGLDriver::API to NULL. The intention here is clear, but misplaced.

NULL or not, the function pointers never get called because their
extensions aren't supported.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:23 -07:00
Chad Versace
eadd5e0c0a egl/dri2: Dispatch eglCreateWaylandBufferFromImageWL by display, not driver
Add dri2_egl_display_vtbl::create_wayland_buffer_from_image, set it for
each platform, and let egl_dri2 dispatch
eglCreateWaylandBufferFromImageWL to that.

This prepares for the EGL platform extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:22 -07:00
Chad Versace
f506ef6784 egl/dri2: Consolidate eglTerminate
egl_dri2.c:dri2_terminate() handled terminating X11 and DRM displays.
The Wayland platform implemented its own dri2_wl_terminate(), which was
nearly a copy of the common one.

To implement the EGL platform extensions, we either need to dispatch
eglTerminate per display or define a common implementation for all
platforms. This patch chooses consolidation.  It removes
dri2_wl_terminate() by folding it into the common dri2_terminate().

It was necessary to invert the `if (disp->PlatformDisplay == NULL)` and
the switch statement because, unlike DRM and X11, Wayland's terminator
performed action even when EGL didn't own the native display. In the
inversion, I replaced `disp->PlatformDisplay == NULL` with
`dri2_dpy->own_device` because the two expressions are synonymous, but
the latter's meaning is clearer.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:22 -07:00
Chad Versace
31cd0fee31 egl/dri2/x11: Set dri2_dpy->own_device
When the user calls eglGetDisplay(EGL_DEFAULT_DISPLAY), the Wayland and
DRM platforms set dri2_dpy->own_device=true. This patch makes the X11
platform do the same for consistency.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:39:22 -07:00
Chad Versace
688a0e8e73 egl/dri2: Dispatch eglPostSubBufferNV by display, not driver
Add dri2_egl_display_vtbl::post_sub_buffer, set it for each
platform, and let egl_dri2 dispatch eglPostSubBufferNV to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
75d398ed93 egl/dri2: Dispatch eglSwapBuffersRegionNOK by display, not driver
Add dri2_egl_display_vtbl::swap_buffers_region, set it for each
platform, and let egl_dri2 dispatch eglSwapBuffersRegionNOK to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
bc2cbc0951 egl/dri2: Dispatch eglCopyBuffers by display, not driver
Add dri2_egl_display_vtbl::copy_buffers, set it for each
platform, and let egl_dri2 dispatch eglCopyBuffers to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
3fdfbd2572 egl/dri2: Dispatch API.QueryBufferAge by display, not driver
Add dri2_egl_display_vtbl::query_buffer_age, set it for each
platform, and let egl_dri2 dispatch API.QueryBufferAge to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
958dd80c40 egl/dri2: Dispatch eglDestroySurface by display, not driver
Add dri2_egl_display_vtbl::destroy_surface, set it for each
platform, and let egl_dri2 dispatch eglDestroySurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
bf20076baf egl/dri2: Dispatch eglCreatePbufferSurface by display, not driver
Add dri2_egl_display_vtbl::create_pbuffer_surface, set it for each
platform, and let egl_dri2 dispatch eglCreatePbufferSurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
bc8b07a657 egl/dri2: Dispatch eglCreatePixmapSurface by display, not driver
Add dri2_egl_display_vtbl::create_pbuffer_surface, set it for each
platform, and let egl_dri2 dispatch eglCreatePixmapSurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:04 -07:00
Chad Versace
0a0c881a13 egl/dri2: Dispatch eglCreateWindowSurface by display, not driver
Add dri2_egl_display_vtbl::create_window_surface, set it for each
platform, and let egl_dri2 dispatch eglCreateWindowSurface to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
d03948a766 egl/dri2: Dispatch eglSwapBuffersWithDamage by display, not driver
Add dri2_egl_display_vtbl::swap_buffers_with_damage, set it for each
platform, and let egl_dri2 dispatch eglSwapBuffersWithDamageEXT to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
ad173bcfdb egl/dri2: Dispatch eglSwapBuffers by display, not driver
Add dri2_egl_display_vtbl::swap_buffers, set it for each platform, and
let egl_dri2 dispatch eglSwapBuffers to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
8b9298af0a egl/dri2: Dispatch eglSwapInterval by display, not driver
Add dri2_egl_display_vtbl::swap_interval, set it for each platform, and
let egl_dri2 dispatch eglSwapInterval to that.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
a218765478 egl/wl,x11: Call dri2_swap_interval() statically
Don't call it through the driver dispatch table. Just call it
statically.

This prepares for the EGL platform extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
d019cd81b5 egl/dri2: Put platform func names into proper namespaces
Each of the egl_dri2 platforms (except Android) prefix their function
names with "dri2", not "dri2_${platform}". This means many function
names have three separate definitions in the egl_dri2 directory: one in
each of platform_drm.c, platform_wayland.c, and platform_x11.c. For
example, each of the three files defines dri2_create_window_surface().

The name collisions make it difficult to review patches for correctness
("Is this patch hunk calling a platform_x11 function or a global
egl_dri2 function?"), complicate debugging, and confuse code navigation
tools.

For each function in platform_x11.c prefixed with 'dri2', this patch
changes its prefix to 'dri2_x11'. Likewise for platform_drm.c and
'dri2_drm'; and platform_wayland.c and 'dri2_wl'.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
90502b18b2 egl/dri2: Move dri2_egl_display virtual funcs to vtbl
dri2_egl_display has only one virtual function, 'authenticate'.  Define
dri2_egl_display::vtbl and move 'authenticate' there.

This prepares for the EGL platform extensions, which will add many
more virtual functions to dri2_egl_display.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Chad Versace
38848b6217 egl: Update to revision 24567 of eglext.h
This pulls in EGL_EXT_platform_base, EGL_EXT_platform_wayland,
EGL_EXT_platform_x11, and EGL_MESA_platform_gbm.

This patch has a lot of churn because Khronos recently changed its
method of generating headers. Khronos now generates it headers from XML.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2014-03-17 15:36:03 -07:00
Michel Dänzer
7e0396dd73 winsys/radeon: Store GPU virtual memory addresses of BOs in a hash table
This allows retrieving the existing BO and incrementing its reference count,
instead of creating a separate winsys representation for it, when the kernel
reports that the BO was already assigned a virtual memory address.

This fixes problems with XWayland using radeonsi and the
xf86-video-wlglamor driver, which calls GEM flink outside of the radeon
winsys code and creates BOs from the flinked names using the same DRM file
descriptor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-17 11:53:59 +09:00
Chia-I Wu
361902ec04 targets/dri-ilo: make the driver installable
install-gallium-links.mk fails to create the compat link for ilo_dri.so
because it looks for dri_LTLIBRARIES instead of noinst_LTLIBRARIES.  Fix this
by switching to dri_LTLIBRARIES (and make the driver installable).

Since pci_id_driver_map.h and the DDX both tell libGL.so to look for "i965",
ilo_dri.so will never be loaded even enabled and installed.  The change should
not create any more confusion.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-16 13:26:22 +08:00
Marek Olšák
2e361160ff mesa: mark GL_RGB9_E5 as not color-renderable
The GL 4.4 spec says it's not color-renderable and not accepted
by RenderBufferStorage. The EXT_texture_shared_exponent spec says
it's not color-renderable but it's accepted by RenderBufferStorageEXT.
This seems to be a bug in the extension spec.

Let's do what GL 4.4 says.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-15 18:39:50 +01:00
Aaron Watry
ec1ada7327 radeonsi/compute: Fix memory leak
Free shader buffer object for all kernels when deleting compute state.

Signed-off-by: Aaron Watry <awatry@gmail.com>
2014-03-15 11:59:19 -05:00
Marek Olšák
8199d149ed st/mesa: remove _NEW_POLYGON dependency from vertex shader
We can just check the polygon mode when updating the edge flag state.
Also, we can just flag ST_NEW_VERTEX_PROGRAM directly, which makes
ST_NEW_EDGEFLAGS_DATA useless.
2014-03-15 17:47:36 +01:00
Marek Olšák
4e634c5240 st/mesa: implement zero-stride edge flag by culling primitives
This was unimplemented.
2014-03-15 17:47:36 +01:00
Marek Olšák
3d42696d10 st/mesa: fix per-vertex edge flags and GLSL support (v2)
This fixes piglit/gl-2.0-edgeflag.

v2: use StrideB to recognize per-vertex edge flags

Cc: mesa-stable@lists.freedesktop.org
2014-03-15 17:47:35 +01:00
Kenneth Graunke
7554539d7e i965/fs: Invalidate live intervals when demoting uniforms to pull params.
Normally, nothing uses live intervals at this point, so this isn't
necessary.  However, dump_instructions() calculates them and uses them
to show register pressure.  So, calling dump_instructions() in this area
of the code would segfault due to the arrays being the wrong size.

This is not a candidate for stable branches because it only serves to
fix internal debugging code that you manually have to invoke by altering
the source code or using gdb.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-14 13:18:46 -07:00
Kenneth Graunke
13782dcf9d i965/fs: Print "+reladdr" on variably-indexed uniform arrays.
Previously, dump_instruction() would print output such as:
   {  2}    3: mov vgrf1:F, u0:F
   {  3}    4: mov vgrf7:F, u0:F
   {  4}    5: mov vgrf8:F, u0:F
which looked like either a scalar access or perhaps a constant-indexed
access of element 0, when it was really a variable index.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-14 13:17:57 -07:00
Kenneth Graunke
01d9023a9b i965: Fix register types in dump_instructions(), again.
In commit e57d77280e, I fixed this for
destinations in the Vec4 backend, and sources in the scalar backend.
But not both types in both backends.

To prevent this mess from continuing, make the reg_encoding table
static, so only the disassembler can use it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-14 13:17:57 -07:00
Kenneth Graunke
4d2e79269a i965/fs: Fix register comparisons in saturate propagation.
opt_saturate_propagation_local compares scan_inst->dst.reg/reg_offset
with inst->src[0].reg/reg_offset, and ensures that scan_inst->dst.file
is GRF.  But nothing ensured that inst->src[0].file was GRF.

In the following program, this resulted in u1:F matching vgrf1:UW,
and a saturate being incorrectly propagated from instruction 8 to
instruction 1.

{  1}    0: add vgrf0:UW, hw_reg1+8:UW, hw_reg0:V
{  1}    1: add vgrf1:UW, hw_reg1+10:UW, hw_reg0:V
{  1}    2: linterp vgrf6:F, hw_reg2:F, hw_reg3:F, hw_reg0:F
{  2}    3: linterp vgrf27:F, hw_reg2:F, hw_reg3:F, hw_reg0+16:F
{  4}    4: mov vgrf10+0.0:F, vgrf6:F
{  3}    5: mov vgrf10+1.0:F, vgrf27:F
{  6}    6: tex vgrf8+0.0:F, vgrf10+0.0:F
{  5}    7: mov vgrf32:F, u1:F
{  5}    8: mov.sat vgrf12:F, u1:F

From shader-db:
   total instructions in shared programs: 1841932 -> 1841957 (0.00%)
   instructions in affected programs:     5823 -> 5848 (0.43%)
I inspected two of the 25 hurt shaders, and concluded that they were
both hitting this bug, and not legitimately optimized.

This fixes bugs in Left 4 Dead 2 and Team Fortress 2, possibly among
others.  The optimization pass didn't exist in 10.0, so this is only
a candidate for 10.1.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 13:17:57 -07:00
Eric Anholt
2dbebbd37d glsl: Improve debug output and variable names for opt_dead_code_local.
I know this code has confused others, and it confused me 3 years later,
too.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-14 13:02:05 -07:00
Eric Anholt
2f879356b5 i965: Add support for GL_ARB_buffer_storage.
It turns out we can allow COHERENT storage/mappings all the time,
regardless of LLC vs non-LLC.  It just means never using temporary
mappings to avoid GPU stalls, and on non-LLC we have to use the GTT intead
of CPU mappings.  If we were to use CPU maps on non-LLC (which might be
useful if apps end up using buffer_storage on PBO reads, to avoid WC read
slowness), those would be PERSISTENT but not COHERENT, but doing that
would require us driving the clflushes from userspace somehow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:22 -07:00
Eric Anholt
1990da2568 i965: Always use CPU mappings for BOs on LLC platforms.
It looks like there's no big difference for write-only workloads, but
using a CPU map means that if they happen to read without having set the
MAP_READ_BIT, they get 100x the performance for those reads.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:22 -07:00
Eric Anholt
bb63df0c2d i965: Drop the system-memory temporary allocations for flush explicit.
While in expected usage patterns nobody will ever hit this path, doubling
our bandwidth used seems like a waste, and it cost us extra code too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:22 -07:00
Eric Anholt
ea93246c00 i965: Switch mapping modes for non-explicit-flush blit-temporary maps.
On LLC, it should always be better to use a cached mapping than the GTT.
On non-LLC, it seems pretty silly to try to optimize read performance for
the INVALIDATE_RANGE_BIT case.  This will make the buffer_storage logic
easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 12:56:21 -07:00
Jeff Muizelaar
ff1e850eec gallivm: optimize repeat linear npot code in the aos int path
Similar to the other cases, shift some weight/coord calculations to int
space. This should be slightly faster (on x86 sse it should actually safe one
instruction, and generally int instructions are cheaper).
2014-03-14 19:41:18 +01:00
Roland Scheidegger
9954f01497 gallivm: use correct rounding for nearest wrap mode (in the aos int path)
The previous code used coords which were calculated as
(int) (f_coord * tex_size * 256) >> 8.
This is not only unnecessarily complex but can give the wrong texel due to
rounding for negative coords (as an example, after denormalization coords
from -1.0 to 0.0 should give -1, but this will give -1 for numbers from
-1.0-1/256 - 0.0-1/256.
Instead, juse use ifloor, dropping the shift stuff.
Unfortunately, this will most likely be slower - with arch rounding available
it shouldn't be too bad (trades a int shift for a round but also saves an int
mul (which is shared by all coords) but otherwise it's a mess.
2014-03-14 19:41:18 +01:00
Jeff Muizelaar
88637e5764 gallivm: use correct rounding for linear wrap mode (in the aos int path)
The previous method for converting coords to ints was sligthly inaccurate
(effectively losing 1bit from the 8bit lerp weight). This is probably
especially noticeable when trying to draw a pixel-aligned texture.
As an example, for a 100x100 texture after dernormalization the texture
coords in this case would turn up as
0.5, 1.5, 2.5, 3.5, 4.5, ...
After the mul by 256, conversion to int and 128 subtraction, they end up as
0, 256, 512, 768, 1024, ...
which gets us the correct coords/weights of
0/0, 1/0, 2/0, 3/0, 4/0, ...
But even LSB errors (which are unavoidable) in the input coords may cause
these coords/weights to be wrong, e.g. for a coord of 3.49999 we'd get a
coord/weight of 2/255 instead.

Fix this by using round-to-nearest int instead of FPToSi (trunc). Should be
equally fast on x86 sse though other archs probably suffer a little.
2014-03-14 19:41:18 +01:00
Brian Paul
6757ec3f8e glapi: restore _glthread_GetID() function
This partially reverts patch 02cb04c68f.  This fixes an unresolved
symbol error when using older builds of libGL.

Tested-by: Chia-I Wu <olv@lunarg.com>
2014-03-14 12:12:07 -06:00
Niels Ole Salscheider
f9901f1ab2 radeonsi: flush the dma ring in si_flush_from_st
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-14 15:01:14 +01:00
Niels Ole Salscheider
087b0ff1c1 radeon: Move DMA ring creation to common code
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-03-14 15:01:14 +01:00
Emil Velikov
a9cf3aa208 mesa: return v.value_int64 when the requested type is TYPE_INT64
Fixes "Operands don't affect result" defect reported by Coverity.

Cc: "9.2 10.0 10.1"  <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-14 13:01:47 +00:00
Emil Velikov
f064bcdfbf nvc0: minor cleanups in stream output handling
Constify the offsets parameter to silence gcc warning 'assignment
from incompatible pointer type' due to function prototype miss-match.

Use a boolean changed as a shorthand for target != current_target.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-14 13:00:01 +00:00
Emil Velikov
ad4a44ebfc nouveau: honor fread return value in the nouveau_compiler
There is little point of continuing if fread returns zero, as it
indicates that either the file is empty or cannot be read from.
Bail out if fread returns zero after closing the file.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-14 13:00:01 +00:00
Emil Velikov
ae7d236172 nouveau: typecast the prime_fd handle when calling nouveau_bo_set_prime
Core drm defines that the handle is of type int, while all drivers
treat it as uint internally. Typecast the value to silence gcc
warning messages and be consistent amongst all drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-14 13:00:01 +00:00
Emil Velikov
c26b488088 nv50: add missing brackets when handling the samplers array
Commit 3805a864b1d(nv50: assert before trying to out-of-bounds access
samplers) introduced a series of asserts as a precausion of a previous
illegal memory access.

Although it failed to encapsulate loop within nv50_sampler_state_delete
effectively failing to clear the sampler state, apart from exadurating
the illegal memory access issue.

Fixes gcc warning "array subscript is above array bounds" and
"Nesting level does not match indentation" and "Out-of-bounds read"
defects reported by Coverity.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-14 13:00:01 +00:00
Anuj Phogat
4d0e30accd i965: Fix build warning of unused variable
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-14 02:57:00 -07:00
Adel Gadllah
a69fabc76c dri3: Add GLX_EXT_buffer_age support
v2: Indent according to Mesa style, reuse sbc instead of making a new
    swap_count field, and actually get a usable back before returning the
    age of the back (fixing updated piglit tests).  Changes by anholt.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org> (v1)
Reviewed-by: Adel Gadllah <adel.gadllah@gmail.com> (v2)
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-13 14:19:21 -07:00
Eric Anholt
0b02d8a633 dri3: Prefer the last chosen back when finding a new one.
With the buffer_age code, I need to be able to potentially call this more
than once per frame, and it would be bad if a new special event showing up
meant I chose a different back mid-frame.  Now, once we've chosen a back
for the frame, another find_back will choose it again since we know that
it won't have ->busy set until swap.

Note that this makes find_back return a buffer id instead of a backbuffer
index.  That's kind of a silly distinction anyway, since it's an identity
mapping between the two (it's the front buffer that is at an offset).

Reviewed-By: Adel Gadllah <adel.gadllah@gmail.com>
2014-03-13 14:19:16 -07:00
Neil Roberts
551d459af4 Add the EGL_MESA_configless_context extension
This extension provides a way for an application to render to multiple
surfaces with different buffer formats without having to use multiple
contexts. An EGLContext can be created without an EGLConfig by passing
EGL_NO_CONFIG_MESA. In that case there are no restrictions on the surfaces
that can be used with the context apart from that they must be using the same
EGLDisplay.

_mesa_initialze_context can now take a NULL gl_config which will mark the
context as ‘configless’. It will memset the visual to zero in that case.
Previously the i965 and i915 drivers were explicitly creating a zeroed visual
whenever 0 is passed for the EGLConfig. Mesa needs to be aware that the
context is configless because it affects the initial value to use for
glDrawBuffer. The first time the context is bound it will set the initial
value for configless contexts depending on whether the framebuffer used is
double-buffered.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Neil Roberts
4b17dff3e5 eglCreateContext: Remove the check for whether config == 0
In eglCreateContext there is a check for whether the config parameter is zero
and in this case it will avoid reporting an error if the
EGL_KHR_surfacless_context extension is supported. However there is nothing in
that extension which says you can create a context without a config and Mesa
breaks if you try this so it is probably better to leave it reporting an
error.

The original check was added in b90a3e7d8b based on the API-specific
extensions EGL_KHR_surfaceless_opengl/gles1/gles2. This was later changed to
refer to EGL_KHR_surfacless_context in b50703aea5. Perhaps the original
extensions specified a configless context but the new one does not.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Neil Roberts
4954518125 Fix the initial value of glDrawBuffers for GLES
Under GLES 3 it is not valid to pass GL_FRONT to glDrawBuffers. Instead,
GL_BACK has a magic interpretation which means it will render to the front
buffer on single-buffered contexts and the back buffer on double-buffered. We
were incorrectly setting the initial value to GL_FRONT for single-buffered
contexts. This probably doesn't really matter at the moment except that
presumably it would be exposed in the API via glGetIntegerv.

When we switch to configless contexts this is more important because in that
case we always want to rely on the magic interpretation of GL_BACK in order to
automatically switch between the front and back buffer when a new surface with
a different number of buffers is bound. We also do this for GLES 1 and 2
because the internal value doesn't matter in that case and it is convenient to
use the same code to have the magic interpretation of GL_BACK.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:47 -07:00
Neil Roberts
0c58c96e54 Use the magic behaviour of GL_BACK in GLES 1 and 2 as well as 3
In GLES 3 it is not possible to select rendering to the front buffer and
instead selecting GL_BACK has the magic interpretation that it is either the
front buffer on single-buffered configs or the back buffer on double-buffered.
GLES 1 and 2 have no way of selecting the draw buffer at all. In that case we
were initialising the draw buffer to either GL_FRONT or GL_BACK depending on
the context's config and then leaving it at that.

When we switch to having configless contexts we ideally want Mesa to
automatically switch between the front and back buffer whenever a double-
or single-buffered surface is bound. To make this happen we can just allow
the magic behaviour from GLES 3 in GLES 1 and 2 as well. It shouldn't matter
what the internal value of the draw buffer is in GLES 1 and 2 because there
is no way to query it from the external API.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-03-12 14:40:46 -07:00
Ian Romanick
87c66a4ff7 glsl: Fix typo
Remove extra "any" and re-word-wrap the comment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-12 11:16:50 -07:00
Ian Romanick
6bdc1d96c3 glsl: Rewrite unrolled link_invalidate_variable_locations calls as a loop
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-12 11:16:50 -07:00
Carl Worth
7b8acb9026 docs: Import 10.0.4 release notes, add news item. 2014-03-12 10:22:22 -07:00
Mike Stroyan
6e627b49f9 mesa: Release gl_debug_state when destroying context.
Commit 6e8d04a caused a leak by allocating ctx->Debug but never freeing it.
Release the memory in _mesa_free_errors_data when destroying a context.
Use FREE to match CALLOC_STRUCT from _mesa_get_debug_state.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-12 09:43:05 -06:00
Niels Ole Salscheider
2c886eba78 r600g: compute memory pool size is given in dw
Multiply the dw value by 4 in order to map the complete buffer.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2014-03-11 19:00:08 -07:00
Eric Anholt
d3eb709ded meta: Always restore the framebuffers and current renderbuffer.
The few paths that were playing with framebuffers and renderbuffer were
saving and restoring them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:47:46 -07:00
Eric Anholt
feb3d8dacd i965: Drop intel_check_front_buffer_rendering().
This was being applied in a subset of the places that
intel_prepare_render() was called, to set the same flag that
intel_prepare_render() was setting.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:47:44 -07:00
Eric Anholt
ec542d7457 i965: Drop broken front_buffer_reading/drawing optimization.
The flag wasn't getting updated correctly when the ctx->DrawBuffer or
ctx->ReadBuffer changed.  It usually ended up working out because most
apps only have one window system framebuffer, or if they have more than
one and they have any front read/drawing, they will have called
glReadBuffer()/glDrawBuffer() on it when they get started on the new
buffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:47:41 -07:00
Eric Anholt
66073ef438 intel: When checking for updating front buffer reading, use the right fb.
It's the ctx->ReadBuffer that gets read from, not the ctx->DrawBuffer.
So, if you happened to have a ctx->ReadBuffer that was the winsys buffer,
and it had previously been intel_prepare_render()ed but not invalidated
since then, and you called glReadBuffer() to switch to front buffer
instead of back buffer reading on the winsys fbo while your drawbuffer was
a user FBO, you'd never get the front buffer's miptree fetched, and
segfault.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:46:59 -07:00
Marek Olšák
e1a9a54464 r600g,radeonsi: attempt to fix racy multi-context apps calling BufferData
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75061

v2: minimize the window where cs_buf != new_buf
2014-03-11 19:18:02 +01:00
Marek Olšák
74d95adea0 r600g,radeonsi: fix broken buffer download
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 19:18:02 +01:00
Marek Olšák
4ca3486b19 r600g,radeonsi: use a fallback in dma_copy instead of failing
v2: - allow byte-aligned DMA buffer copies on Evergreen
    - fix piglit/texsubimage regression
    - use the fallback for 3D copies (depth > 1) as well
2014-03-11 19:18:02 +01:00
Marek Olšák
de5094d102 radeonsi: small cleanup in get_param
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
e219842282 radeonsi: set correct alignment for texture buffers and constant buffers
I think these are all equivalent to vertex buffer fetches which should be
dword-aligned. Scalar loads are also dword-aligned.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
f549129564 r600g, radeonsi: fix primitives-generated query with disabled streamout
Buffers are disabled by VGT_STRMOUT_BUFFER_CONFIG, but the query only works
if VGT_STRMOUT_CONFIG.STREAMOUT_0_EN is enabled.

This moves VGT_STRMOUT_CONFIG to its own state. The register is set to 1
if either streamout or the primitives-generated query is enabled.

However, the primitives-emitted query is also incremented, so it's disabled
by setting VGT_STRMOUT_BUFFER_SIZE to 0 when there is no buffer bound.

This fixes piglit:
  ARB_transform_feedback2/counting with pause
  EXT_transform_feedback/primgen-query transform-feedback-disabled

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
958ef47a6d r600g,radeonsi: don't add streamout.num_dw_for_end twice
It's already added in need_cs_space.

Also don't calculate anything if there are no buffers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
4f1f32306a r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits
CB_COLORi_VIEW.SLICE_MAX can be at most 2047.

This fixes the maxlayers piglit test.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
8bd7a6f48c st/dri: flush drawable textures before unreferencing
This fixes piglit/fbo-sys-blit with fast clear on radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
a38e1fd78b radeonsi: implement fast color clear
This works for both multi-sample and single-sample color buffers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
28eb0bcf19 r600g: move fast color clear code to a common place
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
d3c1be530a r600g,radeonsi: move CMASK register values from r600_surface to r600_texture
When doing fast clear for single-sample color buffers for the first time,
a CMASK buffer has to be allocated and the CMASK state in all pipe_surfaces
referencing the color buffer must be updated. Updating all surfaces is kinda
silly, so let's move the values to r600_texture instead.

This is only for Evergreen and later. R600-R700 don't have fast clear.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
61a2fac199 radeonsi: convert the framebuffer state to atom-based
This looks like r600g. The shared Cayman MSAA code is used here.

The real motivation for this is that I need the ability to change values
of color registers after the framebuffer state is set. The PM4 state cannot
be modified easily after it's generated. With this, I can just change
r600_surface::cb_color_xxx and set framebuffer.atom.dirty=true and it's done.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
946d1cfe39 r600g: move cayman MSAA setup to a common place
I will use this in radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
6a5499b9d9 radeonsi: move framebuffer-related state to a new struct si_framebuffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-11 18:51:20 +01:00
Marek Olšák
bee2b96b02 r600g,radeonsi: set priorities for relocations 2014-03-11 18:51:19 +01:00
Marek Olšák
3edb3b86b2 r300g,uvd,vce: set priorities for relocations
This updates all occurences of cs_add_reloc.
2014-03-11 18:51:19 +01:00
Marek Olšák
db1a7f78c2 winsys/radeon: add interface for setting a priority number for each relocation
The cs_add_reloc change is commented out not to break compilation.
The highest priority of all cs_add_reloc calls is send to the kernel.
2014-03-11 18:51:19 +01:00
Jonathan Gray
0d6f573f6e glsl: Link glsl_compiler with pthreads library.
Fixes the following build error on OpenBSD:

./.libs/libglsl.a(builtin_functions.o)(.text+0x973): In function `mtx_lock':
../../include/c11/threads_posix.h:195: undefined reference to `pthread_mutex_lock'
./.libs/libglsl.a(builtin_functions.o)(.text+0x9a5): In function `mtx_unlock':
../../include/c11/threads_posix.h:248: undefined reference to `pthread_mutex_unlock'

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-11 08:47:12 -06:00
Jonathan Gray
40214267ab gallium: add endian detection for OpenBSD
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-11 08:47:12 -06:00
Emil Velikov
a6efbac9fb automake: allow only shared builds
Static and shared builds were possible in the good old days
of static makefiles. Currently the build system does not
distinguish nor does anything special when one requests a
static build.

Print a warning message for the packager that static builds
are not supported and continue building shared libs.

Currently only Debian and derivatives use static build, and
they use it for building a Xlib powered libGL. This patch
will only change the warning message they are seeing but
the binaries produced will be identical.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:44 +00:00
Emil Velikov
065b6ca52b configure: update enable-llvm-shared-libs comments
- As of commit cb080a10b68(configure.ac: Don't require shared LLVM when
building OpenCL) opencl does not mandate using shared llvm.
 - Add a warning message that building with static llvm may cause
compilation problems.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-11 12:50:44 +00:00
Emil Velikov
e267e4318c st/dri: build the drm backend when libdrm is present
Prevent build issues on systems lacking libdrm.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:44 +00:00
Emil Velikov
f41a65397b glx: cleanup unneeded headers
- xf86dri.h is the old dri1 header, not required by dri2 nor dri3
 - fold xf86drm.h inclusiong inside dri2.h
 - dri3_glx does not have any drm specific dependencies
 - glapi.h is not required by the dri2 and dri3 codepaths

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:50:43 +00:00
Jon TURNEY
e5214dd8f1 glx/tests: honor enable-driglx-direct configure flag
Recent commit fixed build issues in dri2_query_renderer.c by
wrapping in defined(direct_rendering) && !defined(applegl)

This patch targets the query_renderer tests, so that make check
passes on platforms such as hurd and cygwin.

v2: (Emil)
 - Rebase and update commit message.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-11 12:50:43 +00:00
Emil Velikov
254aafba3e configure: read libomxil-bellagio.pc only when it exists
Currenly configure.ac will print a warning when one is missing the package.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-11 12:50:43 +00:00
Emil Velikov
22c133546a automake: create compat symlinks only for linux systems
The primary users of these are linux developers, although
it can be extended for *BSD and others if needed.

Fixes make install for Cygwin and OpenBSD at least.

v2:
 - Wrap vdpau targets as well.
v3:
 - Fold HAVE_COMPAT_SYMLINKS conditional within install*links.mk

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63269
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> (v1)
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-11 12:50:43 +00:00
Emil Velikov
bba9c28215 configure: use LIB_EXT rather than hardcoded .so
Some platforms different library extension - dll, dylib, a.
Honor that when we are creating the required links.

Rename LIB_EXTENSION to LIB_EXT while we're here.

With libglapi linking aside, building classic drivers on
non-linux platforms should be possible now.

v2: Resolve conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov
020bc0d0dd automake: do not use symbols names for static glapi.la
In the cases where one links against the static glapi.la there
is no need to create temporary variables only to explicitly
link agaist it.

Instead use SHARED_GLAPI_LIB to explicitly indicate when one
is building and linking with the shared glapi provider.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov
3c5599b276 configure: remove old makefile variables
All the variables were used before the automake conversion
and do not make sense (nor are used) currently.

Replace GL_LIB_NAME with lib$(GL_LIB).$(LIB_EXTENSION) for
apple-glx. The build has been broken for ages, but this will
ease the recovery process as it happens.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:43 +00:00
Emil Velikov
49d7bcea82 gallium/targets: use install-gallium-targets.mk
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
f3595b6748 gallium/targets: drop link generation for non DRI targets
All three (xvmc and omx) do not have an alternative loading
similar to the dri modules. Thus one needs to explicitly install
them in order to use/test them.

v2:
 - Keep vdpau targets, as an equivalent of LIBGL_DRIVERS_PATH
is being worked on.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
d8ba951ad6 targets/vdpau: use install-gallium-links.mk
Drop the duplication across all vdpau targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-11 12:50:42 +00:00
Emil Velikov
ce24bcd394 targets/dri: use install-gallium-links.mk
Drop the duplication across all dri targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
bbae65e25c automake: introduce install-gallium-links.mk
This helper script will be used to minimise the duplication
during link generation across all gallium targets.

v2:
 - Handle vdpau_LTLIBRARIES. Requested by Christian König.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
7b4ccad33d automake: use install-lib-links.mk across all classic mesa
Use the handy script and minimise the boilerplate in the makefiles.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
b496ab0567 automake: make install-lib-links less chatty
There is little point in echoing everything that the script does
to stdout. Wrap it in AM_V_GEN so that a reasonable message is
printed as a indication of it's invocation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:42 +00:00
Emil Velikov
90a4ffdea5 automake: use only the folder name if it's a subfolder of the present one
v2: Resolve rebase conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:41 +00:00
Emil Velikov
b15b1fbb51 automake: silence folder creation
There is little gain in printing whenever a folder is created.

v2:
 - Use $(AM_V_at) over @ to have control in verbose builds.
Suggested by Erik Faye-Lund.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:41 +00:00
Emil Velikov
c690f8dd9b automake: use MKDIR_P when possible
Use the automake predefined macro over hardcoding mkdir -p everywhere.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-11 12:50:41 +00:00
Vinson Lee
e6c565fcc5 radeon: Fix build.
Fix build error introduced with commit
dfa25ea5cd.

  CC       r600_streamout.lo
r600_streamout.c:108:6: error: conflicting types for 'r600_set_streamout_targets'
void r600_set_streamout_targets(struct pipe_context *ctx,
     ^
./r600_pipe_common.h:413:6: note: previous declaration is here
void r600_set_streamout_targets(struct pipe_context *ctx,
     ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76009
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-10 22:54:59 -07:00
Zack Rusin
dfa25ea5cd gallium: allow setting of the internal stream output offset
D3D10 allows setting of the internal offset of a buffer, which is
in general only incremented via actual stream output writes. By
allowing setting of the internal offset draw_auto is capable
of rendering from buffers which have not been actually streamed
out to. Our interface didn't allow. This change functionally
shouldn't make any difference to OpenGL where instead of an
append_bitmask you just get a real array where -1 means append
(like in D3D) and 0 means do not append.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-07 12:49:33 -05:00
Brian Paul
7d5903980e meta: use non-ARB shader/program create/delete functions
The non-ARB versions take GLuint ids, not GLhandleARB.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-10 17:07:05 -06:00
Brian Paul
d96ed5c088 mesa: s/GLhandleARB/GLuint/ for glGetUniform functions
The GL specs say the parameter is GLuint, not GLhandleARB.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-10 17:06:57 -06:00
Brian Paul
a19b19fb94 mesa: rename MESA_FORMAT_X8Z24_UNORM -> MESA_FORMAT_X8_UINT_Z24_UNORM
To follow the example of MESA_FORMAT_Z24_UNORM_X8_UINT.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 16:11:54 -06:00
Brian Paul
9b5fff2dd7 mesa: reorder MESA_FORMAT enums
The MESA_FORMAT_x enums in formats.h weren't declared in any sort
of reasonable order.  Now it should be a little more logical.
This also required reordering tables in formats.c and s_texfetch.c

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Eric Anholt <eric@anholt.net>
2014-03-10 16:11:50 -06:00
Brian Paul
10738727ae mesa: trim down format.h comments
There's no real reason to list all the formats in the comments.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 16:11:45 -06:00
Matt Turner
3330dec90c i965/vec4: Don't fix-up scalar uniforms for 3 src instructions.
Removes unnecessary MOV instructions in L4D2, TF2, Dota2, and many other
Steam games.

total instructions in shared programs: 1668126 -> 1657509 (-0.64%)
instructions in affected programs:     242235 -> 231618 (-4.38%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-10 14:13:45 -07:00
Matt Turner
b823d5df0f i965: Disassemble 3 src instructions' rep_ctrl field.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-10 14:13:45 -07:00
Matt Turner
dafcc1b7c4 i965: Disassemble 3-src operands widths' correctly.
<4,1,1> isn't a real thing. We meant <4,4,1>, i.e., each component of
the whole register.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-10 14:13:45 -07:00
Eric Anholt
30259856a8 i965: Move binding table update packets to binding table setup time.
This keeps us from needing to reemit all the other stage state just
because a surface changed.

Improves unoptimized glamor x11perf -f8text by 1.10201% +/- 0.489869%
(n=296). [v1]

v2:
 - Drop binding table packets from Gen8 unit state as well.
 - Pass _3DSTATE_BINDING_TABLE_POINTERS_XS to brw_upload_binding_table,
   cutting even more code.
v3: Don't forget to drop them from 3DSTATE_GS (botched refactor in v2).

Signed-off-by: Eric Anholt <eric@anholt.net> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v2, v3]
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
2014-03-10 13:05:12 -07:00
Kenneth Graunke
db26253a48 i965: Reorganize the code in brw_upload_binding_tables.
This makes both the empty and non-empty binding table paths exit through
the bottom of the function, which gives us a place to share code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 13:05:12 -07:00
Maarten Lankhorst
8c136b53b7 fix vdpau interop when using -Bsymbolic-functions in ldflags
Explicitly add radeon_drm_winsys_create and nouveau_drm_screen_create to
the dynamic list. This will ensure vdpau interop still works even when
the user links with -Bsymbolic-functions in hardened builds.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Rachel Greenham <rachel@strangenoises.org>
Reported-by: Peter Frühberger <peter.fruehberger@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-10 17:08:19 +01:00
Chia-I Wu
952fda4d3f ilo: do not set I915_EXEC_NO_RELOC
This reverts most of commit d80f0c34b7.  Upon a
closer reading, having the presumed offsets written is not enough to set the
flag.  EXEC_OBJECT_NEEDS_GTT and/or EXEC_OBJECT_WRITE of the reloc entries
must also be set appropriately.
2014-03-10 19:04:43 +08:00
Chia-I Wu
5ecdd7ba22 ilo: add support for PIPE_QUERY_PIPELINE_STATISTICS 2014-03-10 16:43:53 +08:00
Chia-I Wu
8fc2f0c874 ilo: add ILO_3D_PIPELINE_WRITE_STATISTICS
The command writes statistics registers to the specified bo.
2014-03-10 16:43:53 +08:00
Chia-I Wu
d8b2e3c25e ilo: add some MI commands to GPE
We will need MI commands that load/store registers.
2014-03-10 16:43:53 +08:00
Chia-I Wu
0f41f9c63d ilo: set PIPE_CONTROL_GLOBAL_GTT_WRITE automatically
Set the flag automatically in gen6_emit_PIPE_CONTROL(), and set it only for
GEN6.
2014-03-10 16:43:53 +08:00
Chia-I Wu
345bf92f13 ilo: print a warning when PPGTT is disabled
Despite what the PRMs say, the driver appears to work fine when PPGTT is
disabled.  But at least print a warning in that case.
2014-03-10 16:42:42 +08:00
Chia-I Wu
747627d045 ilo: require hardware logical context support
The code paths are not tested for a while, and have some known issues.
2014-03-10 16:42:42 +08:00
Chia-I Wu
72956ed374 ilo: protect the decode context with a mutex
The decode context is not thread safe.
2014-03-10 16:42:42 +08:00
Chia-I Wu
d80f0c34b7 ilo: set I915_EXEC_NO_RELOC when available
The winsys makes it clear that the pipe drivers should write presumed offsets.
We can always set I915_EXEC_NO_RELOC when the kernel supports it.
2014-03-10 16:42:42 +08:00
Chia-I Wu
0b462d3ab1 ilo: move ring types to winsys
It results in less code despite that i915_drm.h specifies the ring type as
part of the execution flags.
2014-03-10 16:42:42 +08:00
Chia-I Wu
42c1ce4c03 ilo: winsys may limit the batch buffer size
The maximum batch buffer size is determined at the time of
drm_intel_bufmgr_gem_init().  Make sure the pipe driver does not exceed the
limit.
2014-03-10 16:42:42 +08:00
Chia-I Wu
a434ac045e ilo: PIPE_CAP_QUERY_TIMESTAMP may not be supported
Reading TIMESTAMP register may fail, depending on both kernel and hardware.
2014-03-10 16:42:42 +08:00
Chia-I Wu
249b1ad984 ilo: rework winsys batch buffer functions
Rename

  intel_winsys_check_aperture_size() to intel_winsys_can_submit_bo(),
  intel_bo_exec() to intel_winsys_submit_bo(), and
  intel_winsys_decode_commands() to intel_winsys_decode_bo().

Make a semantic change to ignore intel_context when the ring is not the render
ring.
2014-03-10 16:42:42 +08:00
Chia-I Wu
3e324f99d3 ilo: replace bo alloc flags by initial domains
The only alloc flag is INTEL_ALLOC_FOR_RENDER, which can as well be expressed
by specifying the initial write domain.  The change makes it obvious that we
failed to set INTEL_ALLOC_FOR_RENDER in several places.
2014-03-10 16:42:42 +08:00
Chia-I Wu
76713ed5d6 ilo: remove intel_bo_get_size()
Commit bfa8d21759 uses it to work around a
hardware limitation.  But there are other ways to do it without the need for
intel_bo_get_size().
2014-03-10 16:42:42 +08:00
Chia-I Wu
790c32ec75 ilo: remove intel_bo_get_virtual()
Make the map functions return the pointer directly.
2014-03-10 16:42:42 +08:00
Chia-I Wu
90786613e9 ilo: rework winsys bo reloc functions
Rename

  intel_bo_emit_reloc() to intel_bo_add_reloc(),
  intel_bo_clear_relocs() to intel_bo_truncate_relocs(), and
  intel_bo_references() to intel_bo_has_reloc().

Besides, we need intel_bo_get_offset() only to get the presumed offset afer
adding a reloc entry.  Remove the function and make intel_bo_add_reloc()
return the presumed offset.  While at it, switch to gem_bo->offset64 from
gem_bo->offset.
2014-03-10 16:42:42 +08:00
Chia-I Wu
76ed4f75dd ilo: add a wrapper to cast struct intel_bo
It is just drm_intel_bo, but having a wrapper makes the code cleaner.
2014-03-10 16:42:42 +08:00
Chia-I Wu
4491f0a971 ilo: fix DRM_API_HANDLE_TYPE_FD export
It can be exported by drm_intel_bo_gem_export_to_prime().  The code is already
in winsys, just not enabled.
2014-03-10 16:42:42 +08:00
Chia-I Wu
276348e85a ilo: improve winsys documentation/comments
Document the interface, and add comments as to why some features are enabled
and why some checks are made.
2014-03-10 16:42:41 +08:00
Chia-I Wu
f2aabecbb0 ilo: remove intel_winsys_enable_reuse()
It should be an (winsys) implementation detail.
2014-03-10 16:42:41 +08:00
Tapani Pälli
56b1be4399 mesa/glsl: introduce a remap table for uniform locations
Patch adds a remap table for uniforms that is used to provide a mapping
from application specified uniform location to actual location in the
UniformStorage. Existing UniformLocationBaseScale usage is removed as
table can be used to set sequential values for array uniform elements.

This mapping helps to implement GL_ARB_explicit_uniform_location so that
uniforms locations can be reorganized and handled in a more easy manner.

v2: small fixes + rename parameters for merge and split functions (Ian)
    improve documentation, remove old check for location bounds (Eric)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-10 09:46:24 +02:00
Tapani Pälli
aa0d95a08d mesa: remove _mesa_symbol_table_iterator structure
Nothing uses this structure, removal fixes Klocwork error about
the possible oom condition in _mesa_symbol_table_iterator_ctor.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-10 09:45:41 +02:00
Michel Dänzer
678cf9618f radeonsi: Use proper member name for deleting export shader PM4 state
Fixes double-free with some piglit tests using geometry shaders.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-10 12:21:50 +09:00
Marek Olšák
9c2a3934c5 r600g: document why texture offset emulation is needed 2014-03-10 00:19:59 +01:00
Ilia Mirkin
897f40f25d Revert nvc0 part of "nv50: adjust blit_3d handling of ms output textures"
The nvc0 bits don't appear to work, and I thought I had removed them
from the commit. Oops.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-09 01:38:10 -05:00
Ilia Mirkin
253314d487 nv50: adjust blit_3d handling of ms output textures
This fixes some unwanted scaling when the output is multisampled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-09 01:32:06 -05:00
Ilia Mirkin
507f0230d4 nouveau: fix fence waiting logic in screen destroy
nouveau_fence_wait has the expectation that an external entity is
holding onto the fence being waited on, not that it is merely held onto
by the current pointer. Fixes a use-after-free in nouveau_fence_wait
when used on the screen's current fence.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75279
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-03-09 01:31:59 -05:00
Ilia Mirkin
5bf90cb521 nouveau: add valid range tracking to nouveau_buffer
This logic is borrowed from the radeon code. The transfer logic will
only get called for PIPE_BUFFER resources, so it shouldn't be necessary
to worry about them becoming render targets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-03-09 01:31:21 -05:00
Julien Cristau
cf1c52575d gbm: make 'devices' array static
It's only used in this one file as far as I can tell, and exporting a
symbol named 'devices' from a shared library is a recipe for trouble.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-08 20:43:54 +00:00
Emil Velikov
330a3799d0 automake: make clean the correct git_sha1.h.tmp
When building out of tree, the file ends up dangling which
may result in a binary with the old git sha.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-08 20:40:56 +00:00
Christian König
6a402359fd radeonsi: fix freeing descriptor buffers
That structure member is a pointer, so the loop with
the Elements macro only freed up the first entry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Christian König
58d2afa223 radeonsi: fix leaking the bound state on destruction v2
v2: rebased on stale pointer fixes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Christian König
1fa2acba61 radeonsi: avoid stale state pointers
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Christian König
1a8c66023b radeonsi: avoid stale pointers in si_delete_shader_selector
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 16:08:15 +01:00
Marek Olšák
c1a06da465 Revert "winsys/radeon: if there's VRAM-only usage, keep it"
This reverts commit 67aef6dafa.

It caused GPU hangs. The question is why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75900
2014-03-08 16:00:25 +01:00
Christian König
a995f564c7 radeon/vce: fix memory leak
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-08 14:43:53 +01:00
Sir Anthony
6e39a8f6ec glcpp: Do not remove spaces to preserve locations.
After preprocessing by glcpp all adjacent spaces were replaced by
single one and glsl parser received column-shifted shader source.
It negatively affected ast location set up and produced wrong error
messages for heavily-spaced shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-08 01:38:32 -08:00
Sir Anthony
da2275cd9b glsl: Change locations from yylloc to appropriate tokens positions.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
5656775cf6 glsl: Add ast_node method to set location range.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
654ee41cd3 glsl: Make ast_node location comments more informative.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
433d562ac6 glsl: Extend ast location structure to hande end token position.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Sir Anthony
6984aa4350 glsl: Update lexers in glsl and glcpp to hande end position of token.
Reviewed-by: Carl Worth <cworth@cworth.org>
2014-03-08 01:29:00 -08:00
Vinson Lee
98fb8c95c0 scons: Add drivers/common/meta_generate_mipmap.c to src/mesa/SConscript.
This patch fixes this SCons build error introduced with commit
70e7905608.

build/linux-x86_64-debug/mesa/libmesa.a(driverfuncs.os): In function `_mesa_init_driver_functions':
src/mesa/drivers/common/driverfuncs.c:99: undefined reference to `_mesa_meta_GenerateMipmap'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-07 23:39:29 -08:00
Kenneth Graunke
14ca611258 meta: Support GenerateMipmaps on 1DArray textures.
I don't know how many people care about this case, but it's easy enough
to do, so we may as well.  The tricky part is that for some reason Mesa
stores the number of array slices in Height, not Depth.

I thought the easiest way to handle that here was to make Height = 1
(the actual height), and srcDepth = srcImage->Height.  This requires
some munging when calling _mesa_prepare_mipmap_level, so I created a
wrapper that sorts it out for us.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:25 -08:00
Kenneth Graunke
158a7440c3 meta: Use srcWidth/Height/Depth rather than srcImage->Width and such.
This is equivalent for now, and will differ once we add 1DArray support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:19 -08:00
Kenneth Graunke
ec23d5197e meta: Support GenerateMipmaps on 2DArray textures.
This is largely a matter of looping over the number of slices/layers,
and not minifying depth (presumably that code exists for the unfinished
3D texture support).

Normally, I would have made the loop over array slices the outermost
loop.  I suspect that would make it trickier to support 3D textures
someday, though, so I didn't.  The advantage is that we would only have
one BufferData call per slice, rather than one per miplevel and slice.

However, a GenerateMipmaps microbenchmark indicates that either way is
basically just as fast.  So I'm not sure it's worth bothering.

Improves performance in a GenerateMipmaps microbenchmark by nearly 5x.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:17 -08:00
Kenneth Graunke
15b2f69b9c meta: Add a 'layer' argument to bind_fbo_image().
For array textures and 3D textures, this represents the layer to use.
Just pass 0 for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:16 -08:00
Kenneth Graunke
be84d53d44 meta: Refactor code for binding a texture image to the FBO.
Almost the exact same code appeared twice, and it needs to expand to
handle additional texture targets.  Refactor it to tidy up the code and
avoid duplicating more work in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:14 -08:00
Kenneth Graunke
45ee1b30d7 meta: Use minify() in GenerateMipmaps code.
This is what the macro is for.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:13 -08:00
Kenneth Graunke
9afca91984 meta: Drop redundant FBO creation code in GenerateMipmaps.
fallback_required() already creates the FBO in order to check whether we
can render to the format.  So it's guaranteed to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:11 -08:00
Kenneth Graunke
1285bc87ac meta: Replace GLboolean with bool in fallback_required().
This doesn't interact with the GL API, so we shouldn't use GL types.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:10 -08:00
Kenneth Graunke
092b7edb3f meta: Make _mesa_meta_check_generate_mipmap_fallback static.
This was only ever used in one place; there's no reason for it to be
non-static.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:09 -08:00
Kenneth Graunke
70e7905608 meta: Split GenerateMipmap() into its own file.
Putting the implementation of each GL function in its own file makes it
much easier not to get lost.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:07 -08:00
Kenneth Graunke
3a7f3d843a meta: De-static setup_texture_coords().
This will be used in multiple files soon.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 22:45:04 -08:00
Timothy Arceri
1308d21fbf glapi: Add KHR_debug.xml 2014-03-08 15:45:26 +11:00
Timothy Arceri
6c3f5abc2d mesa: add missing DebugMessageControl types
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-08 15:38:31 +11:00
Timothy Arceri
fb78fa58d2 mesa: make ARB_debug_output functions an alias of
KHR_debug

Also update dispatch sanity removing ARB_debug_output checks and
removing KHR_debug placeholders as the checks have already been added

V2: Make sure we exit case statements with conditional breaks rather than
just dropping through.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-08 15:38:31 +11:00
Timothy Arceri
0608d346aa glapi: move KHR_debug into its own file
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-08 15:31:59 +11:00
Adel Gadllah
b972e55684 glx_pbuffer: Refactor GetDrawableAttribute
Move the pdraw != NULL check out so that they don't
have to be duplicated.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 16:59:57 -08:00
Adel Gadllah
6b13cd1f7f glx: Update glxext.h to revision 25407
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 16:59:57 -08:00
Tom Stellard
a1b189ac90 radeon: Include radeon_elf_util.c in the list of LLVM_C_FILES v2
This fixes the a build breakage caused by
6974eb9076 on build configurations where
all the following are true:

1. radeonsi is not being built
2. r600g is being built
3. opencl is disabled
4. --enable-r600-llvm-compiler is not being used
5. libelf is not installed

v2:
  - Add $(RADEON_CFLAGS) to libllvmradeon_la_CFLAGS

Tested-by: Brian Paul <brianp@vmware.com>
2014-03-07 18:06:59 -05:00
Brian Paul
9b322d540a st/mesa: only mark framebuffer as sRGB capable if Mesa supports the format
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-07 15:43:36 -07:00
Tom Stellard
6974eb9076 radeon/llvm: Factor elf parsing code out into its own function
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-07 13:31:52 -05:00
Tom Stellard
1f4a9fc84e radeon: Rename struct radeon_llvm_binary to radeon_shader_binary v2
And move its definition into r600_pipe_common.h;  This struct is a just
a container for shader code and has nothing to do with LLVM.

v2:
  - Drop unrelated Makefile change

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-07 13:31:51 -05:00
Marek Olšák
d8fde8ffed gallium: rename R4A4 and A4R4 formats to match their swizzle
Like L4A4.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-07 18:07:05 +01:00
Marek Olšák
780ce576bb mesa: fix the format of glEdgeFlagPointer
Softpipe expects a float in the vertex shader, which is what glEdgeFlag
generates.

This fixes piglit/gl-2.0-edgeflag.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-07 18:07:05 +01:00
Marek Olšák
472ac0db08 radeonsi: fix blit compressed texture workaround to support 2D arrays
We don't have a piglit test for this, but I think it's correct.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-07 18:07:05 +01:00
Marek Olšák
fcdf6fa86c r600g: fix blitting the last 2 mipmap levels for Evergreen
This fixes a lot of compressedteximage piglit tests.

R600-R700 don't have this issue.

Cc: mesa-stable@lists.freedesktop.org
2014-03-07 18:07:05 +01:00
Marek Olšák
8a08051e2a r600g: fix texelFetchOffset GLSL functions
Cc: mesa-stable@lists.freedesktop.org
2014-03-07 18:07:05 +01:00
Marek Olšák
67aef6dafa winsys/radeon: if there's VRAM-only usage, keep it 2014-03-07 18:07:05 +01:00
Niels Ole Salscheider
f112ba03bb radeon: Use upload manager for buffer downloads
Using DMA for reads is much faster.

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off by: Marek Olšák <marek.olsak@amd.com>
2014-03-07 18:07:05 +01:00
Brian Paul
b46e8622f1 glapi: use 'Mesa' in error messages
A user would have no idea what "_glthread_" is.  This removes the
last remaining instance of the _glthread_ string in Mesa.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-07 09:04:01 -07:00
Brian Paul
6d2dffe8b1 st/mesa: add test_format_conversion() debug function
To check that the st_mesa_format_to_pipe_format() and
st_pipe_format_to_mesa_format() functions correctly convert
all corresponding Mesa/Gallium formats.

This found that MESA_FORMAT_YCBCR_REV was missing in
st_mesa_format_to_pipe_format().  Fixed that too.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-07 07:31:29 -07:00
Brian Paul
d8f7e3d79e st/mesa: add MESA_FORMAT_R8G8B8A8_SRGB in st_mesa_format_to_pipe_format()
v2: rename patch after rebasing on top of Jose's changes.

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
2014-03-07 07:31:18 -07:00
José Fonseca
b3689adf51 mesa/st: Fix PIPE_FORMAT_R8G8B8A8_SRGB -> MESA_FORMAT_ conversion.
Copy'n'past typo introduced in my
1d8e3067fd commit.

This fixes swapped RB channels I was seeing in my test machines.

Trivial.
2014-03-07 13:35:24 +00:00
Kusanagi Kouichi
7233d4479e st/vdpau: Add rotation v2
v2: add static asserts

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-07 09:20:11 +01:00
Kusanagi Kouichi
e7e207658c vl: Add rotation v3
v2: rotate in gen_rect_verts instead
v3: clear rotate in vl_compositor_clear_layers,
    update calc_drawn_area as well

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-03-07 09:20:11 +01:00
Christian König
53d1d879d5 st/omx/enc: fix crash on destruction
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-03-07 08:55:57 +01:00
Kenneth Graunke
378c6f2246 mesa: Drop unused hash_table::mem_ctx field.
It's never used, and it's equivalent to ralloc_parent(ht) if you really
need it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-06 20:55:34 -08:00
Michel Dänzer
9ceee5f4be clover: Fix build against LLVM SVN r203065 or newer
llvm/Linker.h was moved to llvm/Linker/Linker.h.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-07 11:12:12 +09:00
Brian Paul
0f0c16b238 mesa: add MESA_FORMAT_R8G8B8A8_SRGB
To match PIPE_FORMAT_R8G8B8A8_SRGB.
v2: fix component name copy&paste bugs

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-06 18:17:14 -07:00
Matt Turner
8d3f739383 mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.
Because people insist on doing things like explicitly disabling SSE 4.1.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Tested-by: David Heidelberger <david.heidelberger@ixit.cz>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71547
2014-03-06 15:46:54 -08:00
Eric Anholt
c10896b593 i965: Fix render-to-texture in non-FinishRenderTexture cases.
We've had several problems now with FinishRenderTexture not getting called
enough, and we're ready to just give up on it ever doing what we need.  In
particular, an upcoming Steam title had rendering bugs that could be fixed
by always_flush_cache=true.

Instead of hoping Mesa core can figure out when we need to flush our
caches, just track what BOs we've rendered to in a set, and when we render
from a BO in that set, emit a flush and clear the set.

There's some overhead to keeping this set, but most of that is just
hashing the pointer -- it turns out our set never even gets very large,
because cache flushes are so common (even on cairo-gl).

No statistically significant performance difference in cairo-gl (n=100),
despite spending ~.5% CPU in these set operations.

v1: (Original patch by Eric Anholt.)
v2: (Changes by Ken Graunke.)
  - Rebase forward from May 7th 2013 -> March 4th 2014.
  - Drop the FinishRenderTexture hook entirely; after rebasing the
    patch, the hook was just an empty function.
  - Move the brw_render_cache_set_clear() call from
    intel_batchbuffer_emit_flush() to brw_emit_pipe_control_flush().
    In theory, this could catch more cases where we've flushed.
  - Consider stencil as a possible texturing source.
v3: (changes by anholt):
  - Move set_clear() back to emit_mi_flush() -- it means we can drop
    more forced flushes from the code.  In the previous location, it
    wouldn't have been called when we wanted pre-gen6.
  - Move the set clear from batch init to reset -- it should be empty at
    the start of every batch, since the kernel handled any inter-batch
    flush for us.
v4: Drop the debug code in set.c that I accidentally committed.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com> [v2]
2014-03-06 11:35:17 -08:00
Brian Paul
1e25aa4cdb mesa: fix copy & paste bugs in pack_ubyte_SRGB8()
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-06 11:39:41 -07:00
Brian Paul
9493fc729e mesa: fix copy & paste bugs in pack_ubyte_SARGB8()
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-06 11:16:15 -07:00
Aaron Watry
fb78152678 gallium/util: Fix memory leak
Fix a leaked vertex shader in u_blitter.c

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>

CC: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-06 11:38:26 -06:00
José Fonseca
1d8e3067fd st/mesa: Add R8G8B8A8_SRGB case to st_pipe_format_to_mesa_format.
With the recent SRGB changes all my automated OpenGL llvmpipe tests
(piglit, conform, glretrace) start asserting with the backtrace below.

I'm hoping this change will fix it.  I'm not entirely sure, as this
doesn't happen in my development machine (the bug probably depends on
the exact X visual).

Anyway, it seems the sensible thing to do here.

   Program terminated with signal 5, Trace/breakpoint trap.
   #0  _debug_assert_fail (expr=expr@entry=0x7fa324df2ed7 "0", file=file@entry=0x7fa324e3fc30 "src/mesa/state_tracker/st_format.c", line=line@entry=758, function=function@entry=0x7fa324e40160 <__func__.34798> "st_pipe_format_to_mesa_format") at src/gallium/auxiliary/util/u_debug.c:281
   #0  _debug_assert_fail (expr=expr@entry=0x7fa324df2ed7 "0", file=file@entry=0x7fa324e3fc30 "src/mesa/state_tracker/st_format.c", line=line@entry=758, function=function@entry=0x7fa324e40160 <__func__.34798> "st_pipe_format_to_mesa_format") at src/gallium/auxiliary/util/u_debug.c:281
   No locals.
   #1  0x00007fa3241d22b3 in st_pipe_format_to_mesa_format (format=format@entry=PIPE_FORMAT_R8G8B8A8_SRGB) at src/mesa/state_tracker/st_format.c:758
           __func__ = "st_pipe_format_to_mesa_format"
   #2  0x00007fa3241c8ec5 in st_new_renderbuffer_fb (format=format@entry=PIPE_FORMAT_R8G8B8A8_SRGB, samples=0, sw=<optimised out>) at src/mesa/state_tracker/st_cb_fbo.c:295
           strb = 0x19e8420
   #3  0x00007fa32409d355 in st_framebuffer_add_renderbuffer (stfb=stfb@entry=0x19e7fa0, idx=<optimised out>) at src/mesa/state_tracker/st_manager.c:314
           rb = <optimised out>
           format = PIPE_FORMAT_R8G8B8A8_SRGB
           sw = <optimised out>
   #4  0x00007fa32409e635 in st_framebuffer_create (st=0x19e7fa0, st=0x19e7fa0, stfbi=0x19e7a30) at src/mesa/state_tracker/st_manager.c:458
           stfb = 0x19e7fa0
           mode = {rgbMode = 1 '\001', floatMode = 0 '\000', colorIndexMode = 0 '\000', doubleBufferMode = 0, stereoMode = 0, haveAccumBuffer = 0 '\000', haveDepthBuffer = 1 '\001', haveStencilBuffer = 1 '\001', redBits = 8, greenBits = 8, blueBits = 8, alphaBits = 8, redMask = 0, greenMask = 0, blueMask = 0, alphaMask = 0, rgbBits = 32, indexBits = 0, accumRedBits = 0, accumGreenBits = 0, accumBlueBits = 0, accumAlphaBits = 0, depthBits = 24, stencilBits = 8, numAuxBuffers = 0, level = 0, visualRating = 0, transparentPixel = 0, transparentRed = 0, transparentGreen = 0, transparentBlue = 0, transparentAlpha = 0, transparentIndex = 0, sampleBuffers = 0, samples = 0, maxPbufferWidth = 0, maxPbufferHeight = 0, maxPbufferPixels = 0, optimalPbufferWidth = 0, optimalPbufferHeight = 0, swapMethod = 0, bindToTextureRgb = 0, bindToTextureRgba = 0, bindToMipmapTexture = 0, bindToTextureTargets = 0, yInverted = 0, sRGBCapable = 1}
           idx = <optimised out>
   #5  st_framebuffer_reuse_or_create (st=st@entry=0x19dfce0, fb=<optimised out>, stfbi=stfbi@entry=0x19e7a30) at src/mesa/state_tracker/st_manager.c:728
   No locals.
   #6  0x00007fa32409e8cc in st_api_make_current (stapi=<optimised out>, stctxi=0x19dfce0, stdrawi=0x19e7a30, streadi=0x19e7a30) at src/mesa/state_tracker/st_manager.c:747
           st = 0x19dfce0
           stdraw = 0x640064
           stread = 0x1300000006
           ret = <optimised out>
   #7  0x00007fa324074a20 in XMesaMakeCurrent2 (c=c@entry=0x195bb00, drawBuffer=0x19e7e90, readBuffer=0x19e7e90) at src/gallium/state_trackers/glx/xlib/xm_api.c:1194
   No locals.
   #8  0x00007fa3240783c8 in glXMakeContextCurrent (dpy=0x194e900, draw=8388610, read=8388610, ctx=0x195bac0) at src/gallium/state_trackers/glx/xlib/glx_api.c:1177
           drawBuffer = <optimised out>
           readBuffer = <optimised out>
           xmctx = 0x195bb00
           glxCtx = 0x195bac0
           firsttime = 0 '\000'
           no_rast = 0 '\000'
   #9  0x00007fa32407852f in glXMakeCurrent (dpy=<optimised out>, drawable=<optimised out>, ctx=<optimised out>) at src/gallium/state_trackers/glx/xlib/glx_api.c:1211
   No locals.

Acked-by: Brian Paul <brianp@vmware.com>
2014-03-06 17:23:17 +00:00
Brian Paul
84094a273e glapi: remove u_mutex wrapper code, use c99 thread mutexes directly
v2: fix initializer mistake spotted by Chia-I Wu.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:53:06 -07:00
Brian Paul
846a7e8630 glapi: rename u_current dispatch table functions
Put "table" in the names to make things more understandable.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:47:12 -07:00
Brian Paul
280e065707 glapi: replace 'user' with 'context' in u_current.[ch] code
To make the functions more understandable.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2014-03-06 07:47:05 -07:00
Brian Paul
ef8a19ed4f glsl: fix compiler warnings in link_uniforms.cpp
With a non-debug build, gcc has two complaints:
1. 'found' var not used.  Silence with '(void) found;'
2. 'id' not initialized.  It's assigned by the UniformHash->get()
   call, actually.  But init it to zero to silence gcc.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-06 07:45:36 -07:00
Ilia Mirkin
3649800009 mesa/st: only compare the one scissor
sizeof(scissor) returns the size of the full array rather than a single
element. Fix it to consider just the one element.

Fixes: 0705fa35 ("st/mesa: add support for GL_ARB_viewport_array (v0.2)")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-03-05 22:51:58 -05:00
Chia-I Wu
4c68c6dcff st/mesa: make winsys fbo sRGB-capable when supported
The texture formats of winsys fbo are always linear becase the st manager
(st/dri for example) could not know the colorspace used.  But it does not mean
that we cannot make the fbo sRGB-capable.  By

 - setting rb->Visual.sRGBCapable to GL_TRUE when the pipe driver supports the
   format in sRGB colorspace,
 - giving rb an sRGB internal format, and
 - updating code to check rb->Format instead of strb->texture->format,

we should be good.

Fixed bug 75226 for at least llvmpipe and ilo, with no piglit regression.

v2: do not set rb->Visual.sRGBCapable for GLES contexts to avoid surprises

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

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-03-06 10:59:25 +08:00
Chia-I Wu
6d23ca1621 st/mesa: add mappings for MESA_FORMAT_B8G8R8X8_SRGB
The format is mapped to PIPE_FORMAT_B8G8R8X8_SRGB.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-06 10:59:25 +08:00
Chia-I Wu
5a27491a76 mesa: add MESA_FORMAT_B8G8R8X8_SRGB
The format is needed to represent an RGB-only winsys framebuffer that is
sRGB-capable.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-06 10:59:25 +08:00
Brian Paul
48a9094b69 mesa: fix packing/unpacking for MESA_FORMAT_A4R4G4B4_UNORM
Spotted by Chia-I Wu.
v2: also fix unpack_ubyte_ARGB4444_REV()

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-05 16:06:54 -07:00
Eric Anholt
171ec9585f i965: Fix predicated-send-based discards with MRT.
We need the header setup to not be predicated on which pixels are
undiscarded.  I'm not sure originally if I had thought that the mask
disable implied predicate disable, or if I had just misread the mask
disable as predicate disable.  Either way, I know I had spent more time
thinking about this in the gen8 generator than the gen7 generator.

Plus, it turns out that I had mis-implemented the "the GPU will use the
predicate unless this header is present" comment, by skipping setting up
the pixel mask when the header was present.

Fixes GPU hangs in piglit glsl-fs-discard-mrt, Trine, Trine 2 and
preusmably MLL.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75207
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-05 13:37:33 -08:00
Eric Anholt
9856d658ce configure: Fix bashism.
/bin/sh defaults to dash on debian.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-05 13:37:33 -08:00
Andreas Boll
c1958911f1 docs: update 10.2 release notes 2014-03-05 22:20:48 +01:00
Brian Paul
02cb04c68f mesa: remove remaining uses of _glthread_GetID()
It was really only used in the radeon driver for a debug printf.
And evidently, libGL.so referenced it just to work around some sort
of linker issue.

This patch removes the two calls to the function and the function
itself.

Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'.
Though, the missing symbol doesn't cause any issues on my system but
it does cause glxinfo to fail on one of our test systems.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-03-05 11:05:48 -07:00
Brian Paul
0b0114cc3b mesa: new init_teximage_fields_ms() function to init MS texture images
Before, it was kind of ugly to set the multisample fields with
assignments after we called _mesa_init_teximage_fields().

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-03-05 11:05:47 -07:00
Rob Clark
4de1e5eddc WIP: freedreno/a3xx: incorrect scissor for binning pass
If scissor optimization is used (to avoid bringing scissored portions of
the render target into GMEM and then back out to system memory) in
combination with hw binning pass, the result would be a scissor mismatch
between binning pass and rendering pass.  This would cause rendering
bugs in some scenarios with (for example) gnome-shell.

I would have expected that simply using the correct screen-scissor
during the binning pass would be enough, but seems like there is
something else missing.  So for now disable binning pass if scissor
optimization is used.
2014-03-05 12:37:21 -05:00
Topi Pohjolainen
12d55d5f19 i965: Mark invariants in backend_visitor as constants
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:31:57 +02:00
Topi Pohjolainen
a290cd039c i965: Merge resolving of shader program source
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:31:44 +02:00
Topi Pohjolainen
81494ec613 i965: Merge initialisation of backend_visitor
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:20:21 +02:00
Topi Pohjolainen
afed5354aa i965/wm: Use resolved miptree consistently in surface setup
Most of the logic refers to the local variable 'mt' directly but
a few cases use 'intelObj->mt' instead. These are the same for
now but will be different once stencil miptree gets used.

v2 (Ian): fixed also indentation in surrounding lines

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:19:19 +02:00
Topi Pohjolainen
9b169a1893 i965/vec4: Mark invariant members as constants in vec4_visitor
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:13:57 +02:00
Topi Pohjolainen
8a9b4ade03 i965: Mark sources for offset getters as constants
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-03-05 10:13:05 +02:00
Ian Romanick
8f049dc298 docs: Import 10.1 release notes, add news item.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-05 09:32:26 +02:00
Ilia Mirkin
c74783abfa nv50,nvc0: add 11f_11f_10f vertex support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-03-04 21:54:54 -05:00
Kenneth Graunke
dfa1ab0e52 i965: Implement ARB_stencil_texturing on Gen8+.
On earlier hardware, we had to implement math in the shader to translate
Y-tiled or untiled coordinates to W-tiled coordinates (which is what
BLORP does today in order to texture from stencil buffers).

On Broadwell, we can simply state that it's W-tiled in SURFACE_STATE,
and adjust the pitch.  This is much easier.

In the surface state code, I chose to handle the "should we sample depth
or stencil?" question separately from the setup for sampling from
stencil.  This should make it work with the BindRenderbufferTexImage
hook as well, and hopefully be reusable for GL_ARB_texture_stencil8
someday.

v2: Update docs/GL3.txt (caught by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-04 17:23:03 -08:00
Kenneth Graunke
23e81b93bb mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3).
While the GL_ARB_stencil_texturing extension does not allow the creation
of stencil textures, it does allow shaders to sample stencil values
stored in packed depth/stencil textures.

Specifically, applications can call glTexParameter* with a pname of
GL_DEPTH_STENCIL_TEXTURE_MODE and value of either GL_DEPTH_COMPONENT or
GL_STENCIL_INDEX to select which component they wish to sample.  The
default value is GL_DEPTH_COMPONENT (for traditional depth sampling).

Shaders should use an unsigned integer sampler (presumably usampler2D)
to access stencil data.  Otherwise, results are undefined.  Using shadow
samplers with GL_STENCIL_INDEX selected also is undefined behavior.

This patch creates a new gl_texture_object field, StencilSampling, to
indicate that stencil should be sampled rather than depth.  (I chose to
use a boolean since I figured it would be more convenient for drivers.)
It also introduces the [Get]TexParameter code to get and set the value,
and of course the extension plumbing.

v2: Also consider textures incomplete when sampling stencil with
    non-NEAREST min/mag filters (caught by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-04 17:21:06 -08:00
Dieter Nützel
5f23a2d9c2 radeon/uvd: fix typo in documentation
s/grap/grab/

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 17:54:07 -05:00
Eric Anholt
b959fd9674 dri: Require libudev-dev for building DRI on Linux.
The loader infrastructure for everything but DRI2 requires that udev be
present, so we can figure out an appropriate driver from the fd.  We don't
have a portable solution yet, but presumably it will have similar lookup
based on the device node.

It will also be even more required for krh's udev-based hwdb support,
which lets us have a loader that actually loads DRI drivers not included
in the loader's source distribution.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75212
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-04 14:32:52 -08:00
Tom Stellard
262e15fdd4 clover: Use correct LLVM version in #if for DataLayout construction
Spotted by Michel Dänzer.
2014-03-04 16:22:09 -05:00
Zack Rusin
1dd84357ec translate: fix buffer overflows
Because in draw we always inject position at slot 0 whenever
fragment shader would take the maximum number of inputs (32) it
meant that we had PIPE_MAX_ATTRIBS + 1 slots to translate, which
meant that we were crashing with fragment shaders that took
the maximum number of attributes as inputs. The actual max number
of attributes we need to translate thus is PIPE_MAX_ATTRIBS + 1.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-03-04 15:56:04 -05:00
Zack Rusin
08f174daa4 draw/llvm: fix generation of the VS with GS present
draw_current_shader_* functions return a final output when considering
both the geometry shader and the vertex shader. But when code generating
vertex shader we can not be using output slots from the geometry shader
because, obviously, those can be completely different. This fixes a
number of very non-obvious crashes.
A side-effect of this bug was that sometimes the vertex shading code
could save some random outputs as position/clip when the geometry
shader was writing them and vertex shader had different outputs at
those slots (sometimes writing garbage and sometimes something correct).

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-03-04 15:37:52 -05:00
Anuj Phogat
079bff5a99 mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in glTexImage{123}D()
From OpenGL 3.3 spec, page 141:
   "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL
    require either depth component data or depth/stencil component data.
    Textures with other base internal formats require RGBA component data.
    The error INVALID_OPERATION is generated if one of the base internal
    format and format is DEPTH_COMPONENT or DEPTH_STENCIL, and the other
    is neither of these values."

Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 11:23:04 -08:00
Anuj Phogat
0f6f92e284 mesa: Use clear_teximage_fields() in place of _mesa_init_teximage_fields()
This patch makes no functional changes to the code.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 11:22:58 -08:00
Anuj Phogat
063980151e mesa: Set initial internal format of a texture to GL_RGBA
From OpenGL 4.0 spec, page 398:
   "The initial internal format of a texel array is RGBA
    instead of 1. TEXTURE_COMPONENTS is deprecated; always
    use TEXTURE_INTERNAL_FORMAT."

Fixes Khronos OpenGL CTS test failure: proxy_textures_invalid_size

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 11:22:39 -08:00
Vinson Lee
f2d724c686 scons: Build with C++11 with LLVM >= 3.5.
Starting with llvm-3.5svn r202574, LLVM expects C+11 mode.

commit f8bc17fadc8f170c1126328d203f0dab78960137
Author: Chandler Carruth <chandlerc@gmail.com>
Date:   Sat Mar 1 06:31:00 2014 +0000

    [C++11] Turn off compiler-based detection of R-value references, relying
    on the fact that we now build in C++11 mode with modern compilers. This
    should flush out any issues. If the build bots are happy with this, I'll
    GC all the code for coping without R-value references.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202574 91177308-0d34-0410-b5e6-96231b3b80d8

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-03-04 10:12:20 -08:00
Brian Paul
cbacee207f st/osmesa: check buffer size when searching for buffers
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75543
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-04 08:49:15 -07:00
José Fonseca
3d7c8836a6 configure: s/--with-llvm-shared-libs/--enable-llvm-shared-libs/
`--enable-llvm-shared-libs` option was recently renamed as
`--with-llvm-shared-libs`, but several error messages still mention the
old option, causing confusing.

Trivial.
2014-03-04 14:09:37 +00:00
José Fonseca
a61d859519 c11/threads: Don't implement thrd_current on Windows.
GetCurrentThread() returns a pseudo-handle (a constant which only makes
sense when used within the calling thread) and not a real handle.

DuplicateHandle() will return a real handle, but it will create a new
handle every time we call.  Calling DuplicateHandle() here means we will
leak handles, which can cause serious problems.

In short, the Windows implementation of thrd_t needs a thorough make
over, and it won't be pretty.  It looks like C11 committee
over-simplified things: it would be much better to have seperate objects
for threads and thread IDs like C++11 does.

For now, just comment out the thrd_current() implementation, so we get
build errors if anybody tries to use it.

Thanks to Brian Paul for spotting and diagnosing this problem.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 12:05:23 +00:00
José Fonseca
e8d85034da mapi/u_thread: Use GetCurrentThreadId
u_thread_self() expects thrd_current() to return a unique numeric ID
for the current thread, but this is not feasible on Windows.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-03-04 12:05:23 +00:00
José Fonseca
f34d75d6f6 c11/threads: Fix nano to milisecond conversion.
Per https://gist.github.com/yohhoy/2223710/#comment-710118

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
2014-03-04 12:05:23 +00:00
Marek Olšák
1337da5115 r600g: implement edge flags
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 12:26:16 +01:00
Marek Olšák
ac35ded473 r600g: port color buffer format conversion from radeonsi
r600_translate_colorformat is rewritten to look like radeonsi.
r600_translate_colorswap is shared with radeonsi.
r600_colorformat_endian_swap is consolidated.

This adds some formats which were missing. Future "plain" formats will
automatically be supported.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 12:26:16 +01:00
Marek Olšák
dff3eccd15 radeonsi: move translate_colorswap to common code
Also translate the Y__X swizzle.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-04 12:26:16 +01:00
Emil Velikov
1a568e0f2b Revert "configure: use enable_dri_glx local variable"
This reverts commit dfe8cb48fc.

Accidently pushed this commit, over 1bb23abe065(configure: disable
shared glapi when building xlib powered glx).
2014-03-04 02:13:48 +00:00
Emil Velikov
1bb23abe06 configure: disable shared glapi when building xlib powered glx
With commit 0432aa064b(configure: use shared-glapi when more than one
gl* API is used) we removed "disable shared-glapi when building without
dri" hunk.

In the good old days of classic mesa, dri and xlib-glx were mutually
exclusive thus the hunk made sense.

Currently enable-dri is used as a synonym for a range of things thus
it's more appropriate to handle xlib-glx explicitly.

Fixes a missing symbol '_glapi_Dispatch' in a xlib powered libGL,
build using the following

 ./autogen.sh --enable-xlib-glx --disable-dri --with-gallium-drivers=swrast

Cc: Brian Paul <brianp@vmware.com>
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-03-04 02:13:14 +00:00
Brian Paul
1e3bdb35a6 mesa: remove unneeded glthread.c file
The _glthread_GetID() function is also defined in mapi_glapi.c

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:09:00 -07:00
Brian Paul
db806cacfd mesa: remove empty glthread.h file
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
94dc91d7ec mesa: remove unused glthread/TSD macros
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
bc76e9f28d xlib: remove unneeded context tracking code
This removes the only use of _glthread_Get/SetTSD(), etc.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
c00b250c80 xlib: simplify context handling
Get rid of the fake_glx_context struct.  Now, an XMesaContext is the
same as a GLXContext.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
9b8e267976 xlib: remove unused realglx.[ch] files
At one point in time, the xlib driver could call the real GLX functions.
But that's long dead.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
afbc9b3537 mesa: remove unused _glthread_*MUTEX() macros
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:59 -07:00
Brian Paul
f19000550d glsl: switch to c11 mutex functions
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:58 -07:00
Brian Paul
d129ea7fa2 mesa: switch to c11 mutex functions
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:58 -07:00
Brian Paul
2706db701d xlib: switch to c11 mutex functions
The _glthread_LOCK/UNLOCK_MUTEX() macros are just wrappers around
the c11 mutex functions.  Let's start getting rid of those wrappers.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-03-03 13:08:58 -07:00
Brian Paul
657436da7e mesa: update packed format layout comments
Update the comments for the packed formats to accurately reflect the
layout of the bits in the pixel.  For example, for the packed format
MESA_FORMAT_R8G8B8A8, R is in the least significant position while A
is in the most-significant position of the 32-bit word.

v2: also fix MESA_FORMAT_A1B5G5R5_UNORM, per Roland.
2014-03-03 13:08:58 -07:00
Hans
837da9bdae mesa: don't define c99 math functions for MSVC >= 1800
Signed-off-by: Brian Paul <brianp@vmware.com>
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-03 11:56:33 -07:00
Hans
bf25660325 util: don't define isfinite(), isnan() for MSVC >= 1800
Signed-off-by: Brian Paul <brianp@vmware.com>
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
2014-03-03 11:56:30 -07:00
Brian Paul
aff7c5e78a mesa: don't call ctx->Driver.ClearBufferSubData() if size==0
Fixes failed assertion when trying to map zero-length region.

https://bugs.freedesktop.org/show_bug.cgi?id=75660
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-03-03 10:41:42 -07:00
Brian Paul
465b2c42bc softpipe: use 64-bit arithmetic in softpipe_resource_layout()
To avoid 32-bit integer overflow for large textures.  Note: we're
already doing this in llvmpipe.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-03-03 10:41:42 -07:00
Grigori Goronzy
070036ca39 NV_vdpau_interop: fix IsSurfaceNV return type
The spec incorrectly used void as return type, when it should have
been GLboolean. This has now been fixed. According to Nvidia, their
implementation always used GLboolean.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-03 18:37:59 +01:00
Grigori Goronzy
86c06871a2 st/vdpau: fix possible NULL dereference
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-03-03 18:37:35 +01:00
Christian König
bd6654aa38 st/omx: always advertise all components
omx_component_library_Setup should return all entrypoints the library
implements, independent of what is available on the current hardware.

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

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2014-03-03 18:22:38 +01:00
Bruno Jiménez
79c83837c9 clover: Fix building with latest llvm
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-03 17:16:58 +01:00
Bruno Jiménez
089d0660c7 configure: Remove more flags from llvm-config
This way, we are left with only the preprocessor flags and '-std=X'

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-03-03 17:16:52 +01:00
Fabio Pedretti
8a8dd86edc configure.ac: consolidate dependencies version check
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-03 16:45:16 +01:00
Julien Cristau
6f0e2731e8 glx/dri2: fix build failure on HURD
Patch from Debian package.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-03 16:44:44 +01:00
Dave Airlie
15b4ff3f4e st/dri: add support for dma-buf importer (DRIimage v8)
This is just a simple implementation that stores the extra values into the DRIimage
struct and just uses the fd importer. I haven't looked into what is required
to import YUV or deal with the extra parameters.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-03 11:14:38 +10:00
Dave Airlie
3fd081d1a5 st/dri: move fourcc->format conversion to a common place
Before I cut-n-paste this a 3rd time lets consolidate it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-03-03 11:14:38 +10:00
Kenneth Graunke
c95ec27a4a mesa: Move MESA_GLSL=dump output to stderr.
i965 recently moved debug printfs to use stderr, including ones which
trigger on MESA_GLSL=dump.  This resulted in scrambled output.

For drivers using ir_to_mesa, print_program was already using stderr,
yet all the code around it was using stdout.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-02 13:37:09 -08:00
Kenneth Graunke
3f37dd913f glsl: Fix broken LRP algebraic optimization.
opt_algebraic was translating lrp(x, 0, a) into add(x, -mul(x, a)).

Unfortunately, this references "x" twice, which is invalid in the IR,
leading to assertion failures in the validator.

Normally, cloning IR solves this.  However, "x" could actually be an
arbitrary expression tree, so copying it could result in huge piles
of wasted computation.  This is why we avoid reusing subexpressions.

Instead, transform it into mul(x, add(1.0, -a)), which is equivalent
but doesn't need two references to "x".

Fixes a regression since d5fa8a9562, which isn't in any stable
branches.  Fixes 18 shaders in shader-db (bastion and yofrankie).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-03-02 13:35:03 -08:00
Rob Clark
ecb71cfa66 freedreno/a3xx/compiler: overflow in trans_endif
The logic to count number of block outputs was out of sync with the
actual array construction.  But to simplify / make things less fragile,
we can just allocate the arrays for worst case size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
e0007f733d freedreno/a3xx/compiler: fix for resolving PHI's
A value may be assigned on only one side of an if/else.  In this case we
can simply substitute a mov.f32f32.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
26530716ab freedreno/lowering: two-sided-color
Add option to generate fragment shader to emulate two sided color.
Additional inputs are added to shader for BCOLOR's (on corresponding to
each COLOR input).  CMP instructions are used to select whether to use
COLOR or BCOLOR.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
8dd70125fc freedreno/a3xx/compiler: add SSG
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
44c8f96b0d freedreno/a3xx: fix gl_PointSize
If vertex writes pointsize, there are a few extra bits we need to turn
on in the cmdstream here and there.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
05a9bda971 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
cb540c21f2 freedreno/a3xx: binning-pass vertex shader variant
Now that we have the infrastructure for shader variants, add support to
generate an optimized shader for hw binning pass (with varyings/outputs
other than position/pointsize removed).  This exposes the possibility
that the shader uses fewer constants than what is bound, so we have to
take care to not emit consts beyond what the shader uses, lest we
provoke the wrath of the HLSQ lockup!

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
664045752f freedreno/a3xx: add support for frag coord/face
Fixes anything that tries to use gl_FrontFacing/gl_FragCoord.  Also,
face support is needed to emulate two sided color.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Rob Clark
76924e3b51 freedreno/a3xx: fix for unused inputs
An unused input might not have a register assigned.  We don't want bogus
regid to result in impossibly high max_reg..

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-02 11:26:35 -05:00
Chris Forbes
befbda56a2 i965: Validate (and resolve) all the bound textures.
BRW_MAX_TEX_UNIT is the static limit on the number of textures we
support per-stage, not in total.

Core's `Unit` array is sized by MAX_COMBINED_TEXTURE_IMAGE_UNITS, which
is significantly larger, and across the various shader stages, up to
ctx->Const.MaxCombinedTextureImageUnits elements of it may be actually
used.

Fixes invisible bad behavior in piglit's max-samplers test (although
this escalated to an assertion failure on HSW with texture_view, since
non-immutable textures only have _Format set by validation.)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-02 21:14:56 +13:00
Chris Forbes
590920f93e i965: Widen sampler key bitfields for 32 samplers
Previously the `high` 16 samplers on Haswell+ would not get sampler
workarounds applied.

Don't bother widening YUV fields, since they're ignored and going away
soon anyway.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-03-02 21:14:18 +13:00
Emil Velikov
fc25956bad dri/i9*5: correctly calculate the amount of system memory
The variable name states megabytes, while we calculate the amount in
kilobytes. Correct this by dividing with the correct amount.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-03-01 08:49:59 -08:00
Ilia Mirkin
f19271c7bf gallium/util: add missing u_math include
This is needed for MIN2/MAX2

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-28 20:00:34 -05:00
Brian Paul
a12d4d0398 mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINT
Fixes glGetTexImage() when converting from MESA_FORMAT_Z32_FLOAT_S8X24_UINT
to GL_UNSIGNED_INT_24_8.  Hit by the piglit
ext_packed_depth_stencil-getteximage test.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-28 17:16:37 -07:00
Siavash Eliasi
2a399d9eae glx/apple: Fixed glx context memory leak in case of failure.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jeremy Huddleston Sequoia: <jeremyhu@apple.com>
2014-02-28 15:57:15 -08:00
Siavash Eliasi
f4416323fc gbm/dri: Fixed buffer object memory leak in case of failure.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-28 15:57:15 -08:00
Siavash Eliasi
0fe8d71667 r300g/tests: Added missing fclose for FILE resource.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-28 15:57:15 -08:00
Ian Romanick
ff2cbf9e0c i915: Allocate the sys_buffer using _mesa_align_malloc
Though it won't matter on Linux, use _mesa_align_free to release it.
Since i965 doesn't have sys_buffer, I overlooked this in the
GL_ARB_map_buffer_alignment work a few months ago.  Fixes i915 (and
presumably i830) regressions in ARB_map_buffer_range tests and the
failure in arb_map_buffer_alignment-sanity_test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74960
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-28 15:05:39 -08:00
Ian Romanick
8ba157006f i915: Only allow 8 vertex texture units
There's no reason to have more vertex texture units than fragment
texture units on this hardware.  Since increasing the default maximum
number of texture units from 16 to 32, this has triggered some segfault
in i915 driver.  There's probably some array or bitfield that isn't
properly sized now.  This really papers over the bug, but I don't think
I'll lose any sleep over that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74071
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-28 15:05:38 -08:00
Petri Latvala
59989a4a92 i965: Assert array index on access to vec4_visitor's arrays.
v2: vec4_visitor::pack_uniform_registers(): Use correct comparison in the
  assert, this->uniforms is already adjusted. Compare the actual value used to
  index uniform_size and uniform_vector_size instead.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 15:05:38 -08:00
Petri Latvala
7189fce237 i965: Allocate vec4_visitor's uniform_size and uniform_vector_size arrays dynamically.
v2: Don't add function parameters, pass the required size in
prog_data->nr_params.

v3:
- Use the name uniform_array_size instead of uniform_param_count.
- Round up when dividing param_count by 4.
- Use MAX2() instead of taking the maximum by hand.
- Don't crash if prog_data passed to vec4_visitor constructor is NULL

v4: Rebase for current master

v5 (idr): Trivial whitespace change.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71254
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 15:05:38 -08:00
Marek Chalupa
96f324e229 gbm: export gbm_device_is_format_supported
Probably depending on compiler settings, the definition can be hidden,
so undefined reference error can be encountred during linking.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75528
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:57:30 +00:00
Emil Velikov
dfe8cb48fc configure: use enable_dri_glx local variable
GLX can be either dri or xlib based, while enable_dri is
used in a variety of contexts.

With enable_dri_glx the context is clearly visible.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:56:33 +00:00
Emil Velikov
4687b0a1a7 configure: enable the drm pipe-loader for non swrast drivers
All hardware drivers including the virtual vmwgfx require
the drm pipe-loader in order to be properly loaded by xa,
gbm and opencl.

Note this does _not_ add support for the above three it only
allows the pipe driver to be loaded by the library.

Eg. GBM will now properly open the pipe-i915 driver, should
one be working on the such hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75453
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:48:38 +00:00
Emil Velikov
e283e96666 configure: error out when building xa only with swrast
Building to provide accelration using swrast does not make
sense.

Note: update your build script to explicitly mention svga
in the gallium drivers list, if you are building the vmwgfx
xa library.

v2: Update error message to provide more clarify, add an example.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:47:56 +00:00
Emil Velikov
2e830bba21 configure: avoid setting variables as empty strings
Recent patch converted our logic to use test -n and test -z.
An emptry string variable (empty_str="") return true for both
thus making the check unreliable.

Fix this by correctly setting the variable when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:34:50 +00:00
Emil Velikov
f42333b6b6 configure: avoid constantly building megadrivers 'core'
The issue is caused by a thinko that an empty string will be
considered of zero length by 'test'. This is not the case,
thus we were building the 'core' of megadrivers even when no
classic drivers were built.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-28 22:34:50 +00:00
Tom Stellard
f61e382f0a r600g/compute: PIPE_CAP_COMPUTE should be false for pre-evergreen GPUs
This prevents clover from using unsupported devices.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

CC: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 16:17:34 -05:00
Matt Turner
4bd7f1d044 glsl: Don't vectorize horizontal expressions.
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75224
2014-02-28 10:37:52 -08:00
Matt Turner
5eff8576ba glsl: Add is_horizontal() method to ir_expression.
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 10:37:46 -08:00
Matt Turner
d5fa8a9562 glsl: Optimize lrp(x, 0, a) into x - (x * a).
Helps one program in shader-db:

instructions in affected programs:     96 -> 92 (-4.17%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 10:36:12 -08:00
Matt Turner
ecc6c3d4ab glsl: Optimize lrp(0, y, a) into y * a.
Helps two programs in shader-db:

instructions in affected programs:     254 -> 234 (-7.87%)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-28 10:36:06 -08:00
Brian Paul
43dee0295e mesa: do depth/stencil format conversion in glGetTexImage
glGetTexImage(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) was just
using memcpy() instead of _mesa_unpack_uint_24_8_depth_stencil_row()
to convert texels from the hardware format to the GL format.

Fixes issue reported by David Meng at Intel.  The new piglit
ext_packed_depth_stencil-getteximage test checks for this bug.

Also, add some format/type assertions.  We don't yet handle the
GL_FLOAT_32_UNSIGNED_INT_24_8_REV type.  That should be fixed in
a follow-on patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 07:02:55 -07:00
Brian Paul
84787aae95 mesa: fix depth/stencil comments in formats.h 2014-02-28 07:02:36 -07:00
Thomas Hellstrom
f5e681f3fa winsys/svga: Avoid calling drm getparam for max surface size on older kernels
This avoids the kernel driver spewing out errors about the param not being
supported.

Also correct the max surface size used when the kernel does not support the
query.

Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-28 11:11:21 +01:00
Kenneth Graunke
085f61bd4e meta: Drop ctx->API checks.
API is always API_OPENGL_COMPAT (since commit 4e4a537ad5,
"meta: Push into desktop GL mode when doing meta operations."),
so most of these checks do nothing.

We could instead check save->API to only bother setting/restoring
relevant GL state, but I'm not sure saving a few _mesa_set_enable
calls is worth the complexity.  My understanding is the point of
the ctx->API guards was to avoid raising GL errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-27 10:07:40 -08:00
Kenneth Graunke
cf719a0204 meta: Restore API at the end of _mesa_meta_end(), not the start.
In _mesa_meta_begin(), we switch to API_OPENGL_COMPAT, then munge a lot
of state (including some that doesn't exist in the actual API - like
PolygonStipple in API_OPENGL_CORE).

It seems reasonable that in _mesa_meta_end(), we should restore it,
then switch back to the original API.  This at least makes it symmetric.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-27 10:07:40 -08:00
Roland Scheidegger
612a1d5be1 util/u_format: don't crash in util_format_translate if we can't do translation
Some formats can't be handled - in particular cannot handle ints/uints formats,
which lack the pack_rgba_float/unpack_rgba_float functions. Instead of trying
to call these (and crash) return an error (I'm not sure yet if we should try
to translate such formats too here might not make much sense).

v2: suggested by Jose, use separate checks for pack/unpack of rgba_8unorm and
rgba_float functions (right now if one exists the other should as well).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-27 17:56:10 +01:00
Kenneth Graunke
80c1b9349c i965: Convert VUE map generation checks to if rather than switch.
There are currently only two VUE map layouts: one for Gen4-5, and one
for everything else.  We keep having to add new "case N+1" labels for
every new hardware generation, and so far it's always been the same.

This patch makes it so we only have to do work in the case where
something actually changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-27 00:05:55 -08:00
Kenneth Graunke
9b1a6745f6 i965: Only emit VS state pipe control workaround on IVB and BYT.
According to the BSpec's 3D workarounds page, this is unnecessary on
shipping Haswell hardware, and was never necessary on Broadwell.  It
unfortunately doesn't say anything about Baytrail.

The workaround database confirms those results for Ivybridge, Haswell,
and Broadwell.  Baytrail is less clear - one page says it's necessary,
while the other says it isn't.  For now, be conservative and leave it
enabled.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-27 00:05:48 -08:00
Ilia Mirkin
51fc093421 nouveau: add a nouveau_compiler binary to compile TGSI into shader ISA
This makes it easy to compare output between different cards, especially
for ones that you don't have (and/or not in the current machine).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:48 -05:00
Ilia Mirkin
dd370f0af6 nv30: remove nv30_context use from nvfx_*prog
This should pave the way to being able to use the compiler without a
context. Also leads to cleaner code.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:47 -05:00
Ilia Mirkin
41dbc4c444 nv30: remove unused sprite flipping parameter
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:47 -05:00
Ilia Mirkin
fe2738f998 nv30: remove unused render_mode and hw_pointsprite_control
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:46 -05:00
Ilia Mirkin
8f23d08928 nv30: remove use_nv4x, it is identical to is_nv4x
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-26 23:35:45 -05:00
Ilia Mirkin
734fe2d246 docs: update nvc0 state
ARB_texture_buffer_object_rgb32 has been supported for a while already.
2014-02-26 23:35:45 -05:00
Michel Daenzer
59936a49dd radeonsi: Prevent geometry shader from emitting too many vertices 2014-02-27 10:27:55 +09:00
Anuj Phogat
b3094d9927 i965: Fix the region's pitch condition to use blitter
intelEmitCopyBlit uses a signed 16-bit integer to represent
buffer pitch, so it can only handle buffer pitches < 32k.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 13:43:00 -08:00
Brian Paul
863a1f7757 glsl: add switch case for MESA_SHADER_COMPUTE
To fix warning about unhandled enum value.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-26 13:29:16 -07:00
Kenneth Graunke
fe8f3bef31 meta: Use a #define for the vector type to avoid %svec4 everywhere.
By adding "#define gvec4 %svec4" to the top of our fragment shader, we
can write generic code without needing to specialize it to vec4, ivec4,
or uvec4 via asprintf.

This also makes the INT and UNSIGNED_INT merge function code identical,
so I combined those two cases.

It's not a big savings, but a little bit tidier.

v2: Rebase on Vinson's MSVC build fixes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-26 02:33:58 -08:00
Kenneth Graunke
f896e82301 i965: Don't try to dump shader source for fixed-function FS programs.
sh->Source is NULL and this will segfault.

Fixes MESA_GLSL=dump with "The Swapper".

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:31:24 -08:00
Kenneth Graunke
b18871c863 i965: Don't forget to subtract mt->first_level in minify calls.
This fixes fbo-clear-formats GL_ARB_depth_texture on Ironlake, which
regressed since commit f128bcc7c2
("i965: Drop mt->levels[].width/height.")  intel_miptree_copy_slice was
calling minify(.., 7) on a 2x2 texture with mt->first_level == 7.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75292
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:29:44 -08:00
Kenneth Graunke
ac0a8b9540 glsl: Delete LRP_TO_ARITH lowering pass flag.
Tt's kind of a trap---calling do_common_optimization() after
lower_instructions() may cause opt_algebraic() to reintroduce
ir_triop_lrp expressions that were lowered, effectively defeating the
point.  Because of this, nobody uses it.

v2: Delete more code (caught by Ian Romanick).

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:56 -08:00
Kenneth Graunke
2fdea48e21 i965: Stop lowering ir_triop_lrp.
Both the vector and scalar backends now support it natively, so there's
no point in lowering it.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:55 -08:00
Kenneth Graunke
56879a7ac4 i965/vec4: Handle ir_triop_lrp on Gen4-5 as well.
When the vec4 backend encountered an ir_triop_lrp, it always emitted an
actual LRP instruction, which only exists on Gen6+.  Gen4-5 used
lower_instructions() to decompose ir_triop_lrp at the IR level.

Since commit 8d37e9915a ("glsl: Optimize open-coded lrp into lrp."),
we've had an bug where lower_instructions translates ir_triop_lrp into
arithmetic, but opt_algebraic reassembles it back into a lrp.

To avoid this ordering concern, just handle ir_triop_lrp in the backend.
The FS backend already does this, so we may as well do likewise.

v2: Add a comment reminding us that we could emit better assembly if we
    implemented the infrastructure necessary to support using MAC.
    (Assembly code provided by Eric Anholt).

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75253
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:53 -08:00
Kenneth Graunke
ffde483f3c i965/vec4: Add a brw->gen >= 6 assertion in three-source emitters.
Three source instructions didn't exist until Gen6.  vec4_generator has
assertions to catch this, but catching it in the visitor provides a
nicer backtrace.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2014-02-26 02:16:34 -08:00
Chia-I Wu
bb9c8071ea ilo: create u_upload_mgr last
Similar to u_blitter, u_upload_mgr is now a client of the pipe context.  Its
creation needs to be delayed until the context has been (almost) initialized.
2014-02-26 11:33:37 +08:00
Fredrik Höglund
3616e862f2 glx: Fix the GLXFBConfig attrib sort priorities
The sort priorites for GLX_SAMPLES and GLX_SAMPLE_BUFFERS are
not defined in GL_ARB_multisample, but they are defined in
the GLX 1.4 specification.

Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 02:17:12 +01:00
Fredrik Höglund
f41c2f6c33 glx: Fix the default values for GLXFBConfig attributes
The default values for GLX_DRAWABLE_TYPE and GLX_RENDER_TYPE are
GLX_WINDOW_BIT and GLX_RGBA_BIT respectively, as specified in
the GLX 1.4 specification.

This fixes the glx-choosefbconfig-defaults piglit test.

Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-26 02:16:42 +01:00
Tom Stellard
54df6a0491 Re-commit 'clover: Fix build with LLVM 3.5'
This was accidentally reverted in 9dfd7c5f75
2014-02-25 14:43:26 -08:00
Vinson Lee
f094866d93 mesa: Add GL_ARB_buffer_storage to dispatch_sanity.cpp.
Fixes 'make check' failure introduced with commit
119ffa7307.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75503
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-25 14:00:08 -08:00
Timothy Arceri
9dfd7c5f75 Revert "Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa"
This reverts commit 1b79582f32, reversing
changes made to 376a98d345.
2014-02-26 08:46:08 +11:00
Timothy Arceri
1b79582f32 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa
ry,
2014-02-26 08:39:32 +11:00
Tom Stellard
fcd499730b clover: Fix build with LLVM 3.5 2014-02-25 13:32:37 -08:00
Timothy Arceri
376a98d345 glsl: removed unused dimension_count varible
This variable is no longer needed after the cleanup to the
code prior to the first arrays of array series

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-26 08:31:25 +11:00
Ilia Mirkin
d9b983519c build: llvm libs may not be in system search path, add rpath
On my gentoo system, llvm libs are in /usr/lib64/llvm, and llvm-config
--ldflags does not provide the rpath (it does, of course, provide a -L).
This adds the llvm dir to the rpath. It should be harmless if the path
is a system path, and should make things work when it's not.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-25 15:30:13 -05:00
Eric Anholt
42c2366de5 i965: Fix segfaults since the buffer_storage changes. 2014-02-25 12:19:15 -08:00
Ilia Mirkin
6417cabd9c docs: update nv50 support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 14:42:35 -05:00
Ilia Mirkin
d1b1329c3a nv50: enable txg where supported
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 14:42:34 -05:00
Ilia Mirkin
0e71c65db0 nv50: enable cube map array texture support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 14:42:34 -05:00
Brian Paul
5a3dc449a9 libgl-xlib: add -Isrc/gallium/winsys flag
So that sw/xlib/xlib_sw_winsys.h can be found.  Fixes a build break.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-25 12:35:07 -07:00
Brian Paul
c88a0b6af3 st/mesa: add comment to explain _min(), _maxf(), etc. functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-25 12:35:07 -07:00
Marek Olšák
9855477e90 r600g,radeonsi: consolidate create_surface and surface_destroy
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:26 +01:00
Marek Olšák
b9aa8ed009 radeonsi: inline util_blitter_copy_texture
This will be used for changing texture properties without modifying
pipe_resource like r600g, but not in this series. For now, this change
allows consolidation of pipe_surface functions.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:22 +01:00
Marek Olšák
f7176d700f radeonsi: remove useless psbox variable from resource_copy_region
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:20 +01:00
Marek Olšák
80eb377a37 radeonsi: compute depth surface registers only once
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:18 +01:00
Marek Olšák
629b019a40 radeonsi: compute color surface registers only once
Same as r600g.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:17 +01:00
Marek Olšák
6b4e03216a r600g: remove r600_resource.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:15 +01:00
Marek Olšák
ec266d06d0 r600g: remove r600_surface::htile_enabled
v2: use one of the htile registers instead

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:12 +01:00
Marek Olšák
7fc6ece40e r600g: use r600_surface::db_z_info
db_z_info was unused. This just renames the variable to match the register
name.

Now, db_depth_info is unused on Evergreen.
Both variables will be needed on SI though.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:10 +01:00
Marek Olšák
40b9812a76 r600g,radeonsi: share r600_surface
I'm gonna use this in radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:08 +01:00
Marek Olšák
933eaeee25 radeonsi: move PA_SU_POLY_OFFSET_DB_FMT_CNTL to framebuffer state
It doesn't depend on anything else.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-25 16:08:05 +01:00
Marek Olšák
dca350201e mesa: allow buffers to be mapped multiple times
OpenGL allows a buffer to be mapped only once, but we also map buffers
internally, e.g. in the software primitive restart fallback, for PBOs,
vbo_get_minmax_index, etc. This has always been a problem, but it will
be a bigger problem with persistent buffer mappings, which will prevent
all Mesa functions from mapping buffers for internal purposes.

This adds a driver interface to core Mesa which supports multiple buffer
mappings and allows 2 mappings: one for the GL user and one for Mesa.

Note that Gallium supports an unlimited number of buffer and texture
mappings, so it's not really an issue for Gallium.

v2: fix unmapping in xm_dd.c, remove the GL errors there
v3: fix the intel driver (by Fredrik)

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
86e68b0f1f docs: update ARB_buffer_storage status
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
04fb4bf61b gallium/upload_mgr: remove useless variable "size"
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
7ea3f6bce5 gallium/upload_mgr: don't unmap buffers if persistent mappings are supported
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
db8886ed09 gallium: the other drivers don't support ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:07:33 +01:00
Marek Olšák
6381dd7e9d r300g,r600g,radeonsi: add support for ARB_buffer_storage
All GTT memory mappings are coherent and therefore can be persistent.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:05:41 +01:00
Marek Olšák
dfa0b8d9b8 st/mesa: implement ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:05:41 +01:00
Marek Olšák
5f61f052b5 gallium: add interface for persistent and coherent buffer mappings
Required for ARB_buffer_storage.
2014-02-25 16:05:41 +01:00
Marek Olšák
d26a065b74 mesa: allow buffers mapped with the persistent flag to be used by the GPU
v2: also fixed InvalidateBufferData, added citations from the 4.4 spec

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
4f78e17f6d mesa: add error checks to glMapBufferRange, glMapBuffer for ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
119ffa7307 glapi: add ARB_buffer_storage
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
e592f11227 mesa: implement glBufferStorage, immutable buffers; add extension enable flag
Reviewed-by: Fredrik Höglund <fredrik@kde.org>

v2: dropped the error that DYNAMIC_STORAGE is required for MAP_WRITE_BIT,
    the error is removed in the latest revision of GL 4.4
2014-02-25 16:04:22 +01:00
Marek Olšák
7e548d0507 mesa: add storage flags parameter to Driver.BufferData
It will be used by glBufferStorage. The parameters are chosen according
to ARB_buffer_storage.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:22 +01:00
Marek Olšák
aea4933287 mesa: remove unused driver hook BindBuffer
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
2014-02-25 16:04:21 +01:00
Emil Velikov
882070cc81 nv50: correctly calculate the number of vertical blocks during transfer map
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-25 12:19:07 +00:00
Dave Airlie
7c3138acb9 st/mesa: add texture gather support. (v2)
This adds support for GL_ARB_texture_gather, and one step of
support for GL_ARB_gpu_shader5.

This adds support for passing the TG4 instruction, along
with non-constant texture offsets, and tracking them for the
optimisation passes.

This doesn't support native textureGatherOffsets hw, to do that
you'd need to add a CAP and if set disable the lowering pass,
and bump the MAX offsets to 4, then do the i0,j0 sampling using
those.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-25 13:29:37 +10:00
Dave Airlie
2fcbec48d7 gallium: add texture gather support to gallium (v3)
This adds support to gallium for a TG4 instruction,
and two CAPs. The first CAP is required for GL_ARB_texture_gather.

The second CAP is required to expose GL_ARB_gpu_shader5.

However so far we haven't found any hardware that natively
exposes the textureGatherOffsets feature from GL, so just
lower it for now. If hardware appears for this we can add
another CAP to allow TG4 to take 4 offsets.

v2: add component selection src and a cap to say
hw can do it. (st can use to help control
GL_ARB_gpu_shader5/GLSL 4.00). Add docs.

v3: rename to SM5, add docs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-25 13:29:17 +10:00
Dave Airlie
122c3b9486 glsl/i965: move lower_offset_array up to GLSL compiler level.
This lowering pass will be useful for gallium drivers as well, in order to support
the GL TG4 oddity that is textureGatherOffsets.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-25 13:28:57 +10:00
Tom Stellard
945d87f958 clover: Pass buffer offsets to the driver in set_global_binding() v3
The offsets will be stored in the handles parameter.  This makes
it possible to use sub-buffers.

v2:
  - Style fixes
  - Add support for constant sub-buffers
  - Store handles in device byte order

v3:
  - Use endian helpers

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-24 12:56:27 -08:00
Tom Stellard
eac7236042 radeonsi: Use SI_BIG_ENDIAN now that it exists
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
8f3bcedde2 r600g: Use util_cpu_to_le32() instead of bswap32() on big-endian systems
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
195ee10673 radeonsi: Use util_cpu_to_le32() instead of bswap32() on big-endian systems
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
9f30685fae util: Add util_cpu_to_le* helpers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-24 12:56:27 -08:00
Tom Stellard
a9f88e2ae8 util: Add util_bswap64() v3
v2:
  - Use __builtin_bswap64()
  - Remove unnecessary mask
  - Add util_le64_to_cpu() helper

v3:
  - Remove unnecessary AC_SUBST

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-02-24 12:56:27 -08:00
Tom Stellard
f8ba0f55d3 configure.ac: Use AX_GCC_BUILTIN to check availability of __builtin_bswap32 v2
v2:
  - Remove unnecessary AC_SUBST

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-24 12:56:26 -08:00
Emil Velikov
73b46136b0 targets/opencl: resolve undefined symbols at link time
Current automake build does not try to resolve undefined
symbols thus we could end up with a broken library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-24 14:59:39 +00:00
Emil Velikov
1ad9534337 gallium/targets: resolve undefined reference to pipe_loader_sw_probe_dri
With the introduction of the pipe_loader_sw_probe_dri helper we
require the sw/dri winsys during linking stage despite it being
unused by any of the targets. This will cause a minor increase
in the resulting library which will be cleaned up via linker
options with upcoming patches.

v2: Link with libswdri.la only when available.

Reported-and-tested-by: Tom Stellard <thomas.stellard@amd.com> (v1)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:59:34 +00:00
Emil Velikov
61973ffe5b configure: correctly report if we're building the sw/xlib winsys
While looking at bug 75356, I've noticed that the presence of
x11 egl platform pulls in sw/xlib as "needed" but fails to
report so at the end of configure.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:57:41 +00:00
Emil Velikov
3445e8bb92 pipe-loader: wrap pipe_loader_sw_probe_xlib within HAVE_PIPE_LOADER_XLIB
The above function implies using the the xlib winsys, which
has additional library dependencies that should not be forced.

Make the software xlib pipe loader optional thus avoid all
the dependency hell. A user that wishes to use the particular
pipe-loader would need to set the following within configure.ac.

 enable_gallium_xlib_loader=yes

v2:
 - Wrap sw/xlib/xlib_sw_winsys.h to handle compilation on systems
lacking X11 headers. Spotted by Christian Prochaska.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75356
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:52:27 +00:00
Emil Velikov
0e7c30233f targets/gbm: exit gracefully if pipe_loader_drm_probe_fd is not available
When one builds without gallium_drm_loader, the above function will
not be available, thus we'll segfault in gallium_screen_create due
to memory access violation.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75335
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-24 14:51:45 +00:00
Kenneth Graunke
73c78c514f i965: Don't try to use the hardware blitter for multisampled miptrees.
The blitter is completely ignorant of MSAA buffer layouts, so any
attempt to use BLT paths with MSAA buffers is likely to break
spectacularly.

In most cases, BLORP handles MSAA blits, so we never hit this bug.
Until recently, it also wasn't worth fixing, since Meta couldn't handle
MSAA either, so there was nothing to fall back to.  But now there is.

+143 piglit tests on Broadwell (which doesn't have BLORP support).
Surprisingly, three also start failing.  Since non-IMS MSAA buffers
store samples in successive array slices, using the blitter ought to
access sample 0 and ignore the rest, which is apparently good enough for
a few not-very-picky Piglit tests.  Presumably the meta replacement code
is still broken.

No Piglit changes on Ivybridge.

v2: Move the early return to the top of the function (suggested by
    Paul).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-23 20:19:00 -08:00
Rob Clark
3f7239ca0e freedreno/a3xx/compiler: half-precision output
Using generic shaders caused a measurable fps drop, which was isolated to
use of full precision (vs half precision) output.  This is an attempt to
regain that lost performance by using half precision solid/blit shaders
(when the output format is not float32).

Note: for the built-in shaders, I would not expect them to be register
starved.  And in fact it is the solid frag shader that seems to have the
biggest impact.  So I suspect you get double the pixel pipe units (or
half the cycles) when the output is half precision.  So there may be
some gain to using half precision output for application shaders as
well, even though the rest of register usage is still full precision.
But for half precision to work for more complex shaders, we need to deal
with some constraints, like cat2 needing same precision for it's two src
registers.  So for now it is not enabled by default except for the
built-in shaders.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:24 -05:00
Rob Clark
141ae71671 freedreno/a3xx: add shader variants
Start putting in place infrastructure to deal with multiple shader
variants.  Initially we'll use this for two sided color (frag) and
binning pass (vert) shaders.  Possibly need for others later (such
as YUV vs RGB eglImage?).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
9bbfae6265 freedreno/a3xx/compiler: collapse nop's with repeat
Easier than making more extensive use of rpt, and the more compact
shaders seem to bring some bit of performance boost.  (Perhaps repeat
flag benefits are more than just instruction cache, possibly it saves
on instruction decode as well?)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
bb255fdf06 freedreno/a3xx: drop hand-coded blit/solid shaders
Instead in the common code, construct these shaders from TGSI.  For now
we let a2xx keep it's hand coded shaders, as it's compiler isn't quite
up to the job yet.  All the same it is a net drop in code size and gets
rid of special cases.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
1c953b7cda freedreno/lowering: cleanup api
Make things configurable, and tweak the API a bit to avoid an extra
tgsi_shader_scan().  Getting closer to something generic which can be
moved out of freedreno and shaderd by other drivers.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
67cea4b32a freedreno/a3xx: add float 16 and 32bit formats
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Rob Clark
e819885b99 freedreno: resync generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-23 14:58:23 -05:00
Emil Velikov
f92fbba11b glx/drisw: use the implemented version of __DRIswrastLoaderExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
f6537d0608 glx/dri: use the implemented version of __DRIdamageExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
ef342aad80 glx/dri_common: use the implemented version of __DRIsystemTimeExtension
... over the one provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
fbbf5ec471 glx/dri: use the implemented version of __DRIgetDrawableInfoExtension
... over the one provided by the headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
15db8c0801 dri_util: use the implemented version of __DRIimageDriverExtension
... over the one provided by the headers.

Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
e9eb3ec331 glx/dri3: set the implemented version of __DRIimageLoaderExtension
... over the one provided by the spec.
Currently both versions are identical, but that is not
guaranteed to be the case in the future.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
4e229a6e86 gbm: explicitly set __DRIimageLoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:17 +00:00
Emil Velikov
9e627ccc0d egl/wayland: explicitly set __DRIimageLoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov
73b35b913e drivers/dri: explicitly set __DRI2flushExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov
8b45bc0ad5 gbm: explicitly set __DRIdri2LoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>y
2014-02-23 16:42:16 +00:00
Emil Velikov
92273962f5 glx/dri2: set the implemented version of __DRIdri2LoaderExtension
... over the version number provided by the headers.
Explicitly set extension members to improve clarity.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
6dffab2092 dri_interface: note introduction of __DRIdri2LoaderExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
c9fff0740e dri_interface: note introduction of various __DRItexBufferExtension members
Note the member function releaseTexBuffer was added without
bumping spec version, and currently no drivers implement it.

v2: releaseTexBuffer was introduced by version 3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
acf2fae64e dri_interface: Note the version introducing __DRIswrastLoaderExtensionRec::putImage2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:16 +00:00
Emil Velikov
13e5daf2da dri_util: explicitly set __DRIcopySubBufferExtension members
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:15 +00:00
Emil Velikov
01814734e6 dri_util: explicitly set __DRIswrastExtension members.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-23 16:42:15 +00:00
Kenneth Graunke
5e639a5f59 glsl: Pass stdout to _mesa_print_ir from st_glsl_to_tgsi.
Fixes the Gallium build since commit 1e3bd9f9a5.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75389
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-22 22:10:11 -08:00
Eric Anholt
83daa88035 i965: Move the remaining driver debug over to stderr.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
a76e5dce4f i965: Move compiler debugging output to stderr.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
1e3bd9f9a5 glsl: Add a file argument to the IR printer.
While we want to be able to print to stdout for glsl_compiler, for
debugging drivers we want to be able to dump to stderr because that's
where other driver debug (like LIBGL_DEBUG) tends to go, and because some
apps actually close stdout to shut up their own messages (such as the X
Server, or NWN).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
f28c920865 i965: Refactor debug dumping of GLSL IR.
This was only going to get worse when tesselation shows up, and was
causing too much extra duplication in my stderr changes coming up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:21 -08:00
Eric Anholt
9ac9d133ed intel: Remove some dead code I noticed in intel_screen.c.
It was present in the initial i915tex import.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt
fdcf6c8fad i965: Use the object label when available for INTEL_DEBUG=vs,gs,fs output.
Note that this requires updated run.py in shader_db.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt
f474ced0d1 i965: Use the object label when available for shader_time output.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Eric Anholt
0e2c7e2f6e meta: Set some object labels on our meta shaders.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-22 19:23:20 -08:00
Ilia Mirkin
6152ba0894 nv50: make sure to clear _all_ layers of all attachments
Unfortunately there's only one RT_ARRAY_MODE setting for all
attachments, so clears were previously truncated to the minimum number
of layers any attachment had. Instead set the RT_ARRAY_MODE to 512 (the
max number of layers) before doing the clear. This fixes
gl-3.2-layered-rendering-clear-color-mismatched-layer-count.

Also fix clears of individual layered rt/zeta, in case it ever happens.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-22 18:42:31 -05:00
Chia-I Wu
d5cbd73d21 ilo: fix and enable fast depth clear
Use tex->bo_format instead of zs->format in ilo_blitter_rectlist_clear_zs()
because the latter may be combined depth/stencil format.  hiz_can_clear_zs()
is no-op for GEN7+, but move the GEN check so that the assertions are tested.

Finally, call the fast depth clear function from ilo_clear().
2014-02-22 22:45:13 +08:00
Chia-I Wu
f57bddc7e4 ilo: add slice clear value
It is needed for 3DSTATE_CLEAR_PARAMS, and can also be used to track what
value the slice has been cleared to.
2014-02-22 22:45:13 +08:00
Chia-I Wu
4afb8a7fb5 ilo: better readability and doc for texture flags
Improve comments for the flags, and explicitly separate their uses in slice
flags and resolve flags.
2014-02-22 22:45:13 +08:00
Chia-I Wu
cb8a0d2be1 ilo: fix for stencil only rectlist ops
3DSTATE_STENCIL_BUFFER inherits some states from 3DSTATE_DEPTH_BUFFER.  We
need to emit both even the surface is stencil only.
2014-02-22 22:45:13 +08:00
Chia-I Wu
409add30b3 ilo: fix a false assertion failure on GEN6
Layer offsetting is possible when it is level 0, layer 0.
2014-02-22 22:45:12 +08:00
Chia-I Wu
e7307fe708 ilo: pipe_texture::usage is not a bitfield
It happens to work because PIPE_USAGE_STAGING is 0x100.
2014-02-22 22:45:12 +08:00
Chia-I Wu
f8d19a58dc ilo: set ILO_TEXTURE_CPU_WRITE for imported textures
Assume the bo has been written by another process, which will trigger a HiZ
resolve.
2014-02-22 22:45:12 +08:00
Christoph Bumiller
1f4bfb8797 nv50/ir/ra: fix SpillCodeInserter::offsetSlot usage
We were turning non-memory spill slots into NULL.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-22 13:17:23 +01:00
Matt Turner
7770b02693 Revert "i965/fs: Make fs_reg's type an enum for better debugging."
This reverts commit 5ceadd29b0.

I rebased and apparently failed to build test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75355
2014-02-21 23:53:36 -08:00
Kenneth Graunke
760c6777a0 i965/fs: Drop the emit(fs_inst) overload.
Using this emit function implicitly creates three copies, which
is pointlessly inefficient.

1. Code creates the original instruction.
2. Calling emit(fs_inst) copies it into the function.
3. It then allocates a new fs_inst and copies it into that.

The second could be eliminated by changing the signature to

   fs_inst(const fs_inst &)

but that wouldn't eliminate the third.  Making callers heap allocate the
instruction and call emit(fs_inst *) allows us to just use the original
one, with no extra copies, and isn't much more of a burden.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
326fc60ee9 i965/fs: Pass fs_regs by constant reference where possible.
These functions (modulo emit_lrp, necessitating the small fix-up) pass
these arguments by value unmodified to other functions. No point in
making an additional copy.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
070f20272f i965/fs: Move setting opcode = NOP to its one useful location.
All other callers of init() immediately set opcode to something else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
4fbebd6e65 i965/fs: Use a bitfield for fs_inst's bool fields.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
d91035a8f6 i965/fs: Reorder fs_inst's fields for better packing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
109c211ffd i965/fs: Reduce the sizes of some fs_inst members.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
0fc1a77e14 i965/fs: Reorder fs_reg for better packing.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:33 -08:00
Matt Turner
5ceadd29b0 i965/fs: Make fs_reg's type an enum for better debugging.
Since the enum is marked as packed, it'll still take only one byte.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner
3f6baf5755 i965/fs: Reduce the sizes of some fs_reg members.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner
98e2654880 i965: Mark brw_reg_type and register_file enums as PACKED.
The C99 spec says the type of an enum is implementation defined (but can
be char, signed int, or unsigned int). gcc appears to always give enums
four bytes, even when they can fit in less. It does so because this is
what other compilers seem to do [0] and therefore to maintain ABI
compatibility with them.

gcc has an -fshort-enum flag that tells the compiler to use only as much
space as needed for an enum. Adding __attribute__((__packed__)) to an
enum definition has the same behavior, but on a per-enum basis.

brw_reg_type and register_file are not part of the ABI, so we can safely
mark them as PACKED so that they'll take only a byte, rather than four.

[0] http://gcc.gnu.org/onlinedocs/gcc/Non-bugs.html#index-fshort-enums-3868

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Matt Turner
00c567e897 i965: Reduce predicate field of backend_instruction to uint8_t.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 22:51:32 -08:00
Vinson Lee
079773d1cb libgl-xlib: Fix xlib_sw_winsys.h include path.
This patch fixes this SCons build error introduced with commit
4f37e52f37.

  Compiling src/gallium/targets/libgl-xlib/xlib.c ...
src/gallium/targets/libgl-xlib/xlib.c:35:42: fatal error: state_tracker/xlib_sw_winsys.h: No such file or directory
 #include "state_tracker/xlib_sw_winsys.h"
                                          ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75347
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 19:56:17 -08:00
Vinson Lee
24ce678f83 mesa: Move declarations before code.
This patch fixes these MSVC build errors.

  Compiling src\mesa\drivers\common\meta_blit.c ...
meta_blit.c
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(255) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(255) : warning C4552: '<' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(255) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(255) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(258) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(263) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(263) : warning C4552: '<=' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(263) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(263) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before 'type'
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ')' before 'type'
src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(264) : warning C4552: '<' : operator has no effect; expected operator with side-effect
src\mesa\drivers\common\meta_blit.c(264) : error C2059: syntax error : ')'
src\mesa\drivers\common\meta_blit.c(264) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(264) : error C2143: syntax error : missing ';' before '{'
src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(268) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(269) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'step' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(270) : error C2065: 'i' : undeclared identifier
src\mesa\drivers\common\meta_blit.c(559) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data
src\mesa\drivers\common\meta_blit.c(723) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data
src\mesa\drivers\common\meta_blit.c(773) : warning C4244: 'function' : conversion from 'const GLint' to 'GLfloat', possible loss of data

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 19:40:00 -08:00
Emil Velikov
dcbf404c0d pipe-loader: introduce pipe_loader_sw_probe_null helper function
v2: Handle null_sw_create failure, add missing function return type

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-02-22 03:26:29 +00:00
Emil Velikov
969e8d15b7 pipe-loader: introduce pipe_loader_sw_probe_dri helper
Will be used in the following commits.

v2: Link gallium tests against the library.
v3: Handle dri_create_sw_winsys failure
v4: Rebase on top of the targets/xa changes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v2)
2014-02-22 03:26:29 +00:00
Emil Velikov
cc3aeacab6 pipe-loader: introduce pipe_loader_sw_probe_xlib helper
Will be used in the upcoming patches.

v2: handle xlib_create_sw_winsys failure, drop unneeded header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-02-22 03:26:29 +00:00
Emil Velikov
6325fdd6cf pipe-loader: use bool type for pipe_loader_drm_probe_fd()
v2: Rebase on top of the rendernode changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
Reviewed-by: Francisco Jerez <currojerez@riseup.net> (v1)
2014-02-22 03:26:29 +00:00
Emil Velikov
4f37e52f37 winsys/xlib: move xlib_create_sw_winsys within the winsys
v2: Rebase on top of vl_winsys_xsp.c removal
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-02-22 03:26:28 +00:00
Emil Velikov
b4e8572bca pipe-loader: handle memory allocation failure
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-02-22 03:26:28 +00:00
Emil Velikov
1fb750f7f7 pipe-loader: build pipe_loader_drm_x_auth whenever HAVE_PIPE_LOADER_XCB is defined
Currently HAVE_PIPE_LOADER_XCB is defined, rather than being set to 1/0.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-22 03:26:28 +00:00
Emil Velikov
ed092a8e1f pipe-loader: destroy sw_winsys on sw_release
The sw pipe-loader implicitly handles winsys_create, thus we
it would make sense to implicitly destroy it upon releasing
the loader.

Currently we leak the sw_winsys when releasing the pipe-loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-22 03:26:28 +00:00
Emil Velikov
636ac989b2 vl/winsys_dri: cleanup vl_screen_create error path
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-22 03:26:27 +00:00
Emil Velikov
0c9912b266 targets/pipe-loader: link pipe-nouveau against libdrm
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-22 03:26:27 +00:00
Kenneth Graunke
6984a6be5c meta: Eliminate samplers[] array in favor of using vec4_prefix.
We don't need an array mapping the shader index to "sampler2DMS",
"isampler2DMS", and so on.  We can simply do "%ssampler2DMS" and pass in
vec4_prefix, which is "", "i", or "u".

This eliminates the use of C99 array initializers and should fix the
MSVC build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75344
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-21 19:18:07 -08:00
Kenneth Graunke
119aa50929 i965: Delete the fabulous target_to_target() function.
gl_texture_object's Target field is never a cube face enumeration, so
target_to_target is just the identity function.  Aptly named, at least.

I verified this by putting an assert(!"ZOMG, CUBES!") in the cube face
case, and running Piglit.  Nothing ever hit it.  Beyond that, I
inspected the code in mesa/main.

This could probably also be deleted from i915, but I haven't tested
there.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-21 19:17:55 -08:00
Kenneth Graunke
82f9ad8c60 i965: Fix S8 and X8 reversal in brw_depthbuffer_format refactor.
In commit 09d9a8913e, I accidentally
botched the X8 and S8 cases.  (I wrote this patch before realizing that
X8 and S8 had been swapped in the big MESA_FORMAT rename, and apparently
didn't rebase it properly after fixing that...)

Fixes regressions in 13 Piglit tests on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-21 19:17:50 -08:00
Vinson Lee
5a0b08e9ea mesa: Move declarations before code.
This patch fixes these MSVC build errors introduced with
73b78f9c9f.

  Compiling src\mesa\main\uniforms.c ...
uniforms.c
src\mesa\main\uniforms.c(291) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(294) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(294) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(294) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(306) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(309) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(309) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(309) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(322) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(325) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(325) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(325) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(345) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(348) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(348) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(348) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(360) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(363) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(363) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(363) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(376) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(379) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(379) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(379) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(588) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(591) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(591) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(591) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(603) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(606) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(606) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(606) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2
src\mesa\main\uniforms.c(619) : error C2143: syntax error : missing ';' before 'type'
src\mesa\main\uniforms.c(622) : error C2065: 'shProg' : undeclared identifier
src\mesa\main\uniforms.c(622) : warning C4047: 'function' : 'gl_shader_program *' differs in levels of indirection from 'int'
src\mesa\main\uniforms.c(622) : warning C4024: '_mesa_uniform' : different types for formal and actual parameter 2

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 19:11:58 -08:00
Vinson Lee
aaefc85f3b mesa/sso: Change CreateShaderProgramv return type from uint to GLuint.
This patch fixes this MinGW build error.

  Compiling src/mapi/glapi/glapi_dispatch.c ...
In file included from src/mapi/glapi/glapi_dispatch.c:41:0:
build/windows-x86_64-debug/mapi/glapi/glapitable.h:930:4: error: expected specifier-qualifier-list before 'uint'
    uint (GLAPIENTRYP CreateShaderProgramv)(GLenum type, GLsizei count, const GLchar * const * strings); /* 886 */
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 18:05:40 -08:00
Vinson Lee
34587e4a00 scons: Add main/pipelineobj.c to src/mesa/SConscript.
This patch fixes this SCons build error.

build/linux-x86_64-debug/mesa/libmesa.a(context.os): In function `init_attrib_groups':
src/mesa/main/context.c:815: undefined reference to `_mesa_init_pipeline'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 17:00:47 -08:00
Vinson Lee
897a5fa360 mesa/sso: Fix typo of 'unsigned'.
Fix build error introduced with commit f4c13a890f.

  CC       pixeltransfer.lo
main/pipelineobj.c: In function '_mesa_delete_pipeline_object':
main/pipelineobj.c:59:4: error: unknown type name 'unsinged'
    unsinged i;
    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-02-21 16:41:04 -08:00
Gregory Hainaut
4719ad79ec mesa/sso: Implement _mesa_GetProgramPipelineiv
This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr):
* Trivial reformatting.
* Remove GL_COMPUTE_SHADER.  Compute shaders don't participate in pipeline
  objects anyway.  Suggested by Matt Turner.

v3 (idr):
* Use _mesa_has_geometry_shaders.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:03 -08:00
Gregory Hainaut
c171834b49 mesa/sso: Implement _mesa_ActiveShaderProgram
This was originally included in another patch, but it was split out by
Ian Romanick.

v2 (idr): Return early from _mesa_ActiveShaderProgram if
_mesa_lookup_shader_program_err returns an error.  Suggested by Jordan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v2]
2014-02-21 15:41:03 -08:00
Gregory Hainaut
e9ff3b9918 mesa/sso: Implement _mesa_CreateShaderProgramv
This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:03 -08:00
Gregory Hainaut
3659eade53 mesa/sso: Refactor implementation of _mesa_CreateShaderProgramEXT
This will allow the guts of the implementation to be shared with
_mesa_CreateShaderProgramv.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:03 -08:00
Gregory Hainaut
8ed8592fd6 mesa/sso: Add support for GL_PROGRAM_SEPARABLE query
This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
4177d39c1e mesa/sso: Implement _mesa_IsProgramPipeline
Implement IsProgramPipeline based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
0c26552662 mesa/sso: Implement _mesa_GenProgramPipelines
Implement GenProgramPipelines based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
55311557fd mesa/sso: Implement _mesa_DeleteProgramPipelines
Implement DeleteProgramPipelines based on the VAO code.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
f4c13a890f mesa/sso: Add pipeline container/state
V1:
* Extend gl_shader_state as pipeline object state
* Add a new container gl_pipeline_shader_state that contains
   binding point of the previous object
* Update mesa init/free shader state due to the extension of
   the attibute
* Add an init/free pipeline function for the context

V2:
* Rename gl_shader_state to gl_pipeline_object
* Rename Pipeline.PipelineObj to Pipeline.Current
* Formatting improvement

V3 (idr):
* Split out from previous uber patch.
* Remove '#if 0' debug printfs.

V4 (idr):
* Fix some errors in comments.  Suggested by Jordan.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
0f137a1d73 mesa: Add a mutex and refcounting to gl_shader_state
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
47476fa673 mesa: Make get_shader_flags publicly available
Future patches will use this function outside shaderapi.c.

This was originally included in another patch, but it was split out by
Ian Romanick.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Gregory Hainaut
73b78f9c9f mesa/sso: Add extension entry points for GL_ARB_separate_shader_objects
Nothings implemented yet but glProgramUniform* which are mostly a
copy/paste of the older function glUniform*

I create dedicated pipelineobj.[ch] file that will contains function
related to the "new" pipeline container object.

V2: formatting improvement

V3:
* indentation fix
* Update copyright
* Add a comment on ProgramParameteri already present in another extension
* Remove TODO, will be readded on correct patch

V4 (idr):
* Fix dispatch_sanity unit test
* Make extension string available in core profiles (instead of just
  compatibility).
* Trivial reformating

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Ian Romanick
4d14b190bb glsl/sso: Add parser and AST-to-HIR support for separate shader object layouts
GL_ARB_separate_shader_objects adds the ability to specify location
layouts for interstage inputs and outputs.

In addition, this extension makes 'in' and 'out' generally available for
shader inputs and outputs.  This mimics the behavior of
GL_ARB_explicit_attrib_location.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Ian Romanick
f3b184590f mesa/sso: Add extension tracking for ARB_separate_shader_objects
This adds the necessary bits for both the API and the GLSL compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:02 -08:00
Ian Romanick
79146065f9 mesa: Refactor per-stage link check to its own function
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-21 15:41:01 -08:00
Emil Velikov
68bc1e2025 specs: MESA_query_renderer.spec resolve a couple of typos
Cc: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-21 22:52:46 +00:00
Emil Velikov
0432aa064b configure: use shared-glapi when more than one gl* API is used
Current behaviour states that shared-glapi is usefull when building
with dri, which is not the case. Shared-glapi is used to dispatch
the gl* functions across the one or more gl api's which can be dri
based but do not need to be.

Fixed the following build

 ./configure --enable-gles2 --disable-dri --enable-gallium-egl \
      --with-egl-platforms=fbdev --with-gallium-drivers=swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75098
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-21 22:48:50 +00:00
Emil Velikov
9eae750317 configure: use default dri drivers whenever opengl and dri are enabled
Commit ee55500c22a(configure: cleanup classic dri drivers handling)
cleaned up the logic handling autodetection of dri drivers, but missed
the case when one can explicitly disable dri, and still request opengl.

Fixes build issues for the following
./autogen.sh --disable-dri --with-gallium-drivers=swrast

While we're here, explicitly clear with_dri_drivers whenever building
without such drivers to prevent choking later on.

v2: Simplify with_dri_drivers handling.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75126
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-21 22:47:51 +00:00
Eric Anholt
c2ebbe2728 i965: Stop throwing away our double precision for time calculations.
Fixes negative times being reported in our perf debug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:50 -08:00
Eric Anholt
f2f337c6d5 meta: Add support for integer blits.
Compared to i965, the code generated doesn't use the AVG instruction.  But
I'm not sure that multisampled integer resolves are really that important
to worry about.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
b0a8d0ee40 meta: Add support for doing MSAA to MSAA blits.
These are non-stretched, non-resolving blits, so it's just a matter of
sampling once from our gl_SampleID and storing that to our color/depth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
eb55b01eef meta: Save and restore a bunch of MSAA state.
We're disabling GL_MULTISAMPLE, so we didn't need to worry about a lot of
that state.  But to do MSAA to MSAA blits, we need to start handling more
state.

v2: Fix pasteo caught by Kenneth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
f7f15d3c2d meta: Try to do blending of sRGB values in linear colorspace.
Blending of values would occur when doing GL_LINEAR filtering with
scaling, and in an upcoming commit when doing MSAA resolves.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
7d2f73e737 meta: Add support for doing multisample resolves.
Note that this doesn't handle GL_EXT_multisample_scaled_blit yet.  The
i965 code for that extension bakes in knowledge of the sample positions
(well, knowledge of the sample positions aligned to a lower-resolution
grid), which we would have to do at runtime somehow for meta.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Eric Anholt
aba85d960e i965: Fix miptree matching for multisampled, non-interleaved miptrees.
We haven't been executing this code before the meta-blit case, because
we've been flagging the miptree as validated at texstorage time, and never
having to revalidate.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-21 10:43:38 -08:00
Courtney Goeltzenleuchter
941769be81 mesa: Remove unnecessary condition.
Identified by Valgrind memory check. Initialized block-opaque in a
different patch. This test seems unnecessary. If opaque must be true,
just set to true.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
2014-02-21 10:16:10 -08:00
Francisco Jerez
9b2fe7cf96 clover: Unabbreviate a few data accessor names for consistency.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:23 +01:00
Francisco Jerez
a0d99937a0 clover: Replace the transfer(new ...) idiom with a safer create(...) helper function.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
c4578d2277 clover: Migrate a bunch of pointers and references in the object tree to smart references.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
d82b39ce38 clover: Allow storing a range into a container of different (but compatible) element type.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
1b9fb2fd91 clover: Define an intrusive smart reference class.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
9ae0bd3829 clover: Some improvements for the intrusive pointer class.
Define some additional convenience operators, clean up the
implementation slightly, and rename it to 'intrusive_ptr' for reasons
that will be obvious in the next commit.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:51:22 +01:00
Francisco Jerez
198cd136b9 clover: Fix up NULL constant pointer arguments.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-02-21 12:29:05 +01:00
Jordan Justen
c97763ca2d tgsi_ureg: add property_gs_invocations
Fixes a build break in state_tracker/st_program.c

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75278
Reviewed-by: Dave Airlie <airlied@redhat.com>
2014-02-20 16:41:01 -08:00
Kenneth Graunke
1336ccb7dd i965: Enable Broadwell support.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:51:38 -08:00
Kenneth Graunke
808952a095 i965/fs: Implement FS_OPCODE_[UN]PACK_HALF_2x16_SPLIT[_XY] opcodes.
I'd neglected to port these to Broadwell.  Most of this code is copy
and pasted from Gen7, but instead of using F32TO16/F16TO32, we just
use MOV with HF register types.

Fixes fs-packHalf2x16 and fs-unpackHalf2x16 tests (both the ARB
extension and ES 3.0 variants).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:59 -08:00
Kenneth Graunke
850e372fc7 i965: Drop bogus F32TO16/F16TO32 instructions on Broadwell - use MOV.
Broadwell removed the F32TO16 and F16TO32 instructions.  However, it has
actual support for HF values, so they're actually just MOV.

Fixes vs-packHalf2x16 and vs-unpackHalf2x16 tests (both the ARB
extension and ES 3.0 variants).

v2: Emulate F32TO16's align16 zeroing bug, since Chad's front end code
    relies on it happening.  We can probably refactor this code to be
    better later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:57 -08:00
Kenneth Graunke
3663bbe773 i965: Create a hardware context before initializing state module.
brw_init_state() calls brw_upload_initial_gpu_state().  If hardware
contexts are enabled (brw->hw_ctx != NULL), this will upload some
initial invariant state for the GPU.  Without hardware contexts, we
rely on this state being uploaded via atoms that subscribe to the
BRW_NEW_CONTEXT bit.

Commit 46d3c2bf4d accidentally moved
the call to brw_init_state() before creating a hardware context.
This meant brw_upload_initial_gpu_state would always early return.
Except on Gen6+, we stopped uploading the initial GPU state via
state atoms, so it never happened.

Fixes a regression since 46d3c2bf4d.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
e3823147a5 i965/fs: Implement scratch read/write support for Broadwell.
To make sure that both the Gen4 and Gen7 style messages work, I
initially disabled the SHADER_OPCODE_GEN7_SCRATCH_READ optimization,
ran Piglit, re-enabled it, and ran Piglit again.  Both worked fine.

Fixes 40 Piglit tests (most of the varying-packing category).

v2: Move num_regs assertion from gen8_fs_generator to
    gen8_set_dp_scratch_message() (suggested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
29a6974403 i965: Add Gen8 assembly support for DP Scratch messages.
The new accessors will make it easy to do Gen7-style scratch messages.

v2: Move num_regs assertion from gen8_fs_generator into
    gen8_set_dp_scratch_message() (suggested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
a5e54c91a3 i965: Store absolute thread count in max_wm_threads on Broadwell.
In the past, 3DSTATE_PS took an absolute number of threads.  Conversely,
on Broadwell you always program 64, and it implicitly scales based on
the GT-level with no special programming.  So, I stored 64 in
brw_device_info::max_wm_threads.

However, I didn't realize that we also use max_wm_threads to compute the
size of the scratch space buffer.  In that case, we really need the
absolute number of threads.

This patch hardcodes 3DSTATE_PS to use the value it expects, and changes
max_wm_threads back to a (completely fake) absolute thread count (once
again copied from Haswell).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:08 -08:00
Kenneth Graunke
dca84b4b5b i965: Use MOV, not OR for setting URB write channel enables on Gen8+.
On Broadwell, g0.5 contains the "Scratch Space Pointer"; using OR
puts some bits of that into "ignored" sections of our message header.

While this doesn't hurt, it's also not terribly /useful/.  Using MOV
is sufficient to set the only interesting bits in this part of the
message header.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:07 -08:00
Kenneth Graunke
e643c7d036 i965: Implement a CS stall workaround on Broadwell.
According to the latest documentation, any PIPE_CONTROL with the
"Command Streamer Stall" bit set must also have another bit set,
with five different options:

   - Render Target Cache Flush
   - Depth Cache Flush
   - Stall at Pixel Scoreboard
   - Post-Sync Operation
   - Depth Stall

I chose "Stall at Pixel Scoreboard" since we've used it effectively
in the past, but the choice is fairly arbitrary.

Implementing this in the PIPE_CONTROL emit helpers ensures that the
workaround will always take effect when it ought to.

Apparently, this workaround may be necessary on older hardware as well;
for now I've only added it to Broadwell as it's absolutely necessary
there.  Subsequent patches could add it to older platforms, provided
someone tests it there.

v2: Only flag "Stall at Pixel Scoreboard" when none of the other bits
    are set (suggested by Ian Romanick).

v3: Prefix the function with "gen8" (requested by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-20 15:50:07 -08:00
Jordan Justen
741782b594 i965: support instanced GS on gen7
v3:
 * Properly prevent dual object mode execution when
   the invocation count > 1

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
008338bc4e i965: support gl_InvocationID for gen7
v2:
 * Make gl_InvocationID a system value

v3:
 * Properly shift from R0.1 into DST.4 by adding
   GS_OPCODE_GET_INSTANCE_ID

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
d099019935 glsl: add gl_InvocationID variable for ARB_gpu_shader5
v2:
 * Make gl_InvocationID a system value

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
22388e2208 main/shaderapi: GL_GEOMETRY_SHADER_INVOCATIONS GetProgramiv support
v3:
 * Add check for ARB_gpu_shader5

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
86d6b5546b mesa: initialize gl_geometry_program Invocations field
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:09 -08:00
Jordan Justen
313402048f glsl/linker: produce gl_shader_program Geom.Invocations
Grab the parsed invocation count, check for consistency
during linking, and finally save the result in
gl_shader_program Geom.Invocations.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Jordan Justen
02dc74fbd7 glsl: parse invocations layout qualifier for ARB_gpu_shader5
_mesa_glsl_parse_state in_qualifier->invocations will store the
invocations count.

v3:
 * Use in_qualifier to allow the primitive to be specied
   separately from the invocations count (merge_qualifiers)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Jordan Justen
738c9c3c54 glsl: Generate error for invalid input layout declarations
Fixes various piglit tests:
spec/glsl-1.50/compiler/incorrect-in-layout-qualifier-*.geom

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Jordan Justen
0c558f9ee6 glsl: convert GS input primitive to use ast_type_qualifier
We introduce a new merge_in_qualifier ast_type_qualifier
which allows specialized handling of merging input layout
qualifiers.

By merging layout qualifiers into state->in_qualifier, we
allow multiple input qualifiers. For example, the primitive
type can be specified specified separately from the
invocations count (ARB_gpu_shader5).

state->gs_input_prim_type is moved into state->in_qualifier->prim_type

state->gs_input_prim_type_specified is still processed separately
so we can determine when the input primitive is specified. This
is important since certain scenerios are not supported until after
the primitive type has been specified in the shader code.

v4:
 * Merge with compute shader input layout qualifiers

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-20 10:33:08 -08:00
Eric Anholt
5bc0b2f432 i965: Fix extra return value after winsys rb update refactor.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75172
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-20 10:15:13 -08:00
Eric Anholt
9245206cbf i965/vs: Use samplers for UBOs in the VS like we do for non-UBO pulls.
Improves performance of a dolphin emulator trace I had laying around by
3.60131% +/- 0.995887% (n=128).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-20 10:15:13 -08:00
Eric Anholt
9e3cab8881 i965/fs: Add an optimization pass to remove redundant flags movs.
We generate steaming piles of these for the centroid workaround, and this
quickly cleans them up.

total instructions in shared programs: 1591228 -> 1590047 (-0.07%)
instructions in affected programs:     26111 -> 24930 (-4.52%)
GAINED:                                0
LOST:                                  0

(Improved apps are l4d2, csgo, and dolphin)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-20 10:15:13 -08:00
Roland Scheidegger
b2b2a2c06c gallivm: add smallfloat to float conversion not relying on cpu denorm handling
The previous code relied on cpu denorm support for converting small float
formats (such r11g11b10_float and r16_float) to floats, otherwise denorms
are flushed to zero. We worked around that in llvmpipe blend code by
reenabling denorms, but this did nothing for texture sampling. Now it would
be possible to reenable it there too but I'm not really a fan of messing
with fpu flags (and it seems we can't actually do it reliably with llvm in
any case looking at some bug reports). (Not to mention if you actually have
a lot of denorms in there, you can expect some order-of-magnitude slowdown
with x86 cpus.)
So instead use code which adjusts exponents etc. directly hence not relying
on cpu denorm support for the rescaling mul.
(We still need the fpu flag handling as we can't do float-to-smallfloat
without using cpu denorms at least for now - I actually wanted to keep
both the old and new code and using one or the other depending on from where
it's called but that didn't work out as the parameter would have to be passed
through too many layers than I'd like.)

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Si Chen <sichen@vmware.com>
2014-02-20 18:41:42 +01:00
Leo Liu
0206f0b3d4 st/omx/enc: add multi scaling buffers for performance improvement
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-20 13:34:16 +01:00
Christian König
754fa3a0d2 st/omx/dec/h264: fix prevFrameNumOffset handling
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-20 13:34:06 +01:00
Kenneth Graunke
57405605a8 i965: Actually claim to support MSAA on Broadwell.
We need to advertise 8x, 4x, and 2x multisamples.  Previously, we only
claimed to support 0/1 samples.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
4af8c95783 i965: Update physical width/height munging for 2x IMS MSAA.
I can't find any documentation to explain what ought to be done here, so
I simply guessed based on the pattern I observed in the 4x/8x cases.
It appears to work, but it could be totally wrong.

I was able to find the Sandybridge PRM quote from the comments in the
latest documentation: Shared Functions > 3D Sampler > Multisampled
Surface Behavior.  However, it only mentions 4x MSAA - not even 8x.

After a substantial amount more digging, I was able to find a second
page (incorrectly tagged) which confirmed the formulas in our code for
8x MSAA.  However, that page didn't mention 2x MSAA at all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
51145a24f7 i965: Enable smooth points when multisampling without point sprites.
According to the "Point Multisample Rasterization" of the OpenGL
specification (3.0 or later), smooth points are supposed to be enabled
implicitly when multisampling, regardless of the GL_POINT_SMOOTH flag.

However, if GL_POINT_SPRITE is enabled, you get square points no matter
what.  Core contexts always enable point sprites, so this effectively
makes smooth points go away, even in the case of multisampling.

Fixes Piglit's EXT_framebuffer_multisample/point-smooth tests.
(Yes, that's right folks, we actually have Piglit tests for this.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
a3d70580b5 i965: Thwack multisample enable bit in 3DSTATE_RASTER.
The meaning and effects of this bit are surprisingly complicated.

See Rasterization > Windower > Multisampling > Multisample ModesState.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:43:22 -08:00
Kenneth Graunke
0c5873c9b9 i965: Only use the SIMD16 program for per-sample shading on Broadwell.
This restriction carries forward from earlier platforms.  The code is
ported straight from gen7_wm_state.c.

v2: Actually do it right.
v3: Add missing _NEW_MULTISAMPLE bit (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:42:54 -08:00
Kenneth Graunke
61d7ea4b16 i965: Set "Position XY Offset Select" bits in 3DSTATE_PS on Broadwell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:42:16 -08:00
Kenneth Graunke
01c42b2be6 i965: Add missing sample shading bits to Gen8's 3DSTATE_PS_EXTRA.
v2: Also set the "oMask Present to Render Target" bit, which is required
    for shaders that write oMask.  Otherwise the hardware won't expect
    the extra data.

v3: Add missing _NEW_MULTISAMPLE (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:42:02 -08:00
Kenneth Graunke
77c37ed74b i965/fs: Implement FS_OPCODE_SET_OMASK on Broadwell.
I made a few changes which I think simplify the code a bit compared to
the Gen7 implementation, but which are largely pointless.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:39:41 -08:00
Kenneth Graunke
5476da79f8 i965/fs: Implement FS_OPCODE_SET_SAMPLE_ID on Broadwell.
Largely cut and paste from Gen7; it works the same way.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:39:41 -08:00
Kenneth Graunke
80c4edfc27 i965: Disable MCS on Broadwell for now.
v2: Add a perf_debug() message to remind us to come back to this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:39:21 -08:00
Kenneth Graunke
4eba0d124d i965: Use gen7_surface_msaa_bits in Broadwell SURFACE_STATE code.
We already set the number of samples, but were missing the MSAA layout
mode.  Reusing gen7_surface_msaa_bits makes it easy to set both.

This also lets us drop the Gen8 surface_num_multisamples function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:35:54 -08:00
Kenneth Graunke
6eeae17c02 i965: Use ffs() for sample counting in gen7_surface_msaa_bits().
The enumerations are just log2(num_samples) shifted by 3, which we can
easily compute via ffs().

This also makes it reusable for Broadwell, which has 2x MSAA.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:35:53 -08:00
Kenneth Graunke
2ed5824a5d i965: Simplify Broadwell's 3DSTATE_MULTISAMPLE sample count handling.
These enumerations are simply log2 of the number of multisamples shifted
by a bit, so we can calculate them using ffs() in a lot less code.

Suggested by Eric Anholt.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:35:32 -08:00
Ian Romanick
7700c73cf4 glsl: Silence "type qualifiers ignored on function return type" warning
The const in

   const unsigned foo(void);

is meaningless.  Removing it silences this warning:

src/glsl/ast_to_hir.cpp:1802:56: 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>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-02-19 15:08:50 -08:00
Ian Romanick
2c85fd5a96 glsl: Only warn for macro names containing __
From page 14 (page 20 of the PDF) of the GLSL 1.10 spec:

    "In addition, all identifiers containing two consecutive underscores
     (__) are reserved as possible future keywords."

The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos.  Names simply containing __ are dangerous to use, but should
be allowed.

Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Darius Spitznagel <d.spitznagel@goodbytez.de>
Cc: Tapani Pälli <lemody@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
2014-02-19 15:08:50 -08:00
Ian Romanick
0bd7892630 glcpp: Only warn for macro names containing __
Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and the
GLSL ES spec (all versions) say:

    "All macro names containing two consecutive underscores ( __ ) are
    reserved for future use as predefined macro names. All macro names
    prefixed with "GL_" ("GL" followed by a single underscore) are also
    reserved."

The intention is that names containing __ are reserved for internal use
by the implementation, and names prefixed with GL_ are reserved for use
by Khronos.  Since every extension adds a name prefixed with GL_ (i.e.,
the name of the extension), that should be an error.  Names simply
containing __ are dangerous to use, but should be allowed.  In similar
cases, the C++ preprocessor specification says, "no diagnostic is
required."

Per the Khronos bug mentioned below, a future version of the GLSL
specification will clarify this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Darius Spitznagel <d.spitznagel@goodbytez.de>
Cc: Tapani Pälli <lemody@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870
Bugzilla: Khronos #11702
2014-02-19 15:08:50 -08:00
Tom Stellard
a4c734297f configure: Use LLVM shared libraries by default
Linking with LLVM static libraries is easily broken by changes to
the llvm-config program or when LLVM adds, removes, or changes library
components.  Keeping up with these changes requires a lot of maintanence
effort to keep the build working on the master and stable branches.

Also, because of issues in the past LLVM static libraries, the release
manager is currently configuring with --with-llvm-shared-libs when
checking the build before release.  Enabling shared libraries by
default would allow the release manager to run ./configure with
no arguments, and be reasonably confident that the build would succeed.

Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-19 14:35:49 -05:00
Francisco Jerez
8928d7860a i965/fs: Allocate the param_size array dynamically.
Useful because the total number of uniform components might exceed
MAX_UNIFORMS * 4 in some cases because of the image metadata we'll be
passing as push constants.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 19:03:56 +01:00
Francisco Jerez
eef710fc53 i965/fs: Use a separate variable to keep track of the last uniform index seen.
Like the VEC4 back-end does.  It will make dynamic allocation of the
param_size array easier in a future commit.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 19:03:56 +01:00
Rob Clark
9186cd39d4 freedreno: tweak ringbuffer sizes/count
Since we are now consuming two ringbuffers at a time, we probably want a
pool larger than 4.. but we don't need each individual ringbuffer to be
so large, so offset the pool size increase by reducing rb size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-19 12:02:57 -05:00
Rob Clark
5993723471 freedreno/a3xx/compiler: scheduling/legalize fixes
It seems the write-after-read hazard that applies to texture fetch
instructions, also applies to sfu instructions.

Also, cat5/cat6 instructions do not have a (ss) bit, so in these
cases we need to insert a dummy nop instruction with (ss) bit set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-19 12:01:26 -05:00
Francisco Jerez
bbf8239f92 i965: Have brw_imm_vf4() take the vector components as integer values.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:56:57 +01:00
Francisco Jerez
51b00c5cb9 i965: Add helper function to find out the signedness of a register type.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:56:57 +01:00
Francisco Jerez
560f10e573 i965/vec4: Use swizzle() in the ARB_vertex_program code.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
8797ccf3fa i965/fs: Use offset() in the ARB_fragment_program code.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
6f56d5dc60 i965/fs: Remove fs_reg::retype.
There doesn't seem to be any reason for it to be a method, and it's
surprising that the expression 'reg.retype(t)' doesn't retype its
object but rather it creates a temporary with the new type.  Use
'retype(reg, t)' instead.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
3b03273275 i965/vec4: Trivial improvements to the with_writemask() function.
Add assertion that the register is not in the HW_REG or IMM file,
calculate the conjunction of the old and new mask instead of replacing
the old [consistent with the behavior of brw_writemask(), causes no
functional changes right now], make it static inline to let the
compiler do a slightly better job at optimizing things, and shorten
its name.

v2: Assert that the new writemask is not zero to avoid undefined
    hardware behaviour.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
42b226ef82 i965: Make sure that backend_reg::type and brw_reg::type are consistent for fixed regs.
And define non-mutating helper functions to retype fixed and normal
regs with a common interface.  At some point we may want to get rid of
::fixed_hw_reg completely and have fixed regs use the normal register
data members (e.g. backend_reg::reg to select a fixed GRF number,
src_reg::swizzle to store the swizzle, etc.), I have the feeling that
this is not the last headache we're going to get because of the
multiple ways to represent the same thing and the different register
interface depending on the file a register is stored in...

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
98306e727b i965/vec4: Add non-mutating helper functions to modify src_reg::swizzle and ::negate.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
2337820d49 i965: Add non-mutating helper functions to modify the register offset.
Yes, we could avoid having four copies of essentially the same code by
using templates here.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
af25addcd0 i965/vec4: Fix off-by-one register class overallocation.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
a32817f3c2 i965: Unify fs_generator:: and vec4_generator::mark_surface_used as a free function.
This way it can be used anywhere.  I need it from the visitor.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:25 +01:00
Francisco Jerez
ae8b066da5 i965: Move up duplicated fields from stage-specific prog_data to brw_stage_prog_data.
There doesn't seem to be any reason for nr_params, nr_pull_params,
param, and pull_param to be duplicated in the stage-specific
subclasses of brw_stage_prog_data.  Moving their definition to the
common base class will allow some code sharing in a future commit, the
removal of brw_vec4_prog_data_compare and brw_*_prog_data_free, and
the simplification of the stage-specific brw_*_prog_data_compare.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 16:27:22 +01:00
Francisco Jerez
7f00c5f1a3 i965/vec4: Add constructor of src_reg from a fixed hardware reg.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-19 15:10:57 +01:00
Kenneth Graunke
98e048cf32 i965: Enable fast depth clears.
They work fine now, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
7023786417 i965: Enable HiZ on Broadwell.
It appears to work fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
8cad1c115a i965: Implement HiZ resolves on Broadwell.
Broadwell's 3DSTATE_WM_HZ_OP packet makes this much easier.

Instead of programming the whole pipeline, we simply have to emit the
depth/stencil packets, a state override, and a pipe control.  Then
arrange for the state to be put back.  This is easily done from a single
function.

v2: Use minify(mt->logical_{width,height}0, level) in 3DSTATE_WM_HZ_OP
    instead of intel_mipmap_level's width/height fields.  Those were
    based on the physical width/height, and thus wrong for MSAA buffers.
    Eric also deleted those fields.

v3: Use 0xFFFF as the sample mask regardless of what the user set (as
    this operation is unrelated); set the drawing rectangle to the
    miplevel being operated on, rather than the whole surface; remove
    unnecessary MAX2(..., 1) around mt->logical_depth0 (all suggested
    by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
82711611cf i965: Refactor Gen8 depth packet emission.
The existing code followed the vtable function signature, which is not a
great fit: many of the parameters are unused, and the function still
inspects global state, making it less reusable.

This patch refactors the depth buffer packet emission code into a new
function which takes exactly the parameters it needs, and which uses no
global state.  It then makes the existing vtable function call the new
one.

Ideally, we would remove the vtable function, and clean up that
interface.  But that can happen once HiZ is working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
67f073b91c i965: Add #defines for the 3DSTATE_WM_HZ_OP packet's contents.
We're going to need these to implement HiZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
577fdf1f48 i965: Bump generation check in code to disable HiZ at LODs > 0.
Broadwell's "HiZ Resolve" operation still has the restriction that the
rectangle primitive must be 8x4 aligned.  So I believe we still need
this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:17 -08:00
Kenneth Graunke
a5d2eb6b98 i965: Program 3DSTATE_HIER_DEPTH_BUFFER properly on Broadwell.
HiZ buffers still don't exist, but when they do, we'll set them up.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:16 -08:00
Kenneth Graunke
09d9a8913e i965: Pull format conversion logic out of brw_depthbuffer_format.
brw_depthbuffer_format is not very reusable at the moment, since it
uses global state (ctx->DrawBuffer) to access a particular depth buffer.

For HiZ on Broadwell, I need a function which simply converts the
formats.  However, at least one existing user of brw_depthbuffer_format
really wants the existing interface.  So, I've created a new function.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-19 01:46:16 -08:00
Chia-I Wu
4695f64895 egl: clarify what _eglInitResource does
It is a helper called from the initializers of its subclasses.
2014-02-19 13:08:54 +08:00
Chia-I Wu
dc97e54d97 Revert "egl: Unhide functionality in _eglInitContext()"
This reverts commit 1456ed85f0.
_eglInitResource can and is supposed to be called on subclass objects.

Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-02-19 13:08:52 +08:00
Chia-I Wu
924490a747 Revert "egl: Unhide functionality in _eglInitSurface()"
This reverts commit 498d10e230.
_eglInitResource can and is supposed to be called on subclass objects.

Acked-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-02-19 13:08:44 +08:00
Kenneth Graunke
c593ad6e46 i965: Bump MaxTexMbytes from 1GB to 1.5GB.
Even with the other limits raised, TestProxyTexImage would still reject
textures > 1GB in size.  This is an artificial limit; nothing prevents
us from having a larger texture.  I stayed shy of 2GB to avoid the
larger-than-aperture situation.

For 3D textures, this raises the effective limit:
 - RGBA8:   645 -> 738
 - RGBA16:  512 -> 586
 - RGBA32F: 406 -> 465

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74130
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 18:59:24 -08:00
Kenneth Graunke
6c04423153 i965: Bump GL_MAX_CUBE_MAP_TEXTURE_SIZE to 8192.
Gen4+ supports 8192x8192 cube maps.  Ivybridge and later can actually
support 16384, but that would place GL_MAX_CUBE_MAP_TEXTURE_SIZE above
GL_MAX_TEXTURE_SIZE, which seems like a bad idea.

(Unfortunately, we can't bump GL_MAX_TEXTURE_SIZE to 16384 without
causing regressions due to awful W-tiled stencil buffer interactions.)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74130
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 18:59:18 -08:00
Kenneth Graunke
06b047ebc7 i965: Bump MAX_3D_TEXTURE_SIZE to 2048.
It's highly unlikely that there will be enough memory in the system to
allocate enough space for this, but we should still expose the hardware
limit.  It's what the Intel Windows driver does, and it seems most other
vendors do likewise.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74130
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 18:58:57 -08:00
Ian Romanick
f0fdee5095 docs: Trivial updates to MESA_query_renderer.spec
Fix the version and the status before sending to Khronos for listing in
the registry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 15:25:04 -08:00
Sinclair Yeh
6c9d6898fd Prevent zero sized wl_egl_window
It is illegal to create or resize a window to zero (or negative) width
and/or height.  This patch prevents such a request from happening.
2014-02-18 14:12:11 -08:00
Anuj Phogat
03597cf802 glsl: Fix condition to generate shader link error
GL_ARB_ES2_compatibility doesn't say anything about shader linking
when one of the shaders (vertex or fragment shader) is absent. So,
the extension shouldn't change the behavior specified in GLSL
specification.

Tested the behavior on proprietary linux drivers of NVIDIA and AMD.
Both of them allow linking a version 100 shader program in OpenGL
context, when one of the shaders is absent.

Makes following Khronos CTS tests to pass:
successfulcompilevert_linkprogram.test
successfulcompilefrag_linkprogram.test

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 11:07:09 -08:00
Anuj Phogat
6bd2472a8b mesa: Add GL_TEXTURE_CUBE_MAP_ARRAY to legal_get_tex_level_parameter_target()
Fixes failing Khronos CTS test packed_depth_stencil_init.test

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-18 11:07:09 -08:00
Eric Anholt
d92f593d87 i965/fs: Use conditional sends to do FB writes on HSW+.
This drops the MOVs for header setup, which are totally mis-scheduled.

total instructions in shared programs: 1590047 -> 1589331 (-0.05%)
instructions in affected programs:     43729 -> 43013 (-1.64%)
GAINED:                                0
LOST:                                  0

glb27-trex:
x before
+ after
+-----------------------------------------------------------------------------+
|               +      x     xx        +  +    +                              |
|              ++  + xxx ++x xx + ** *x+  +  + +  x *                         |
|+x xx x*    x+++xx*x*xx+++*+*xx++** *x* x+***x*+xx+*     + *    +  +        *|
|               |__|__________MA___A___________|___|                          |
+-----------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  49         62.33         65.41         63.49      63.53449    0.62757822
+  50         62.28          65.4          63.7       63.6982      0.656564
No difference proven at 95.0% confidence

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 10:11:36 -08:00
Eric Anholt
4226798354 i965/fs: Drop dead comment about the old proj_attrib_mask optimization.
The code was removed early last year.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 10:01:45 -08:00
Eric Anholt
f128bcc7c2 i965: Drop mt->levels[].width/height.
It often confused people because it was unclear on whether it was the
physical or logical, and people needed the other one as well.  We can
recompute it trivially using the minify() macro, clarifying which value is
being used and making getting the other value obvious.

v2: Fix a pasteo in intel_blit.c's dst flip.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 10:01:45 -08:00
Eric Anholt
4e0924c5de i965: Move singlesample_mt to the renderbuffer.
Since only window system renderbuffers can have a singlesample_mt, this
lets us drop a bunch of sanity checking to make sure that we're just a
renderbuffer-like thing.

v2: Fix a badly-written comment (thanks Kenneth!), drop the now trivial
    helper function for set_needs_downsample.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 10:01:45 -08:00
Eric Anholt
019560c127 i965: Drop some duplicated code in DRI winsys BO updates.
The only DRI2 vs DRI3 delta was just how to decide about frontbuffer-ness
for doing the upsample.

v2: Fix missing singlesample_mt->region->name update in the merged code,
    which would have broken the DRI2 don't-recreate-the-miptree
    optimization.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:36 -08:00
Eric Anholt
0440e677b9 i965: Simplify intel_miptree_updownsample.
Pretty silly to pass in values dereferenced out of one of the arguments.

v2: Get the destination size from the dst, even though the callers are
    always dealing with src size == dst size cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:34 -08:00
Eric Anholt
bbd85ad27c i965: Don't try to use the ctx->ReadBuffer when asked to blorp miptrees.
So far it's happened to be that we're only ever calling
intel_miptree_blit() (up/downsampling) from the ReadBuffer, but I stumbled
over a null ReadBuffer case when debugging later parts of the series.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:32 -08:00
Eric Anholt
af4f758a44 i965: Make the mt->target of multisample renderbuffers be 2D_MS.
Mostly mt->target == 2D_MS just results in a few checks that we don't try
to allocate multiple LODs and don't try to do slice copies with them.  But
with the introduction of binding renderbuffers to textures, we need more
consistency.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:29 -08:00
Eric Anholt
4e4a537ad5 meta: Push into desktop GL mode when doing meta operations.
This lets us simplify our shaders, and rely on GLES-prohibited
functionality (like ARB_texture_multisample) when writing these
driver-internal functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:27 -08:00
Eric Anholt
b3dcce65c9 meta: Fix blit shader compile on non-glsl-130 drivers.
Compare this VS to the one for the post-130 case.  Fixes piglit
glsl-lod-bias, and presumably tons of other code (I haven't done a full
piglit run on swrast).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74911
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-18 09:56:06 -08:00
Rob Clark
20d14ef263 configure: fix build error with XA
Fixes:

xa_tracker.c: In function 'xa_tracker_create':
 xa_tracker.c:147:5: error: implicit declaration of function 'pipe_loader_drm_probe_fd' [-Werror=implicit-function-declaration]

in some build configurations, as XA now implicitly depends on
gallium_drm_loader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-02-18 08:12:37 -05:00
Michel Dänzer
cf0172d46a r600g,radeonsi: Consolidate logic for short-circuiting flushes
Fixes radeonsi emitting command streams to the kernel even when there
have been no draw calls before a flush, potentially powering up the GPU
needlessly.

Incidentally, this also cuts the runtime of piglit gpu.py in about half
on my Kaveri system, probably because an X11 client going away no longer
always results in a command stream being submitted to the kernel via
glamor.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65761
Cc: "10.1" mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-18 10:46:23 +09:00
Emil Velikov
adad8fb2e9 st/dri: remove #ifdef DRM_CAP_PRIME guard
Required for libdrm 2.4.37 and earlier. Both scons and automake
require version 2.4.38 now so that guard is not longer needed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:08:26 +00:00
Emil Velikov
6fbd00e43a automake: remove leftover XORG and LIBKMS variables
No longer set or used since the removal of st/xorg.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:08:03 +00:00
Emil Velikov
4b3a4c799a scons: sync package requirements
xorg-server and libkms is no longer required since the removal
of the xorg state-tracker.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:04:07 +00:00
Emil Velikov
5fe47969c0 configure: bump up libdrm requirement to 2.4.38
This is the first version that introduced DRM_CAP_PRIME, which is
implicitly required by egl/wayland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:04:02 +00:00
Emil Velikov
f41102b538 configure: use test -n whenever possible
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:30 +00:00
Emil Velikov
8015ffeea1 configure: use test -z whenever possible
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:23 +00:00
Emil Velikov
ee55500c22 configure: cleanup classic dri drivers handling
* Make sure that only drivers that are handled by configure.ac
are included in DRI_DIRS.
* Change with_dri_drivers default value to auto, and set enable
autodetection, when enable_opengl is on.

v2: Move "test" to the correct location.
v3: Squash DRI_DIRS handling before the switch statement.
Suggested by Ilia Mirkin

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:19 +00:00
Emil Velikov
35f6eed742 configure: compact ppc/sparc DRI_DIRS handling
Both arches have the same list of dri_dirs.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:13 +00:00
Emil Velikov
65e67b9bf7 configure: drop explicit DRI_DIRS assignment on some platforms/arches
Both x86_64|amd64 and *bsd, already set the full range of available
classic dri drivers. Drop the explicit assignment, and fall back to
the generic default.
Keep explicit list from plafroms/arches that do not handle the default
list.

Update help strings, to explicitly mention "classic" for applicable
DRI drivers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-18 00:00:05 +00:00
Emil Velikov
49e93e8945 configure: cleanup switch statement
Move all the cases within one switch statement and handle
i9{1,6}5 and r{adeon,200} independently.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-17 23:59:25 +00:00
Kusanagi Kouichi
d23f9e3390 targets/vdpau: Don't link unused libraries
libvdpau, libselinux and libexpat are not used.

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
2014-02-17 21:14:17 +00:00
Kusanagi Kouichi
6ba4392da2 configure: Try pkg-config first for libselinux
v2 (Emil) Add SELINUX_CFLAGS in the respective locations

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2014-02-17 21:14:16 +00:00
Kusanagi Kouichi
61f6cddef7 targets/vdpau: Always use c++ to link
If built without llvm, the following error occurs with mplayer:

Failed to open VDPAU backend .../libvdpau_r600.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE
[vo/vdpau] Error when calling vdp_device_create_x11: 1

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-17 21:14:16 +00:00
Ilia Mirkin
6958fb341f st/xvmc: fix tests so that they pass
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-16 23:21:57 -05:00
Rob Clark
8b5f894e13 pipe-loader: add pipe loader for freedreno/msm
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:36:23 -05:00
Rob Clark
24fa96163a st/xa: missing handle type
DRM_API_HANDLE_TYPE_SHARED is zero, so doesn't actually fix anything.
But we shouldn't rely on SHARED handle type being zero.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:36:23 -05:00
Rob Clark
42158926c6 st/xa: use pipe-loader to get screen
This lets multiple gallium drivers use XA.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:36:19 -05:00
Rob Clark
a122c75599 pipe-loader: split out "client" version
Build two versions of pipe-loader, with only the client version linking
in x11 client side dependencies.  This will allow the XA state tracker
to use pipe-loader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:31:10 -05:00
Rob Clark
d73b2c0517 freedreno/a3xx/compiler: use (ss) for WAR hazards
Seems texture sample instructions don't immediately consume there
src(s).  In fact, some shaders from blob compiler seem to indiciate that
it does not even count the texture sample instructions when calculating
number of delay slots to fill for non-sample instructions.  (Although so
far it seems inconclusive as to whether this is required.)

In particular, when a src register of a previous texture sample
instruction is clobbered, the (ss) bit is needed to synchronize with the
tex pipeline to ensure it has picked up the previous values before they
are overwritten.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
e8cca57a3f freedreno/a3xx/compiler: fix RA typo
Was supposed to be a '+', otherwise we end up with a negative offset and
choosing registers below the assigned range.

This seems to fix the scheduling mystery "solved" by adding in extra
delay slots.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
579473f8f8 freedreno/a3xx/compiler: handle kill properly (new compiler)
Since 'kill' does not produce a result, the new compiler was happily
optimizing them out.  We need to instead track 'kill's similar to
outputs.  But since there is no non-predicated kill instruction,
(and for flattend if/else we do want them to be predicated), we need
to track the topmost branch condition on the stack and use that as src
arg to the kill.  For a kill at the topmost level, we have to generate
an immediate 1.0 to feed into the cmps.f for setting the predicate
register.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
e35747b882 freedreno/a3xx/compiler: trans_cmp() sanity
Thanks to figuring out 32bit float render target, and adding regdump
test in fdre-a3xx, I can more easily play around with instructions to
figure out range of inputs/outputs/etc.  And from this I can conclude
that cmps.f works more like expected and I can do something much more
simple in trans_cmp() (compared to before which was more closely
emulating the instruction sequence of the blob compiler).

And using sel.b32 (binary 0/1) often makes more sense than sel.f32
(+/- float) or sel.u32 (+/- uint) as it can use the output directly
from cmps.f without needing the 'add.s tmp0, tmp0, -1'.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark
89dc282581 freedreno: fix problems if no color buf bound
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Eric Anholt
1020d8937e meta: Don't try to enable FF texturing when we're using GLSL.
On a core context, this would throw an error.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-14 12:09:42 -08:00
Carl Worth
a92581acf2 main: Avoid double-free of shader Label
As documented, the _mesa_free_shader_program_data function:

	"Frees all the data that hangs off a shader program object, but not
	the object itself."

This means that this function may be called multiple times on the same object,
(and has been observed to). Meanwhile, the shProg->Label field was not being
set to NULL after its free(). This led to a second call to free() of the same
address on the second call to this function.

Fix this by setting this field to NULL after free(), (just as with all other
calls to free() in this function).

Reviewed-by: Brian Paul <brianp@vmware.com>

CC: mesa-stable@lists.freedesktop.org
2014-02-14 11:45:48 -08:00
Brian Paul
e4a5a9fd2f gallium/pipebuffer: change pb_cache_manager_create() size_factor to float
Requested by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 09:56:55 -07:00
Thomas Hellstrom
141e39a893 svga/winsys: Propagate surface shared information to the winsys
The linux winsys needs to know whether a surface is shared.
For guest-backed surfaces we need this information to avoid allocating a
mob out of the mob cache for shared surfaces, but instead allocate a shared
mob, that is never put in the mob cache, from the kernel.

Also previously, all surfaces were given the "shareable" attribute when
allocated from the kernel. This is too permissive for client-local surfaces.
Now that we have the needed info, only set the "shareable" attribute if the
client indicates that it needs to share the surface.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
fe6a854477 svga/winsys: implement GBS support
This is a squash commit of many commits by Thomas Hellstrom.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom
59e7c59621 gallium/util: Add flush/map debug utility code
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom
8af358d8bc gallium/pipebuffer: Add a cache buffer manager bypass mask
In some situations, it may be desirable to bypass the cache at buffer
creation but to insert the buffer in the cache at buffer destruction.
One such situation is where we already have a kernel representation of a
buffer that we want to use, but we also want to insert it in the cache when
it's freed up.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom
c9e9b1862b pipebuffer, winsys: Add a size match parameter to the cached buffer manager
In some situations it's important to restrict the sizes of buffers that the
cached buffer manager is allowed to return

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
3d1fd6df53 svga: update texture code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
72b0e959fc svga: update buffer code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
e0a6fb09bd svga: add new helper functions for GBS buffers
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
6476bcbc50 svga: remove a couple unneeded assertions
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
f8bbd8261d svga: adjust adjustment for point coordinates
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
d0c22a6d53 svga: track which textures are rendered to
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
c1e60a61e8 svga: add helpers for tracking rendering to textures
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
f84c830b14 svga: update shader code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
2f1fc8db10 svga: update constant buffer code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
31dfefc47f svga: add svga_have_gb_objects/dma() functions
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
823fbfdca7 svga: add new GBS commands
And update some existing commands.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
d993ada50c svga: update svga_winsys interface for GBS
This adds new interface functions for guest-backed surfaces and
adds a mobid parameter to the surface_relocation() function.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
024711385e svga: update dumping code with new GBS commands, etc
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul
2e0c90847f svga: split / update svga3d header files
The old svga3d_reg.h file is split into separate header files and we
add new items for guest-backed surfaces.

Plus some minor code fixes because of renamed symbols.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:43 -07:00
Grigori Goronzy
6d1cecbfd7 st/vdpau: add support for DEINTERLACE_TEMPORAL
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-14 09:05:20 +01:00
Grigori Goronzy
af34c3fd10 vl: add motion adaptive deinterlacer
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-14 08:55:33 +01:00
Leo Liu
f87dfc35bc st/omx/enc: fix scaling src alignment issue
Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-14 08:50:32 +01:00
Alex Deucher
01e6371149 radeon: reverse DBG_NO_HYPERZ logic
Change the flag to DBG_HYPERZ and reverse the logic
so setting the flag enabled the feature.  This disables
hyperz on r600g and radeonsi by default.  It can be
enabled by setting the env var.  There are just too
many issues with certain apps so leave it disabled for
now until we sort out the issues with the problematic
apps.

Bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=58660
https://bugs.freedesktop.org/show_bug.cgi?id=64471
https://bugs.freedesktop.org/show_bug.cgi?id=66352
https://bugs.freedesktop.org/show_bug.cgi?id=68799
https://bugs.freedesktop.org/show_bug.cgi?id=72685
https://bugs.freedesktop.org/show_bug.cgi?id=73088
https://bugs.freedesktop.org/show_bug.cgi?id=74428
https://bugs.freedesktop.org/show_bug.cgi?id=74803
https://bugs.freedesktop.org/show_bug.cgi?id=74863
https://bugs.freedesktop.org/show_bug.cgi?id=74892
https://bugzilla.kernel.org/show_bug.cgi?id=70411

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-02-13 20:55:54 -05:00
Tom Stellard
3c4bd95b62 pipe-loader: Add support for render nodes v2
v2:
   - Add missing call to pipe_loader_drm_release()
   - Fix render node macros
   - Drop render-node configure option
2014-02-13 19:53:15 -05:00
Tom Stellard
8481d208ce pipe-loader: Add auth_x parameter to pipe_loader_drm_probe_fd()
The caller can use this boolean parameter to tell the pipe-loader
to authenticate with the X server when probing a file descriptor.
2014-02-13 19:53:15 -05:00
Christian König
0320ba9988 st/omx/dec/h264: fix pic_order_cnt_type==2
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 18:00:44 +01:00
Ilia Mirkin
0c8b165366 nouveau: fix chipset checks for nv1a by using the oclass instead
Commit f4ebcd133b ("dri/nouveau: NV17_3D class is not available for
NV1a chipset") fixed this partially by using the correct 3d class.
However there were a lot of checks left over comparing against the
chipset.

Reported-and-tested-by: John F. Godfrey <jfgodfrey@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 9.2 10.0 10.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-13 11:06:41 -05:00
Christian König
0ef3ce4155 st/omx: initial OpenMAX H264 encoder v7
v2 (chk): fix eos handling
v3 (leo): implement scaling configuration support
v4 (leo): fix bitrate bug
v5 (chk): add workaround for bug in Bellagio
v6 (chk): fix div by 0 if framerate isn't known,
          user separate pipe object for scale and transfer,
          always flush the transfer pipe before encoding
v7 (chk): make suggested changes, cleanup a bit more,
          only advertise encoder on supported hardware

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-13 11:11:24 +01:00
Christian König
9ff0cf903d radeon/vce: initial VCE support v8
v2 (chk): revert feedback buffer hack
v3 (slava): fixed bitstream size calculation
v4 (chk): always create buffers in the right domain
v5 (chk): flush async
v6 (chk): rework fw interface add version check
v7 (leo): implement cropping support
v8 (chk): add hw checks

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
2014-02-13 11:11:24 +01:00
Christian König
cbdd052577 radeon/winsys: add VCE support v4
v2: add fw version query
v3: add README.VCE
v4: avoid error msg when kernel doesn't support it

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 11:11:24 +01:00
Ilia Mirkin
ef9a6ded10 nv50: mark scissors/viewports dirty on context switch
Commit 246ca4b001 ("nv50: implement multiple viewports/scissors, enable
ARB_viewport_array") added dirty tracking to scissors/viewports. However
it neglected to mark them all as dirty on a context switch. This fixes
an apparent regression in webgl in chrome, but probably in any
application that switches contexts.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-13 10:08:29 +01:00
Christian König
1ef7b9de06 gallium/vl: remove remaining softpipe video functions
Unused and unmaintained for quite a while.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-02-13 09:46:54 +01:00
Ilia Mirkin
18caef953f docs: add nv50 to the ARB_viewport_array list 2014-02-12 22:14:41 -05:00
Ilia Mirkin
246ca4b001 nv50: implement multiple viewports/scissors, enable ARB_viewport_array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-12 21:47:36 -05:00
Ilia Mirkin
a7012eede8 mesa/st: hardcode the viewport bounds range
The bound range is disconnected from the viewport dimensions. This is
the relevant bit from glViewportArray:

"""
The location of the viewport's bottom left corner, given by (x, y) is
clamped to be within the implementaiton-dependent viewport bounds range.
The viewport bounds range [min, max] can be determined by calling glGet
with argument GL_VIEWPORT_BOUNDS_RANGE. Viewport width and height are
silently clamped to a range that depends on the implementation. To query
this range, call glGet with argument GL_MAX_VIEWPORT_DIMS.
"""

Just set it to +/-16384, as that is the minimum required by
ARB_viewport_array and the value that all current drivers provide.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-13 12:44:36 +10:00
Brian Paul
f0e967f212 scons: add meta_blit.c to src/mesa/SConscript 2014-02-12 17:46:11 -07:00
Eric Anholt
255bd9c0b8 meta: Add acceleration for depth glBlitFramebuffer().
Surprisingly, the GLSL shaders already wrote the sampled r value to
FragDepth.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51600
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-12 16:17:11 -08:00
Eric Anholt
067c7b67e8 meta: Use BindRenderbufferTexImage() for meta glBlitFramebuffer().
This avoids a CopyTexImage() on Intel i965 hardware without blorp.

v2: Move the !readAtt check up higher.
v3: Rebase on idr's changes, plus readAtt check is totally gone, and also
    fix a typo in a comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2014-02-12 16:17:11 -08:00
Eric Anholt
f29c25fc1d i965: Add a driver hook for binding renderbuffers to textures.
This will let us use meta's acceleration from renderbuffers without having
to do a CopyTexImage first.

This is like what we do for TFP, but just taking an existing renderbuffer
and binding it to a texture with whatever its format was.  The
implementation won't work for stencil renderbuffers, and it only does
non-texture renderbuffers (but then, if you're using a texture
renderbuffer, you can just pull the texture object/level/slice out of the
renderbuffer, anyway).

v2: Don't forget to propagate NumSamples to the teximage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-12 16:17:11 -08:00
Eric Anholt
431decf16f meta: Do a massive unindent (and rename) of blitframebuffer_texture().
This function is only handling the color case.  We can just unindent as
long as we're willing to do the check for the bit outside of the
function.

v2: Rebase on idr's changes, drop readAtt check that's always non-null
    anyway (it's a pointer into to the statically-allocated attachments
    array in the renderbuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:17:11 -08:00
Eric Anholt
3e4ccf499e meta: Move glBlitFramebuffer() to a separate file.
v2: Drop a bunch of unnecessary includes (by Kenneth), rebase on idr's
    changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:17:08 -08:00
Eric Anholt
81ddbdaaba meta: De-static some of meta's functions.
I want split some meta.c code off to a separate file, so these functions
can't be static any more.

v2: Rebase on idr's changes, also expose setup_blit_shader,
    blit_shader_table_cleanup, setup_vertex_objects,
    setup_ff_tnl_for_blit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:16:03 -08:00
Eric Anholt
2c8f182c86 meta: Move the meta structures to the meta header.
I'd like to split some of our code to separate files, since 4k lines and
growing is pretty unreasonable for all these separate operations.

v2: Rebase on idr's changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 15:38:58 -08:00
Eric Anholt
cd084aa297 meta: Fold the texture setup into setup_copypix_texture().
There was this funny argument passed to setup for "did alloc decide we
need to allocate new texture storage?", which goes away if we don't have
the caller do alloc as a separate step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt
397b2c3966 meta: Drop the src == dst restriction on meta glBlitFramebuffer().
From the GL_ARB_fbo spec:

    If the source and destination buffers are identical, and the
    source and destination rectangles overlap, the result of the blit
    operation is undefined.

As far as I know, that's the only thing that would have been of concern
for this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt
a4f3e2ca0e mesa: Make TexImage error cases about internalFormat more informative.
I tripped over one of these when debugging meta, and it's a lot nicer to
just see the internalFormat being complained about.

v2: Drop a note in the other errors path that there is one early return.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt
56b031d8ae meta: Rename the "sampler" stuff to "blit shader".
While these structs are generated per GLSL sampler type, they're structs
of data-about-shaders (notably, the ID of a shader program), not
data-about-samplers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Eric Anholt
e455c8283b meta: Drop a now-trivial helper function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Eric Anholt
e48a6378c9 meta: Fold the glUseProgram() into the blit program generator.
Everyone was just immediately calling it and doing nothing else with the
shader program id.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Eric Anholt
b719aa3902 meta: Simplify the blit shader setup steps.
The only thing that wants to track the glsl_sampler structure is the
shader string generator.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:57 -08:00
Francisco Jerez
b424da4be0 i965/vec4: Fix confusion between SWIZZLE and BRW_SWIZZLE macros.
Most of the VEC4 back-end agrees on src_reg::swizzle being one of the
BRW_SWIZZLE macros defined in brw_reg.h, except in two places where we
use Mesa's SWIZZLE macros.  There is even a doxygen comment saying
that Mesa's macros are the right ones.  They are incompatible swizzle
representations (3 bits vs. 2 bits per component), and the code using
Mesa's works by pure luck.  Fix it.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:39:42 +01:00
Francisco Jerez
a3a55067bd i965/fs: Remove fs_reg::sechalf.
The same effect can be achieved using ::subreg_offset.  Remove the
less flexible alternative and define a convenience function to keep
the fs_reg interface sane.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:39:24 +01:00
Francisco Jerez
019bf6ed8d i965/fs: Remove fs_reg::smear.
The same effect can be achieved using a combination of ::stride and
::subreg_offset.  Remove the less flexible ::smear to keep the data
members of fs_reg orthogonal.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:07:57 +01:00
Francisco Jerez
756d37b1d6 i965/fs: Add support for specifying register horizontal strides.
v2: Some improvements for copy propagation with non-contiguous
    register strides and mismatching types.
v3: Add example of the situation that the copy propagation changes are
    intended to avoid.  Clarify that 'fs_reg::apply_stride()' is expected
    to work with zero strides too.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:07:57 +01:00
Francisco Jerez
4c7206bafd i965/fs: Add support for sub-register byte offsets to the FS back-end IR.
It would be nice if we could have a single 'reg_offset' field
expressed in bytes that would serve the purpose of both, but the
semantics of 'reg_offset' are quite complex currently (it's measured
in units of one, eight or sixteen dwords depending on the register
file and the dispatch width) and changing it to bytes would be a very
intrusive change at this stage.  Add a separate 'subreg_offset' field
for now.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 23:07:57 +01:00
Brian Paul
248606a5f0 glsl: rename _restrict to restrict_flag
To fix MSVC compile breakage.  Evidently, _restrict is an MSVC keyword,
though the docs only mention __restrict (with two underscores).

Note: we may want to also rename _volatile to volatile_flag to be
consistent.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74900
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 13:37:09 -07:00
Brian Paul
fd0620ff6c mesa: assorted clean-ups in detach_shader()
Fix formatting, add new comments, get rid of extraneous indentation.
Suggested by Ian in bug 74723.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 11:21:47 -07:00
Brian Paul
23d4ff53d4 svga: replace out-of-temps assertion with debug warning
Signed-off-by: Brian Paul <brianp@vmware.com>
2014-02-12 11:21:46 -07:00
Francisco Jerez
76f95ba272 mesa: Handle binding of uniforms to image units with glUniform*().
v2: Set driver-specified flag in NewDriverState when glUniform* is
    used to bind an image unit.
v3: Abbreviate argument type check.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
212122543b glsl/linker: Propagate image uniform access qualifiers to the driver.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
c318a677dd glsl/linker: Assign image uniform indices.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
e51158f2e7 glsl/linker: Count and check image resources.
v2: Add comment about the reason why image variables take up space
    from the default uniform block.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
e8dbe430aa glsl: Add image built-in function generator.
Because of the combinatorial explosion of different image built-ins
with different image dimensionalities and base data types, enumerating
all the 242 possibilities would be annoying and a waste of .text
space.  Instead use a special path in the built-in builder that loops
over all the known image types.

v2: Generate built-ins on GLSL version 4.20 too.  Rename
    '_has_float_data_type' to '_supports_float_data_type'.  Avoid
    duplicating enumeration of image built-ins in create_intrinsics()
    and create_builtins().
v3: Use a more orthodox approach for passing image built-in generator
    parameters.
v4: Cosmetic changes.

Acked-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:06 +01:00
Francisco Jerez
87acc7c650 glsl: Add built-in constants for ARB_shader_image_load_store.
v2: Add them on GLSL version 4.20 too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
6057300ec6 glcpp: Add built-in define for ARB_shader_image_load_store.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
60c89f8bff glsl: Add built-in types defined by ARB_shader_image_load_store.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
7af167d2be glsl/ast: Generalize some sampler variable restrictions to all opaque types.
No opaque types may be statically initialized in the shader, all
opaque variables must be declared uniform or be part of an "in"
function parameter declaration, no opaque types may be used as the
return type of a function.

v2: Add explicit check for opaque types in interface blocks.  Check
    for opaque types in ir_dereference::is_lvalue().

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
2158749e52 glsl/ast: Forbid declaration of image variables in structures and uniform blocks.
Aggregating images inside uniform blocks is explicitly disallowed by
the standard, aggregating them inside structures is not (as of GL
4.4), but there is a similar problem as with atomic counters: image
uniform declarations require either a "writeonly" memory qualifier or
an explicit format qualifier, which are explicitly forbidden in
structure member declarations.  In the resolution of Khronos bug
#10903 the same wording applied to atomic counters was decided to mean
that they're not allowed inside structures -- Rejecting image member
declarations within structures seems the most reasonable option for
now.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
6b28528d1c glsl/ast: Make sure that image argument qualifiers match the function prototype.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
81c167ef1c glsl/ast: Verify that function calls don't discard image format qualifiers.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
94a95e03d9 glsl/ast: Validate and apply memory qualifiers to image variables.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
910311c4a6 glsl/parser: Handle image built-in types.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
f9cf61df3b glsl/parser: Handle image memory qualifiers.
v2: Make the "map" array static const.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
fcd869ed56 glsl/parser: Handle the early_fragment_tests input layout qualifier.
v2: Only allow the early_fragment_tests qualifier in fragment shaders.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
b0b26faa25 glsl/lexer: Add new tokens for ARB_shader_image_load_store.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
299e869d25 glsl/ast: Keep track of type qualifiers defined by ARB_shader_image_load_store.
v2: Add comment next to the read_only and write_only qualifier flags.
    Change temporary copies of the type qualifier mask to use uint64_t
    too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
c116541b2c glsl: Add gl_uniform_storage fields to keep track of image uniform indices.
v2: Promote anonymous struct into named struct.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:05 +01:00
Francisco Jerez
bb13691d1c glsl: Add image memory and layout qualifiers to ir_variable.
v2: Add comment next to the read_only and write_only qualifier flags.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:44:04 +01:00
Francisco Jerez
107d03a6d5 glsl: Add helper methods to glsl_type for dealing with images.
Add predicates to query if a GLSL type is or contains an image.
Rename sampler_coordinate_components() to coordinate_components().

v2: Use assert instead of unreachable.
v3: No need to use a separate code-path for images in
    coordinate_components() after merging image and sampler fields in
    the glsl_type structure.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:43:37 +01:00
Francisco Jerez
8a2508ee07 glsl: Add image type to the GLSL IR.
v2: Reuse the glsl_sampler_dim enum for images.  Reuse the
    glsl_type::sampler_* fields instead of creating new ones specific
    to image types.  Reuse the same constructor as for samplers adding
    a new 'base_type' argument.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:39:48 +01:00
Francisco Jerez
9e611fc72d glsl: Add ARB_shader_image_load_store extension enables.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2014-02-12 18:39:48 +01:00
Fredrik Höglund
9afbd04d89 mesa: Preserve the NewArrays state when copying a VAO
Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72895
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-12 18:22:42 +01:00
Maarten Lankhorst
fee0686c21 nouveau: create only 1 shared screen between vdpau and opengl
This fixes bug 73200 "vdpau-GL interop fails due to different screen
objects" in the same way radeon does.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-12 14:57:25 +01:00
Maarten Lankhorst
572a8345bf gallium makefiles: use a linker script for building dri drivers
Only export __driDriverExtensions by default, and radeon_drm_winsys_create on radeons.
Remove -Bsymbolic which should no longer be needed.

As a side effect, it ought to fix a manifestation of bug 73200 on radeon.

Signed-off-by: Maarten Lankhorst<maarten.lankhorst@canonical.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-12 13:51:51 +01:00
Matt Turner
025d99ce3c glsl: Do not vectorize vector array dereferences.
Array dereferences must have scalar indices, so we cannot vectorize
them.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reported-by: Andrew Guertin <lists@dolphinling.net>
Tested-by: Andrew Guertin <lists@dolphinling.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-11 16:05:55 -08:00
Ian Romanick
4cffd3e791 meta: Enable cubemap array texture support to decompress_texture_image
Fixed piglit test getteximage-targets S3TC CUBE_ARRAY on systems that
don't have libtxc_dxtn installed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
daa3eea877 meta: Add cubemap array support to generic blit shader code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
e68aa12849 meta: Get the correct info log
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
10f7c54477 meta: Expand texture coordinate from vec3 to vec4
This will be necessary to support cubemap array textures because they
use all four components.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
b2ad3dbfa4 meta: Use GLSL to decompress 2D-array textures
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72582
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
c1417aae6c meta: Use common GLSL code for blits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
d524654c34 meta: Improve GLSL version check
We want to use the GLSL 1.30-ish path for OpenGL ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
4825af972a meta: Add rectangle textures to the shader-per-sampler-type table
Rectangle textures were not necessary for mipmap generation (because
they cannot have mipmaps), but all of the future users of this common
code will need to support rectangle textures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
f5a477ab76 meta: Refactor shader generation code out of mipmap generation path
This is quite like code we want for blits.  Pull it out so that it can
be shared by other paths.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
ed3bc38ee7 meta: Refactor the table of glsl_sampler structures
This will allow the same table of shader-per-sampler-type to be used for
paths in meta other than just mipmap generation.  This is also the
reason the declarations of the structures was moved towards the top of
the file.

v2: Code formatting change suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
b514f24101 meta: Use common vertex setup code for _mesa_meta_Bitmap too
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
75227a0968 meta: Add storage to the vertex structure for R, G, B, and A
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Ian Romanick
5e5d87ff32 meta: Use common routine to configure fixed-function TNL state
Also... glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0) *is* the identity
matrix, so drop the unnecessary call to _mesa_Ortho.

v2: Rename setup_ff_TNL_for_blit() to setup_ff_tnl_for_blit().  Seems
    silly to capitalize one out of two to three acronyms in the name
    (change by anholt, acked by idr).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 16:00:12 -08:00
Kenneth Graunke
35e8de383c i965: Fix General and Indirect Base Addresses on Broadwell.
I set the "address modify enable" bit in the wrong DWord.  The first
DWord is the high 16 bits of the address, while the second is the low
32-bits and enable bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:25:45 -08:00
Kenneth Graunke
b0e90ea09f i965: Drop VECTOR_MASK_ENABLE in Broadwell's 3DSTATE_VS packet.
We never set it on previous generations, but I had to set it in
3DSTATE_PS for correct behavior.  For symmetry, I set it in 3DSTATE_VS
as well, but there's no actual need to do so.  Piglit works fine either
way.  The documentation also remarks that there should never be a need
to program this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:25:29 -08:00
Kenneth Graunke
4dd1002518 i965/gs: Fix EndPrimitive on Broadwell.
My earlier patch (i965: Reserve space for "Vertex Count" in GS outputs.)
incremented Global Offset for most URB writes to make room for the new
"Vertex Count" field, but failed to shift the URB writes used for
writing control bits.

Confusingly, Global Offset must be incremented by 2 here, rather than 1.
The URB writes we use for actual data are HWord writes, which treat
Global Offset as a 256-bit offset.  These are OWord writes, so it's
treated as a 128-bit offset instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:25:03 -08:00
Kenneth Graunke
5ebfac8d72 i965/vec4: Support arbitrarily large sampler indices on Broadwell+.
I added support for these on Haswell, but forgot to update the Broadwell
code before landing it.  Fixes Piglit's max-samplers test.

v2: Use get_element_ud() for the destination as well as the source.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:24:36 -08:00
Kenneth Graunke
b371734331 i965/fs: Support arbitrarily large sampler indices on Broadwell+.
I added support for these on Haswell, but forgot to update the Broadwell
code before landing it.  Partially fixes Piglit's max-samplers test.

v2: Use get_element_ud() consistently, rather than using it for the
    source but using brw_vec1_grf for the destination..

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:22:22 -08:00
Kenneth Graunke
0e21ba07f2 i965/fs: Fix Broadwell texture header setup to be uncompressed.
MOV_RAW disables masking, but doesn't force the instruction to be
uncompressed.  That needs to be done by hand.

Fixes textureGather and texture offset tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 15:21:10 -08:00
Ian Romanick
1edca151a0 mesa: GL_ARB_half_float_pixel is not optional
Almost every driver already supported it.  All current and future
Gallium drivers always support it, and most existing classic drivers
support it.

This only changes radeon and nouveau.

This extension only adds data types that can be passed to, for example,
glTexImage2D.  It does not add internal formats.  Since you can already
pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues
with those drivers.  Note that r200 and i915 already supported this
extension, and they don't support floating-point textures either.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
6d6a290181 mesa: Fix extension dependency for half-float TexBOs
Half-float TexBOs should require both GL_ARB_half_float_pixel and
GL_ARB_texture_float.  This doesn't matter much in practice.  Every
driver that supports GL_ARB_texture_buffer_object already supports
GL_ARB_half_float_pixel.  We only expose the TexBO extension in core
profiles, and those require GL_ARB_texture_float.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
54b1082828 meta: Silence unused parameter warning in _mesa_meta_CopyTexSubImage
drivers/common/meta.c: In function '_mesa_meta_CopyTexSubImage':
drivers/common/meta.c:3744:52: warning: unused parameter 'rb' [-Wunused-parameter]

Unfortunately, the parameter can't just be removed because it is part of
the dd_function_table::CopyTexSubImage interface.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
d156281cfe meta: Silence unused parameter warning in setup_drawpix_texture
drivers/common/meta.c: In function 'setup_drawpix_texture':
drivers/common/meta.c:1572:30: warning: unused parameter 'texIntFormat' [-Wunused-parameter]

setup_drawpix_texture has never used this paramater.  Before the
refactor commit 04f8193aa it was used in several locations.  After that
commit, texIntFormat was only used in alloc_texture.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:36:43 -08:00
Ian Romanick
f34d599a5b meta: Refactor common VAO and VBO initialization code
v2: Clean up some stray binding calls

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
2014-02-11 14:24:02 -08:00
Ian Romanick
beb33fc5b7 meta: Track the _mesa_meta_DrawPixels VBO just like the others
All of the other meta routines have a particular pattern for creating
and tracking the VAO and VBO.  This one function deviated from that
pattern for no apparent reason.

Almost all of the code added in this patch will be removed shortly.

v2: Drop glDeleteBuffers() of the old, now-uninitialized vbo variable.
    Fixes getteximage-formats and fbo-mipmap-copypix regression when "2"
    landed in the variable (change by anholt).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:23:55 -08:00
Ian Romanick
83c90c9239 meta: Expand the vertex structure for the GenerateMipmap and decompress paths
Final intermediate step leading to some code sharing.  Note that the new
GemerateMipmap and decompress vertex structures are the same as the new vertex
structure in BlitFramebuffer and the others.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
897f975668 meta: Expand the vertex structure for the DrawPixels paths
Another step leading to some code sharing.  Note that the new DrawPixels
vertex structure is the same as the new vertex structure in BlitFramebuffer
and the others.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
d7ac102c7b meta: Expand the vertex structure for the Clear paths
Another step leading to some code sharing.  Note that the new Clear
vertex structure is the same as the new BlitFramebuffer and CopyPixels
vertex structure.

The "sizeof(float) * 7" hack is temporary.  It will magically disappear
in a just a couple more patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
545fd9bc9b meta: Expand the vertex structure for the CopyPixels paths
Another step leading to some code sharing.  Note that the new CopyPixels
vertex structure is the same as the new BlitFramebuffer vertex
structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ian Romanick
9b4e659e62 meta: Expand the vertex structure for the BlitFramebuffer paths
This is the first of several steps leading to some code sharing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-11 14:11:21 -08:00
Ilia Mirkin
908a711313 nv30,nvc0: only claim a single viewport
It should be possible to make this be 16 on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 22:08:01 +00:00
Emil Velikov
82cd6e6317 st/clover: use VISIBILITY_CXXFLAGS where approapriate
Use the c++ visibility flags when building cpp files.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 21:36:52 +00:00
Emil Velikov
7ed32c9af9 omx: use VISIBILITY_CFLAGS to control exported symbols
Initial step of cleaning the exported symbols from targets/omx

 - Mark omx_component_library_Setup as public

v2: Keep export-symbols-regex

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com> (v1)
2014-02-11 21:36:16 +00:00
Emil Velikov
eda9a66f7e osmesa: drop obsolete AM_CXXFLAGS
There is no cpp files during the build process, thus we
can safely drop the unused cxxflags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 21:32:39 +00:00
Emil Velikov
927b9e8eb8 st/vdpau: automake: export only PUBLIC symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-11 21:27:45 +00:00
Emil Velikov
255b39f17a st/vdpau: do not export VdpPresentationQueueTargetCreateX11
The function pointer is retrieved via VdpGetProcAddress just
like all the other vdpau functions and should not be exported.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-11 21:25:11 +00:00
Emil Velikov
d84e0eb406 wayland-egl: automake: add symbol test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 20:19:46 +00:00
Emil Velikov
6405563783 st/egl: automake: avoid exporting all symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 20:19:01 +00:00
Emil Velikov
11926e8997 targets/egl-static: automake: don't export local symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 20:16:55 +00:00
Emil Velikov
5c7f75f70a gbm: automake: add symbol tests
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
33b9c0d465 targets/gbm: automake: do not export internal symbols
Add VISIBILITY_CFLAGS to automake build, so that
only required symbols are exported.

v2: Rebase

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
10e5ffd496 gbm: do not export _gbm_mesa_get_device
This symbol is internal and was never part of the API.
Unused by any of the gbm backends, it makes sense to
simply not export it.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
d00b319f40 gbm: automake: add
VISIBILITY_CFLAGS

Currently the library exports every symbol imaginable,
rather than the ones defined by the API.

Note: This may cause issues for libraries that are linking
agaist libgbm's internals.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
631cc6105d st/gbm: automake: do not export gbm_gallium_drm_device_create
Symbol is internal and was never meant to be exported.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
90ed101322 auxiliary/pipe-loader: automake: avoid exporting all symbols
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
165eecf1f6 egl/dri2/android: free driver_name in dri2_initialize_android error path
v2:
Cleanup driver name if dri2_load_driver() fails. Spotted by Chad

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
76d9f6d972 dri/nouveau: Pass the API into _mesa_initialize_context
Currently we create a OPENGL_COMPAT context regardless of
what was requested by the program. Correct that by retaining
the program's request and passing it into _mesa_initialize_context.

Based on a similar commit for radeon/r200 by Ian Romanick.

Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 19:00:09 +00:00
Emil Velikov
118c36adb4 configure: cleanup libudev handling
Add the explicit note about the required version during configure.
Require the same version (151) of udev when building the pipe-loader.
Mention the udev version requirement in GBM Requires.private.

v2: Resolve a couple of silly typos. Spotted by Ilia
v3: Cleanup platfrom/platform typo. Spotten by Stefan

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 18:59:59 +00:00
Emil Velikov
31f50f3149 gbm: drop unneeded dependency of libudev
As of recently we dlopen the library, additionally the only
code that is including the libudev.h header, is the loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
d57dc6dc30 opencl: do not link against libudev
Previously the linking was required due to dependency of udev in the
pipe-loader. Now this is no longer the case, as we dlopen the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
e19fba7cc6 gallium/tests: do not link against libudev
Previously the linking was required due to dependency of udev in the
pipe-loader. Now this is no longer the case, as we dlopen the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
897e1989da egl-static: stop linking against libudev
No longer required since all the udev code is in the loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
053e095ecb egl_dri2: remove LIBUDEV_CFLAGS from Makefile.am
None of the code within builds or (explicitly) requires udev.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
6fe2ca7a08 configure: drop LIBUDEV_CFLAGS from X11_INCLUDES
The cflags are explicitly included in the only Makefile that
handles udev dependant code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:50 +00:00
Emil Velikov
7536d744ee pipe-loader: drop obsolete libudev.h include
All the udev code is in the loader, so there is no
reason for us to include this header.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:17:49 +00:00
Emil Velikov
929f83376a configure: error out when building radeonsi without gallium-llvm
--enable-gallium-llvm is required by radeonsi. Currently we
check only for LLVM_VERSION_INT which is 0, whenever gallium-llvm
is disabled explicitly.

./configure --with-gallium-drivers=r600,radeonsi --disable-gallium-llvm

v2: Correct typo in error message. Spotted by Tom Stellard

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-11 17:04:18 +00:00
Christian König
4ca8439dce omx/radeonsi: fix target
Another minor typo.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-11 17:10:22 +01:00
Christian König
79aa29d45e omx: fix some minor configure.ac issues
Matt Turner noted the incorrect order, but I somehow forgotten to
change it before pushing upstream. The other one is a typo during rebase.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-11 17:08:42 +01:00
Christian König
ee978aee94 vl: add H264 encoding interface
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-11 13:26:13 +01:00
Kenneth Graunke
eaf3358e0a i965: Don't call abort() on an unknown device.
If we don't recognize the PCI ID, we can't reasonably load the driver.
However, calling abort() is quite rude - it means the application that
tried to initialize us (possibly the X server) can't continue via
fallback paths.  We already have a more polite mechanism - failing to
create the context.  So, just use that.

While we're at it, improve the error message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73024
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lu Hua <huax.lu@intel.com>
2014-02-11 02:23:22 -08:00
Daniel Kurtz
b47d231526 glsl: Add locking to builtin_builder singleton
Consider a multithreaded program with two contexts A and B, and the
following scenario:

1. Context A calls initialize(), which allocates mem_ctx and starts
   building built-ins.
2. Context B calls initialize(), which sees mem_ctx != NULL and assumes
   everything is already set up.  It returns.
3. Context B calls find(), which fails to find the built-in since it
   hasn't been created yet.
4. Context A finally finishes initializing the built-ins.

This will break at step 3.  Adding a lock ensures that subsequent
callers of initialize() will wait until initialization is actually
complete.

Similarly, if any thread calls release while another thread is still
initializing, or calling find(), the mem_ctx/shader would get free'd while
from under it, leading to corruption or use-after-free crashes.

Fixes sporadic failures in Piglit's glx-multithread-shader-compile.

Bugzilla: https://bugs.freedesktop.org/69200
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org>
2014-02-11 02:21:41 -08:00
Kenneth Graunke
e95a4ed296 i965/fs: Simplify FS_OPCODE_SET_OMASK stride mashing a bit.
In the first case, we can simply call stride(mask, 16, 8, 2) rather than
creating a new register with a different stride, then immediately
changing it a second time.

In the second case, the stride was already what we wanted, so we can
just use mask without any changes at all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-11 02:21:35 -08:00
Kenneth Graunke
f948ad2a07 i965/fs: Simplify FS_OPCODE_SET_SAMPLE_ID stride mashing a bit.
stride(brw_vec1_reg(...) ...) takes some register, changes the strides,
then changes the strides again.  Let's do it once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-11 02:21:26 -08:00
Dave Airlie
08fd34c8a3 docs/GL3.txt: denote r600g support for ARB_viewport_array
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:15:18 +10:00
Dave Airlie
6d434252e2 r600g: add support for multiple viewports.
tested on rv635 and barts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:14:50 +10:00
Dave Airlie
0705fa35cd st/mesa: add support for GL_ARB_viewport_array (v0.2)
this just ties the mesa code to the pre-existing gallium interface,
I'm not sure what to do with the CSO stuff yet.

0.2: fix min/max bounds

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:14:50 +10:00
Dave Airlie
c116ee6042 st/mesa: add support for viewport index semantic
This adds GS output and FS input support, even though FS input
support isn't supported until GLSL 4.30 from what I can see.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-11 14:06:40 +10:00
Kenneth Graunke
a21552a96b i965: Program 2x MSAA sample positions.
There are only two sensible placements for 2x MSAA samples - and one is
the mirror image of the other.  I chose (0.25, 0.25) and (0.75, 0.75).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-10 08:18:29 -08:00
Kenneth Graunke
f4bc0ac83e i965: Store 4x MSAA sample positions in a scalar value, not an array.
Storing a single value in an array is rather pointless.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-10 08:18:29 -08:00
Kenneth Graunke
16f7510ad3 i965: Duplicate less code in GetSamplePositions driver hook.
The 4x and 8x cases contained identical code for extracting the X and
Y sample offset values and converting them from U0.4 back to float.

Without this refactoring, we'd have to duplicate it a third time in
order to support 2x MSAA.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-10 08:18:28 -08:00
Ilia Mirkin
40dd777b33 nouveau/video: make sure that firmware is present when checking caps
Apparently some players are ill-prepared for us claiming that a decoder
exists only to have creating it fail, and express this poor preparation
with crashes (e.g. flash). Check that firmware is there to increase the
chances of there being a high correlation between reported capabilities
and ability to create a decoder.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.0 10.1 <mesa-stable@lists.freedesktop.org>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-02-10 14:00:17 +01:00
Kenneth Graunke
a487ef87fe mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.
In commit eeed49f5f2, Mark accidentally
renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and
MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their
sense.  The commit message was correct, but what sed commands actually
got run didn't match that.

This patch swaps the two enum names, reversing them.  This should undo
the damage, but might break things if people have manually fixed a few
instances in the meantime...

Mark's commit also failed to mention renames:
s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g
s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g
but those seem okay.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-09 16:57:45 -08:00
Maxence Le Doré
b903be50b0 mesa: remove duplicated init of MaxViewports
Already declared 5 lines before.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-09 16:45:23 -08:00
Grigori Goronzy
d34d5fddf8 gallium: add geometry shader output limits
v2: adjust limits for radeonsi and llvmpipe
v3: add documentation

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-02-09 23:31:38 +01:00
Siavash Eliasi
61bc014c96 mesa: Removed unnecessary check for NULL pointer when freeing memory
Note that it is OK to pass NULL pointers to this function since this commit:

mesa: modified _mesa_align_free() to accept NULL pointer
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-09 16:16:34 +01:00
Ilia Mirkin
356aff3a5c nv30: report 8 maximum inputs
nvfx_fragprog_assign_generic only allows for up to 10/8 texcoords for
nv40/nv30. This fixes compilation of the varying-packing tests.
Furthermore it appears that the last 2 inputs on nv4x don't seem to
work in those tests, so just report 8 everywhere for now.

Tested on NV42, NV44. NV4B appears to have additional problems.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 9.1 9.2 10.0 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-08 19:06:51 -05:00
Christoph Bumiller
2e9ee44797 nv50/ir/ra: some register spilling fixes
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-09 00:04:13 +01:00
Brian Paul
c325ec8965 mesa: update assertion in detach_shader() for geom shaders
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74723
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2014-02-08 14:21:28 -07:00
Brian Paul
6e8d04ac3e mesa: allocate gl_debug_state on demand
We don't need to allocate all the state related to GL_ARB_debug_output
until some aspect of that extension is actually needed.

The sizeof(gl_debug_state) is huge (~285KB on 64-bit systems), not even
counting the 54(!) hash tables and lists that it contains.  This change
reduces the size of gl_context alone from 431KB bytes to 145KB bytes on
64-bit systems and from 277KB bytes to 78KB bytes on 32-bit systems.

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 11:27:58 -07:00
Brian Paul
31b2625cb5 mesa: trivial clean-ups in errors.c
Whitespace changes, 78-column rewrapping, comment clean-ups, add
some braces, etc.

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 11:27:58 -07:00
Brian Paul
1dc209d8f2 mesa: remove _mesa_ prefix from some static functions
Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 11:27:57 -07:00
Kenneth Graunke
dcb0330d30 i965: Label JIP and UIP in Broadwell shader disassembly.
This makes it obvious which number is which.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:38:15 -08:00
Kenneth Graunke
8a7fe50067 i965: Don't disassemble UIP field for Broadwell WHILE instructions.
The WHILE instruction doesn't have UIP.  It only has JIP.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:38:12 -08:00
Kenneth Graunke
5230655a2e i965: Don't print source registers for Broadwell flow control.
The bits which normally contain the source register descriptions
actually contain the JIP/UIP jump targets, which we already printed.

Interpreting JIP/UIP as source registers results in some really creepy
looking output, like IF statements with acc14.4<0,1,0>UD sources.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:37:34 -08:00
Kenneth Graunke
8e0a0e4d30 i965: Fix fast depth clear values on Broadwell.
Broadwell's 3DSTATE_CLEAR_PARAMS packet expects a floating point value
regardless of format.  This means we need to stop converting it to
UNORM.

Storing the value as float would make sense, but since we already have a
uint32_t field, this patch continues shoehorning it into that.  In a
sense, this makes mt->depth_clear_value the DWord you emit in the
packet, rather than the clear value itself.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-07 19:36:14 -08:00
Christoph Bumiller
882e98e5e6 nvc0: handle TGSI_SEMANTIC_LAYER
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
2014-02-07 23:14:00 +01:00
Christoph Bumiller
dd2229d4c6 nvc0: create the SW object
It's required for being able to use software methods now.
2014-02-07 22:53:37 +01:00
Christoph Bumiller
b7233acf78 nvc0/ir/emit: hardcode vertex output stream to 0 for now 2014-02-07 22:53:36 +01:00
Chris Forbes
0c14c5c62a i965: Enable ARB_texture_gather for one component on Gen6.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:24 +13:00
Chris Forbes
31d1077dd2 i965/vec4: Emit shader w/a for Gen6 gather
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:23 +13:00
Chris Forbes
73b91fe05a i965/fs: Emit shader w/a for Gen6 gather
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:20 +13:00
Chris Forbes
c2d51aaa11 i965: Add surface format overrides for Gen6 gather
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:19 +13:00
Chris Forbes
2b7bbd89e8 i965: Add Gen6 gather wa to sampler key
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-08 10:32:06 +13:00
Eric Anholt
1e12dafcac glsl: Optimize triop_csel with all-true or all-false.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
de796b0ef0 glsl: Optimize various cases of fma (aka MAD).
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
44577c4857 glsl: Optimize lrp(x, x, coefficient) --> x.
total instructions in shared programs: 1627754 -> 1624534 (-0.20%)
instructions in affected programs:     45748 -> 42528 (-7.04%)
GAINED:                                3
LOST:                                  0

(serious sam, humus domino demo)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
d72956790f glsl: Optimize pow(x, 1) -> x.
total instructions in shared programs: 1627826 -> 1627754 (-0.00%)
instructions in affected programs:     6640 -> 6568 (-1.08%)
GAINED:                                0
LOST:                                  0

(HoN and savage2)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:48 -08:00
Eric Anholt
6d7c123d6c glsl: Optimize log(exp(x)) and exp(log(x)) into x.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-07 12:46:47 -08:00
Eric Anholt
2c2aa35336 glsl: Optimize ~~x into x.
v2: Fix pasteo of an extra abs being inserted (caught by many).  Rewrite
    to drop the silly switch statement.

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2014-02-07 12:46:47 -08:00
Eric Anholt
0f6279bab2 i965: Add some informative debug when the X Server botches DRI2 GetBuffers.
We've had various bug reports over the years where miptrees are missing,
and when I screwed it up while adding DRI2 to the modesetting driver, I
figured I should put the info necessary for debug here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-07 12:46:47 -08:00
Eric Anholt
b5e5f34dd2 i965: Remove redundant check in blitter-based glBlitFramebuffer().
The intel_miptree_blit() code checks the format for us now, plus it
handles xrgb vs argb for us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-07 12:46:47 -08:00
Kenneth Graunke
697f401a31 i965: Fix Gen8+ disassembly of half float subregister numbers.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
e990234ff6 i965: Use the new brw_load_register_mem helper for draw indirect.
This makes it work on Broadwell, too.

v2: Drop bogus double write to 3DPRIM_BASE_VERTEX register
    (caught by Chris Forbes).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
b7c435b261 i965: Implement a brw_load_register_mem helper function.
This saves some boilerplate and hides the OUT_RELOC/OUT_RELOC64
distinction.

Placing the function in intel_batchbuffer.c is rather arbitrary; there
wasn't really an obvious place for it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
2f97119950 i965: Fix INTEL_DEBUG=vs for fixed-function/ARB programs.
Since commit 9cee3ff562, INTEL_DEBUG=vs
has caused a NULL pointer dereference for fixed-function/ARB programs.

In the vec4 generators, "prog" is a gl_program, and "shader_prog" is the
gl_shader_program.  This is different than the FS visitor.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-07 12:36:38 -08:00
Kenneth Graunke
2062f40d81 glsl: Don't lose precision qualifiers when encountering "centroid".
Mesa fails to retain the precision qualifier when parsing:

   #version 300 es
   centroid in mediump vec2 v;

Consider how the parser's type_qualifier production is applied.
First, the precision_qualifier rule creates a new ast_type_qualifier:

    <precision: mediump>

Then the storage_qualifier rule creates a second one:

    <flags: in>

and calls merge_qualifier() to fold in any previous qualifications,
returning:

    <flags: in, precision: mediump>

Finally, the auxiliary_storage_qualifier creates one for "centroid":

    <flags: centroid>

it then does $$ = $1 and $$.flags |= $2.flags, resulting in:

    <flags: centroid, in>

Since precision isn't stored in the flags bitfield, it is lost.  We need
to instead call merge_qualifier to combine all the fields.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-07 12:36:38 -08:00
Brian Paul
f47e596288 st/mesa: avoid sw fallback for getting/decompressing textures
If st_GetTexImage() is to decompress the texture, avoid the fallback
path even if prefer_blit_based_texture_transfer = false.  For drivers
that returned PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER = 0, we
were always taking the fallback path for texture decompression rather
than rendering a quad.  The later is a lot faster.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-07 09:54:43 -07:00
Erik Faye-Lund
5125165dde gallium/tgsi: correct typo propagated from NV_vertex_program1_1
In the specification text of NV_vertex_program1_1, the upper
limit of the RCC instruction is written as 1.884467e+19 in
scientific notation, but as 0x5F800000 in binary. But the binary
version translates to 1.84467e+19 rather than 1.884467e+19 in
scientific notation.

Since the lower-limit equals 2^-64 and the binary version equals
2^+64, let's assume the value in scientific notation is a typo
and implement this using the value from the binary version
instead.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:22:23 -07:00
Erik Faye-Lund
7a49a796a4 gallium/tgsi: use CLAMP instead of open-coded clamps
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:22:14 -07:00
Juha-Pekka Heikkila
498d10e230 egl: Unhide functionality in _eglInitSurface()
_eglInitResource() was used to memset entire _EGLSurface by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLSurface,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
1456ed85f0 egl: Unhide functionality in _eglInitContext()
_eglInitResource() was used to memset entire _EGLContext by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLContext,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
d530745169 glx: Add missing null check in __glX_send_client_info()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
d3e948340b i965: Add missing null check in fs_visitor::dead_code_eliminate_local()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
e503609e6f glx: Add some missing null checks in glx_pbuffer.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:05 -07:00
Juha-Pekka Heikkila
88cad8356e glsl: Fix null access on file read error
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Juha-Pekka Heikkila
2ae1437a8e glx: Add missing null check in __glXCloseDisplay
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Juha-Pekka Heikkila
d28e92ff74 glx: Add missing null checks in glxcmds.c
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-07 08:14:04 -07:00
Jordan Justen
020c43f401 main/get: support ARB_gpu_shader5
If a driver enables ARB_gpu_shader5 and sets Const.MaxVertexSteams >= 4,
then piglit's arb_gpu_shader5-minmax test should now pass.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-06 16:58:33 -08:00
Jordan Justen
60914fa80d glapi: add definitions for ARB_gpu_shader5
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-06 16:58:33 -08:00
Ilia Mirkin
0befbafb4b nouveau/codegen: allow tex offsets on non-TXF instructions (e.g. TXL)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:50:19 -05:00
Ilia Mirkin
f76c7ad5b1 nv50: only over-allocate by a page for code
The pre-fetching doesn't go too far. Tested with over-allocating by only
a page, and didn't see any errors in dmesg. Saves ~512KB of VRAM.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:50:19 -05:00
Ilia Mirkin
364bdd2419 nv50: fix layerid to be the fp input number rather than vp output number
In the tests they were the same so it didn't matter, but indications are
that this is the correct behaviour. Also take this opportunity to
(trivially) support using gl_Layer in fp.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:03:24 -05:00
Ilia Mirkin
c7373b7dc7 nv50: rework primid logic
Functionally identical but much simpler. Should also better integrate
with future layer/viewport changes/fixes.

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-06 18:02:57 -05:00
Kristian Høgsberg
f658150639 glx: Pass NULL DRI drawables into the DRI driver for None GLX drawables
GLX_ARB_create_context allows making a GLX context current with None
drawable and readables, but this was never implemented correctly in GLX.
We would create a __DRIdrawable for the None GLX drawable and pass that
to the DRI driver and that would somehow work.  Now it's somehow broken.

The way this should have worked is that we pass a NULL DRI drawable
to the DRI driver when the GLX user calls glXMakeContextCurrent()
with None for drawable and readables.

https://bugs.freedesktop.org/show_bug.cgi?id=74143
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-06 14:23:42 -08:00
Christian König
db54fca9b8 st/vdpau: add flush on unmap
Flush the context when we unmap a buffer, otherwise VDPAU might
start rendering the next frame while we still reference that buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: StrangeNoises (rachel@strangenoises.org)
2014-02-06 20:58:38 +01:00
Marek Olšák
3f98053fc9 vdpau: flush the context before exporting the surface v2
Bugzilla (bug needs XBMC changes as well):
https://bugs.freedesktop.org/show_bug.cgi?id=73191

When VL uploads vertex buffers, it uses PIPE_TRANSFER_DONTBLOCK, which always
flushes the context in the winsys if the buffer being mapped is busy. Since
I added handling of DISCARD_RANGE, DONTBLOCK has had no effect when combined
with DISCARD_RANGE and I think the context isn't flushed anywhere else,
so no commands are submitted to the GPU until the IB is full, which takes
a lot of frames.

Using DISCARD_RANGE is not the only way to trigger this bug. The other way
is to reallocate the vertex buffer before every upload.

BTW, I'm not sure if this is the right place for flushing, but it does fix
the bug.

v2 (chk): move the flush to the right place.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: StrangeNoises (rachel@strangenoises.org)
2014-02-06 20:58:07 +01:00
Matt Turner
e2ef93cf94 glsl: Initialize ubo_binding_mask flags to zero.
Missed in commit e63bb298. Caused sporadic test failures, like
incorrect-in-layout-qualifier-repeated-prim.geom.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-06 10:36:54 -08:00
Marek Olšák
559af1df10 gallium/radeon: fix warnings 2014-02-06 17:43:29 +01:00
Marek Olšák
c32114460d gallium: remove PIPE_USAGE_STATIC
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:37:34 +01:00
Marek Olšák
eeb5a4a50e gallium: define the behavior of PIPE_USAGE_* flags properly
STATIC will be removed in the following commit.

v2: changed the definition of IMMUTABLE

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:30:00 +01:00
Marek Olšák
ed84fb3167 gallium: remove PIPE_RESOURCE_FLAG_GEN_MIPS
Unused.

Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:30:00 +01:00
Marek Olšák
2be5bbdd97 r600g,radeonsi: set resource domains in one place (v2)
v2: This doesn't change the behavior. It only moves the tiling check
    to r600_init_resource and removes the usage parameter.

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-06 17:29:59 +01:00
Marek Olšák
c6dbcf10df st/mesa: fix crash when a shader uses a TBO and it's not bound
This binds a NULL sampler view in that case.

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

Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-06 17:29:59 +01:00
Christian König
b862cc23f2 st/omx: add workaround for bug in Bellagio
Not blocking for the message thread can lead to accessing freed up memory.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:19:39 +01:00
Christian König
15e39ca28a st/omx: initial OpenMAX support v3
Featuring a full grown MPEG2 and H264 decoder and a couple of hundred bugs.

v2 (Leo): fix an error for pic_order_cnt_type 1
v3 (Leo): implement support for field decoding

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-06 16:16:34 +01:00
Christian König
c9b941ff1b vl/rbsp: add H.264 RBSP implementation
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:16:33 +01:00
Christian König
b8b28bf94a vl/vlc: add function to limit the vlc size
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:16:33 +01:00
Christian König
9ef42a54a7 vl/vlc: add remove bits function
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:16:33 +01:00
Christian König
fe0f9ab056 radeon: update legal notes on UVD
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 16:15:58 +01:00
Christian König
96e8b916a7 radeon: just don't map VRAM buffers at all
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-02-06 16:08:22 +01:00
Christian König
9b218dcdd7 radeon/video: directly create buffers in the right domain
Avoid moving things around on start of stream.

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 15:54:14 +01:00
Christian König
7bcfb0bc8f radeon/video: seperate common video functions
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-06 15:54:13 +01:00
Axel Davy
57f94bff71 gallium/dri2: Fix dri2_dup_image
dri2_dup_image was not copying the dri_format field.

This was causing some bugs, for example:
. we create an gbm_bo.
. we get an EGLImage from the gbm_bo.
. Bug: impossible to get again the gbm_bo from the EGLImage by
  importing. (gbm dri2 backend)

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2014-02-05 22:22:00 -08:00
Chris Forbes
bba1105d52 i965/vs: Fix typo in brw_compute_vue_map
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-05 22:02:23 -08:00
Kenneth Graunke
e57d77280e i965: Fix register types in dump_instructions().
This regressed when I converted BRW_REGISTER_TYPE_* to be an abstract
type that doesn't match the hardware description.  dump_instruction()
was using reg_encoding[] from brw_disasm.c, which no longer matches
(and was incorrect for Gen8+ anyway).

This patch introduces a new function to convert the abstract enum values
into the letter suffix we expect.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 21:07:48 -08:00
Chad Versace
1340e24406 egl/glx: Remove egl_glx driver
Mesa now has a real, feature-rich EGL implementation on X11 via xcb.
Therefore I believe there is no longer a practical need for the egl_glx
driver.

Furthermore, egl_glx appears to be unmaintained.  The most recent
nontrivial commit to egl_glx was 6baa5f1 on 2011-11-25.

Tested by running weston-smoke in windowed Weston on X with i965.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
2014-02-05 18:19:26 -08:00
Dave Airlie
0224bd20f3 docs: update 10.1 relnotes to note GL 3.3 on r600 and radeonsi.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-06 01:13:05 +00:00
Zack Rusin
8a3c990823 tgsi/ureg: increase the number of immediates
ureg_program is allocated on the heap so we can just bump the
number of immediates that it can handle. It's needed for d3d10.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Zack Rusin
efb152dd04 gallivm: make sure analysis works with large number of immediates
We need to handle a lot more immediates and in order to do that
we also switch from allocating this structure on the stack to
allocating it on the heap.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Zack Rusin
69ee3f431f gallivm: handle huge number of immediates
We only supported up to 256 immediates, which isn't enough. We had
code which was allocating immediates as an allocated array, but it
was always used along a statically backed array for performance
reasons. This commit adds code to skip that performance optimization
and always use just the dynamically allocated immediates if the
number of them is too great.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Zack Rusin
8507afc97f gallivm: allow large numbers of temporaries
The number of allowed temporaries increases almost with every
iteration of an api. We used to support 128, then we started
increasing and the newer api's support 4096+. So if we notice
that the number of temporaries is larger than our statically
allocated storage would allow we just treat them as indexable
temporaries and allocate them as an array from the start.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-05 19:40:53 -05:00
Chris Forbes
5eeb12c0bc i965/fs: Assume FBO rendering in precompile if MRT.
If multiple color outputs are written, this shader is unlikely to be
useful with a winsys framebuffer.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-06 10:58:52 +13:00
Chris Forbes
046f8d8a6f i965/fs: Guess nr_color_regions better in precompile
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-06 10:58:37 +13:00
Chris Forbes
6c9de691c7 docs: Add relnotes for 10.2
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-06 10:28:36 +13:00
Chris Forbes
87e916a240 mesa: Bump version to 10.2.0-devel
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-02-06 10:15:09 +13:00
Kristian Høgsberg
44338cd826 i965: Move intel_prepare_render() above first buffer access
The driver is supposed to ensure buffers before any drawing operation, but in
do_blit_drawpixels() and do_blit_copypixels() we inspect the buffer format
before calling intel_prepare_render().  That was covered up by the
unconditional call to intel_prepare_render() in intelMakeCurrent(), but we
now only do this on the initial intelMakeCurrent call for a context
(to get the size for the initial viewport values).

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

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Alexander Monakov <amonakov@gmail.com>
2014-02-05 11:10:39 -08:00
Brian Paul
db98d238e2 st/mesa: add MESA_SHADER_COMPUTE case in shader_stage_to_ptarget()
Silences compiler warning.  Trivial.
2014-02-05 11:00:41 -07:00
Brian Paul
357faa5a36 mesa: re-wrap, fix-up comment text in formats.h
Wrap to 78 columns, fix comment formatting.
Trivial.
2014-02-05 10:43:21 -07:00
Paul Berry
25268b930d i965/cs: Allow ARB_compute_shader to be enabled via env var.
This will allow testing of compute shader functionality before it is
completed.

To enable ARB_compute_shader functionality in the i965 driver, set
INTEL_COMPUTE_SHADER=1.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:14:16 -08:00
Paul Berry
3bbf93045a i965/cs: Create the brw_compute_program struct, and the code to initialize it.
v2: Fix comment.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:05:04 -08:00
Paul Berry
1fe274b3d7 glsl/cs: Prohibit mixing of compute and non-compute shaders.
Fixes piglit test:
spec/ARB_compute_shader/linker/mix_compute_and_non_compute

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:05:01 -08:00
Paul Berry
5a79bdab30 glsl/cs: Prohibit user-defined ins/outs in compute shaders.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:04:58 -08:00
Paul Berry
f5c5438e1f main/cs: Implement query for COMPUTE_WORK_GROUP_SIZE.
v2: Improve error message.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:04:55 -08:00
Paul Berry
28ce604b7f mesa/cs: Handle compute shader local size during linking.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:04:20 -08:00
Paul Berry
0fa74e848f glsl/cs: Handle compute shader local_size_{x,y,z} declaration.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:03:44 -08:00
Paul Berry
0398b69954 mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_COUNT constant.
v2: Document that the 3-element array MaxComputeWorkGroupCount is
indexed by dimension.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:03:08 -08:00
Paul Berry
c85c50997f mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_INVOCATIONS constant.
Reviewed-by: Matt Turner <mattst88@gmail.com>

v2: Use CONTEXT_INT rather than CONTEXT_ENUM.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:02:30 -08:00
Paul Berry
347dde82e6 mesa/cs: Implement MAX_COMPUTE_WORK_GROUP_SIZE constant.
v2: Document that the 3-element array MaxComputeWorkGroupSize is
indexed by dimension.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-02-05 09:01:54 -08:00
Paul Berry
47d480e3e4 mesa/cs: Create the gl_compute_program struct, and the code to initialize it.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:18 -08:00
Paul Berry
9b34ae2e64 mesa/cs: Handle compute shaders in _mesa_use_program().
v2: do cs after the ordered pipeline stages for consistency.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:16 -08:00
Paul Berry
c15064c169 glsl/cs: update main.cpp to use the ".comp" extension for compute shaders.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:13 -08:00
Paul Berry
d861c2963a glsl/cs: Populate default values for ctx->Const.Program[MESA_SHADER_COMPUTE].
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:01:10 -08:00
Paul Berry
c61ec8d8e3 mesa/cs: Add a MESA_SHADER_COMPUTE stage and update switch statements.
This patch adds MESA_SHADER_COMPUTE to the gl_shader_stage enum.
Also, where it is trivial to do so, it adds a compute shader case to
switch statements that switch based on the type of shader.  This
avoids "unhandled switch case" compiler warnings.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:34 -08:00
Paul Berry
28e526d558 glsl/cs: Change some linker loops to use MESA_SHADER_FRAGMENT as a bound.
Linker loops that iterate through all the stages in the pipeline need
to use MESA_SHADER_FRAGMENT as a bound, so that we can add an
additional MESA_SHADER_COMPUTE stage, without it being erroneously
included in the pipeline.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:31 -08:00
Paul Berry
79134cb516 mesa/cs: Add dispatch API stubs for ARB_compute_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 09:00:14 -08:00
Paul Berry
b7d05a58ae mesa/cs: Add extension enable flags for ARB_compute_shader.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-05 08:59:37 -08:00
Roland Scheidegger
4a7da3bec5 gallivm: fix F2U opcode
Previously, we were really doing F2I. And also move it to generic section.
(Note that for llvmpipe the code generated is definitely bad, due to lack
of unsigned conversions with sse. I think though what llvm does (using scalar
conversions to 64bit signed either with x87 fpu (32bit) or sse (64bit)
including lots of domain changes is quite suboptimal, could do something like
is_large = arg >= 2^31
half_arg = 0.5 * arg
small_c = fptoint(arg)
large_c = fptoint(half_arg) << 1
res = select(is_large, large_c, small_c)
which should be much less instructions but that's something llvm should do
itself.)

This fixes piglit fs/vs-float-uint-conversion.shader_test (maybe more, needs
GL 3.0 version override to run.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
2014-02-05 17:45:31 +01:00
José Fonseca
5c975966dc tools/trace: Handle index buffer overflow gracefully.
Trivial.
2014-02-05 10:58:38 +00:00
Dave Airlie
16215a9723 docs/GL3.txt: update r600 status
This updates the r600 driver status to 3.3 being fully supported.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-05 10:56:58 +10:00
Dave Airlie
79ea0f4506 r600g: add support for geom shaders to r600/r700 chipsets (v2)
This is my first attempt at enabling r600/r700 geometry shaders,
the basic tests pass on both my rv770 and my rv635,

It requires this kernel patch:
http://www.spinics.net/lists/dri-devel/msg52745.html

v2: address Alex comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:43 +10:00
Dave Airlie
ccea799ee3 r600g: enable GLSL 3.30 on evergreen GPUs
This throws the switch to enable GL 3.3 and GLSL 330.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:43 +10:00
Dave Airlie
c6cfc54db0 r600g: properly propogate clip dist write value
This moves the value from the GS shader to the copy shader so the registers
are setup correctly.

fixes tests/spec/glsl-1.50/execution/geometry/clip-distance-out-values.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:43 +10:00
Dave Airlie
b209afb153 r600g: calculate a better value for array_size (v2)
attempt to calculate a better value for array size to avoid breaking apps.

v2: use 0xfff like streamout, suggested by Grigori

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:42 +10:00
Dave Airlie
ce9e939144 r600g: fix CAYMAN geometry shader support
cayman has a different end of program bit, so do that properly.

fixes hangs with geom shader tests on cayman.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:42 +10:00
Dave Airlie
7ec5e883f2 r600g: fix up shader out misc stuff for copy shader
set the correct values so the misc out register is setup correctly
for the copy shader.

This also updates the state for the gs copy shader so the hw
gets programmed correctly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:42 +10:00
Dave Airlie
7863611de3 r600g: port the layered surface rendering patch from radeonsi
This just makes r600 and evergreen do what the radeonsi codepaths do
for layered rendering. This makes the 2d amd_vertex_shader_layer test
pass on evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
f89394be98 r600g: initial VS output layer support
This just adds support for emitting the proper value in the VS out misc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
5191937352 r600g: setup const texture buffers for geom shaders
This just enables the workarounds we have for vertex/pixel shaders
for geom shaders as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
afce47fb0b r600g: calculate correct cut value
This selects the cut value depending on the shader selected.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:41 +10:00
Dave Airlie
0d79d5da40 r600g: fix dynamic_input_array_index.shader_test
This follows what fglrx does, it unpacks the input we are
going to indirect into a bunch of registers and indirects
inside them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:40 +10:00
Dave Airlie
e12147e9f6 r600g: add support for indirect geom ring writes
We need to be able to write to the ring using a base register
for when we emit vertices in a loop, in theory the SB compiler
could collapse these indirect writes to direct writes if the
register value is constant and known, but that is outside my
pay grade.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:40 +10:00
Dave Airlie
cda63db780 r600g: write proper output prim type
Vadim's code derived it from the info.mode, but it needs
to be takes from the geometry shader output primitive.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:40 +10:00
Dave Airlie
2b0be2015d r600g: enable instance cnt register with new enough kernel
The instance cnt register was missing for a few kernels,
with a new enough kernel we can output it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
f4652babbd r600g: add primitive input support for gs
only enable prim id if gs uses it

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
b0e842bd9f r600g: emit streamout from dma copy shader
This enables streamout with GS in the mix, from the
VS dma shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
20adc7449c r600g/gs: fix cases where number of gs inputs != number of gs outputs
this fixes a bunch of the geom shader built-in tests

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:39 +10:00
Dave Airlie
defebc0293 r600g: increase array base for exported parameters
Trivial fix to Vadim's code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:38 +10:00
Dave Airlie
d9954e402f r600g: initialise the geom shader loop registers.
As we do for vertex and pixel shaders.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:38 +10:00
Dave Airlie
461c463bb2 r600g: emit NOPs at end of shaders in more cases
If the shader has no CF clauses at all emit an nop
If the last instruction is an ENDLOOP add a NOP for the LOOP to go to
if the last instruction is CALL_FS add a NOP

These fix a bunch of hangs in the geometry shader tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:38 +10:00
Dave Airlie
c4782a58c3 r600g: don't enable SB for geom shaders
SB needs fixes for three GS instructions it seems to raise
them outside loops etc despite my best efforts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:37 +10:00
Dave Airlie
5758a76d04 r600g/sb: add MEM_RING support
Although we don't use SB on geom shaders, the VS copy shader will use it
so we might as well implement MEM_RING support in sb.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:37 +10:00
Dave Airlie
eeead9b8ed r600g: don't fail if we can't map VS->GS ring entries
This can happen in normal operation, so don't report an error on it,
just continue.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:37 +10:00
Vadim Girlin
1371d65a7f r600g: initial support for geometry shaders on evergreen (v2)
This is Vadim's initial work with a few regression fixes squashed in.

v2: (airlied)
fix regression in glsl-max-varyings - need to use vs and ps_dirty
fix regression in shader exports from rebasing.
whitespace fixing.
v2.1: squash fix assert

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:49:11 +10:00
Vadim Girlin
34ee1d0f9f r600g: add hw register definitions for GS block setup
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:40:42 +10:00
Vadim Girlin
a144bc29b5 r600g: defer shader variant selection and depending state updates
[airlied: fix dropped streamout line - fix for master]

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:40:38 +10:00
Dave Airlie
ae29a098ea r600g/bc: add support for indexed memory writes.
It looks like we need these for geom shaders in the future.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-05 10:40:33 +10:00
Vadim Girlin
552aae7e47 r600g: move barrier and end_of_program bits from output to cf struct (v2)
v2: fix regression on r600 NOP instructions.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-05 10:40:23 +10:00
Dave Airlie
29a43cb0b6 r600g: split streamout emit code into a separate function
For geometry shaders we need to call this code from a second place.

Just move it out for now to keep future patches cleaner.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-05 10:40:17 +10:00
Marek Olšák
07075cf350 r600g,radeonsi: skip unnecessary buffer_is_busy call, add a comment 2014-02-04 20:19:16 +01:00
Marek Olšák
08f0344cf3 r600g,radeonsi: skip busy-checking for DISCARD_RANGE if it has been done already 2014-02-04 20:19:16 +01:00
Marek Olšák
796e2fba8c r600g,radeonsi: treat DYNAMIC and STREAM usage as STAGING 2014-02-04 20:19:16 +01:00
Marek Olšák
0354b769c2 gallium: remove PIPE_CAP_MAX_COMBINED_SAMPLERS
This can be derived from the shader caps.

All GPUs from ATI/AMD, NVIDIA, and INTEL have separate texture slots
for each shader stage.
2014-02-04 20:19:16 +01:00
Brian Paul
82c0914266 mesa: remove stray bits of GL_EXT_cull_vertex
GL_EXT_cull_vertex was removed back in 2010 in commit 02984e3536
but these bits still lingered.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-04 11:53:21 -07:00
Paul Berry
7f5740899f glsl: Fix continue statements in do-while loops.
From the GLSL 4.40 spec, section 6.4 (Jumps):

    The continue jump is used only in loops. It skips the remainder of
    the body of the inner most loop of which it is inside. For while
    and do-while loops, this jump is to the next evaluation of the
    loop condition-expression from which the loop continues as
    previously defined.

Previously, we incorrectly treated a "continue" statement as jumping
to the top of a do-while loop.

This patch fixes the problem by replicating the loop condition when
converting the "continue" statement to IR.  (We already do a similar
thing in "for" loops, to ensure that "continue" causes the loop
expression to be executed).

Fixes piglit tests:
- glsl-fs-continue-inside-do-while.shader_test
- glsl-vs-continue-inside-do-while.shader_test
- glsl-fs-continue-in-switch-in-do-while.shader_test
- glsl-vs-continue-in-switch-in-do-while.shader_test

Cc: mesa-stable@lists.freedesktop.org

Acked-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-04 09:06:09 -08:00
Paul Berry
56790856b3 glsl: Make condition_to_hir() callable from outside ast_iteration_statement.
In addition to making it public, we also need to change its first
argument from an ir_loop * to an exec_list *, so that it can be used
to insert the condition anywhere in the IR (rather than just in the
body of the loop).

This will be necessary in order to make continue statements work
properly in do-while loops.

Cc: mesa-stable@lists.freedesktop.org

Acked-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-02-04 09:06:09 -08:00
Topi Pohjolainen
933be19cdf i965/blorp: do not use unnecessary hw-blending support
This is really not needed as blorp blit programs already sample
XRGB normally and get alpha channel set to 1.0 automatically by
the sampler engine. This is simply copied directly to the payload
of the render target write message and hence there is no need for
any additional blending support from the pixel processing pipeline.

The blending formula is anyway broken for color components, it
multiplies the color component with itself (blend factor is the
component itself).
Alpha blending in turn would not fix the alpha to one independent
of the source but simply used the source alpha as is instead
(1.0 * src_alpha + 0.0 * dst_alpha).

Quoting Eric:

 "If we want to actually make the no-alpha-bits-present thing work,
  we need to override the bits in the surface state or in the
  generated code.  In the normal draw path, it's done for sampling
  by the swizzling code in brw_wm_surface_state.c, and the blending
  overrides is just to fix up the alpha blending stage which
  doesn't pay attention to that for the destination surface."

If one modifies piglit test gl-3.2-layered-rendering-blit to use
color component values other than zero or one, this change will
kick in on IVB. No regressions on IVB.

This is effectively revert of c0554141a9:

    i965/blorp: Support overriding destination alpha to 1.0.

    Currently, Blorp requires the source and destination formats to be
    equal.  However, we'd really like to be able to blit between XRGB and
    ARGB formats; our BLT engine paths have supported this for a long time.

    For ARGB -> XRGB, nothing needs to occur: the missing alpha is already
    interpreted as 1.0.  For XRGB -> ARGB, we need to smash the alpha
    channel to 1.0 when writing the destination colors.  This is fairly
    straightforward with blending.

    For now, this code is never used, as the source and destination formats
    still must be equal.  The next patch will relax that restriction.

    NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2014-02-04 16:39:23 +02:00
Christian König
c3c24c3acc radeon/uvd: fix feedback buffer handling v2
Without the correct feedback buffer size UVD runs
into an error on each frame, reducing the maximum FPS.

v2: fixing Michels comments

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: "10.1" "10.0" "9.2" <mesa-stable@lists.freedesktop.org>
2014-02-04 13:10:50 +01:00
Kenneth Graunke
adaa5a6ca6 i965: Use brw_bo_map[_gtt]() in intel_miptree_map_raw().
This moves the intel_batchbuffer_flush before the drm_intel_bo_busy
call, which is a change in behavior.  However, the old behavior was
broken.

In the future, we may want to only flush in the batchbuffer references
the BO being mapped.  That's certainly more typical.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-03 16:16:38 -08:00
Kenneth Graunke
e396674d5f i965: Use brw_bo_map() in intel_texsubimage_tiled_memcpy().
This additionally measures the time stalled, while also simplifying the
code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-03 16:16:35 -08:00
Kenneth Graunke
d613bafe91 i965: Create drm_intel_bo_map wrappers with performance warnings.
Mapping a buffer is a common place where we could stall the CPU.

In a few places, we've added special code to check whether a buffer is
busy and log the stall as a performance warning.  Most of these give no
indication of the severity of the stall, though, since measuring the
time is a small hassle.

This patch introduces a new brw_bo_map() function which wraps
drm_intel_bo_map, but additionally measures the time stalled and reports
a performance warning.  If performance debugging is not enabled, it
simply maps the buffer with negligable overhead.

We also add a similar wrapper for drm_intel_gem_bo_map_gtt().

This should make it easy to add performance warnings in lots of places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-03 16:16:26 -08:00
Rob Clark
1b886078db freedreno: enabling binning and opt by default
Hw binning pass doesn't seem to have broken anything.  And optimizing
compiler fixes a lot of shaders and doesn't seem to break anything.  So
re-org slightly FD_MESA_DEBUG params and make both hw binning and
optimizer enabled by default.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
554f1ac00c freedreno/a3xx/compiler: new compiler
The new compiler generates a dependency graph of instructions, including
a few meta-instructions to handle PHI and preserve some extra
information needed for register assignment, etc.

The depth pass assigned a weight/depth to each node (based on sum of
instruction cycles of a given node and all it's dependent nodes), which
is used to schedule instructions.  The scheduling takes into account the
minimum number of cycles/slots between dependent instructions, etc.
Which was something that could not be handled properly with the original
compiler (which was more of a naive TGSI translator than an actual
compiler).

The register assignment is currently split out as a standalone pass.  I
expect that it will be replaced at some point, once I figure out what to
do about relative addressing (which is currently the only thing that
should cause fallback to old compiler).

There are a couple new debug options for FD_MESA_DEBUG env var:

  optmsgs - enable debug prints in optimizer
  optdump - dump instruction graph in .dot format, for example:

http://people.freedesktop.org/~robclark/a3xx/frag-0000.dot.png
http://people.freedesktop.org/~robclark/a3xx/frag-0000.dot

At this point, thanks to proper handling of instruction scheduling, the
new compiler fixes a lot of things that were broken before, and does not
appear to break anything that was working before[1].  So even though it
is not finished, it seems useful to merge it in it's current state.

[1] Not merged in this commit, because I'm not sure if it really belongs
in mesa tree, but the following commit implements a simple shader
emulator, which I've used to compare the output of the new compiler to
the original compiler (ie. run it on all the TGSI shaders dumped out via
ST_DEBUG=tgsi with various games/apps):

163b6306b1

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
f0e2d7ab46 freedreno/a3xx/compiler: split out old compiler
For the time being, keep old compiler as fallback for things that the
new compiler does not support yet.  Split out as it's own commit to make
the later new-compiler commits easier to follow.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
a418573c4d freedreno/a3xx/compiler: prepare for new compiler
Shuffle things around to prepare for new compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Rob Clark
f08d2b1c0f freedreno/a3xx: remove useless reg tracking in disasm-a3xx
Not really used for anything anymore.  So strip it out and avoid
conflicting symbols with upcoming new-compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-03 18:26:53 -05:00
Carl Worth
1597788d12 docs: Add release notes for 10.0.3
Which was just made.
2014-02-03 13:55:24 -08:00
Brian Paul
fc3fcd1e01 draw: fix incorrect color of flat-shaded clipped lines
When we clipped a line weren't copying the provoking vertex
color to the second vertex.  We also weren't checking for
first vs. last provoking vertex.

Fixes failures found with the new piglit line-flat-clip-color test.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:50:04 -07:00
Brian Paul
349b76a553 mesa: change GL_ALL_ATTRIB_BITS to 0xFFFFFFFF
This has been wrong for many years.  It was originally 0x000FFFFF and long
ago there was discussion about whether GL_ALL_ATTRIB_BITS should include
the then-new GL_MULTISAMPLE_BIT bit.  Eventually the ARB decided that
glPushAttrib(GL_ALL_ATTRIB_BITS) should save all current and future
attribute groups (hence ~0).  Unfortunately, Mesa's gl.h was never updated.

This was just recently spotted by Eric Anholt and reported as a bug to the
ARB.  Ian, Jon Leech and I discussed it at the ARB meeting and decided to
change Mesa's value to reflect the ARB's decision.

Acked-by: Eric Anholt <eric@anholt.net>
2014-02-03 12:50:03 -07:00
Brian Paul
307fd76053 gallium/auxiliary/indices: replace free() with FREE()
To match the CALLOC_STRUCT() call.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:49:55 -07:00
Brian Paul
97fdace6d7 svga: check shader size against max command buffer size
If the shader is too large, plug in a dummy shader.  This patch also
reworks the existing dummy shader code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:40:13 -07:00
Brian Paul
4686f610b1 svga: refactor some shader code
Put common code in new svga_shader.c file.  Considate separate vertex/
fragment shader ID generation.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-02-03 12:40:13 -07:00
Zack Rusin
9bace99d77 gallivm: fix opcode and function nesting
gallivm soa code supported only a single level of nesting for
control flow opcodes (if, switch, loops...) but the d3d10 spec
clearly states that those are nested within functions. To support
nesting of conditionals inside functions we need to store the
nesting data inside function contexts and keep a stack of those.
Furthermore we make sure that if nesting for subroutines is deeper
than 32 then we simply ignore all subsequent 'call' invocations.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-02-03 13:29:14 -05:00
Kenneth Graunke
595bcf38a6 mesa: Drop unnecessary (void) ctx from VAO code.
ctx is always used, even on release builds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:16 -08:00
Kenneth Graunke
4323b92479 mesa: Remove "APPLE" from some VAO error messages.
Chances are, people will be using the core names these days.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:15 -08:00
Kenneth Graunke
cf62e59673 mesa: Update some comments relating to VAOs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:13 -08:00
Kenneth Graunke
e1b1f2a687 mesa: Rename ElementArrayBufferObj to IndexBufferObj.
DirectX and most hardware documentation use the term "Index Buffer" to
refer to a buffer containing indexes into arrays of vertex data, which
allows random access to vertex data, rather than sequential access.

OpenGL uses a different term for this concept: "Element Array Buffer".
However, "Index Buffer" has become much more widespread.  A quick
Google search shows 29,300 hits for "Element Array Buffer" vs.
82,300 hits for "Index Buffer."

Arguably, "Index Buffer" is clearer: an "element of an array" (or list)
usually refers to an actual item stored in the array, not the index used
to refer to it.

The terminology is also already used in Mesa: some VBO module code for
dealing with ElementArrayBufferObj names local variables "ib".

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/ElementArrayBufferObj/IndexBufferObj/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:11 -08:00
Kenneth Graunke
0354e50798 mesa: Rename _mesa_lookup_arrayobj to _mesa_lookup_vao.
For consistency with the previous renames.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/_mesa_lookup_arrayobj/_mesa_lookup_vao/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:09 -08:00
Kenneth Graunke
de47fd2668 mesa: Rename _mesa_..._array_obj functions to _mesa_..._vao.
_mesa_update_vao_client_arrays() is less of a mouthful than
_mesa_update_array_object_client_arrays(), and generally clearer.

Generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/_mesa_\([^_]*\)_array_object/_mesa_\1_vao/g'
with manual whitespace and indentation fixes applied.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:07 -08:00
Kenneth Graunke
aac1415b66 mesa: Rename "struct gl_array_object" to gl_vertex_array_object.
I considered replacing it with "gl_vao", but spelling it out seemed to
fit better with Mesa's traditional style.  Mesa doesn't shy away from
long type names - consider gl_transform_feedback_object,
gl_fragment_program_state, gl_uniform_buffer_binding, and so on.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  's/gl_array_object/gl_vertex_array_object/g'

v2: Rerun command to resolve conflicts with Ian's meta patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:05 -08:00
Kenneth Graunke
94e07c1960 mesa: Rename "arrayObj" local variables to "vao".
Now that the field is named "VAO" instead of "ArrayObj", it makes sense
to call the local variables "vao" instead of "arrayObj".

Completely generated by:
$ find . -type f -print0 | xargs 0 sed -i 's/arrayObj/vao/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:53:02 -08:00
Kenneth Graunke
0dfe50f1a6 mesa: Rename ArrayObj to VAO and DefaultArrayObj to DefaultVAO.
When reading through the Mesa drawing code, it's not immediately obvious
to me that "ArrayObj" (gl_array_object) is the Vertex Array Object (VAO)
state.  The comment above the structure explains this, but readers still
have to remember this and translate accordingly.

Out of context, "array object" is a fairly vague.  Even in context,
"array" has a lot of meanings: glDrawArrays, vertex data stored in user
arrays, gl_client_arrays, gl_vertex_attrib_arrays, and so on.

Using the term "VAO" immediately associates these fields with the OpenGL
concept, clarifying the situation and aiding programmer sanity.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
  -e 's/ArrayObj;/VAO;/g'                  \
  -e 's/->ArrayObj/->VAO/g'                \
  -e 's/Array\.ArrayObj/Array.VAO/g'       \
  -e 's/Array\.DefaultArrayObj/Array.DefaultVAO/g'

v2: Rerun command to resolve conflicts with Ian's meta patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-02-03 00:52:58 -08:00
2145 changed files with 150966 additions and 75072 deletions

View File

@@ -24,7 +24,7 @@
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
# gallium drivers: swrast i915g ilo nouveau r300g r600g radeonsi vmwgfx
# gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
@@ -38,11 +38,10 @@ MESA_ANDROID_VERSION := $(MESA_ANDROID_MAJOR_VERSION).$(MESA_ANDROID_MINOR_VERSI
MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
MESA_PYTHON2 := python
DRM_TOP := external/drm
DRM_GRALLOC_TOP := hardware/drm_gralloc
classic_drivers := i915 i965
gallium_drivers := swrast i915g ilo nouveau r300g r600g radeonsi vmwgfx
gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
@@ -82,6 +81,7 @@ SUBDIRS := \
src/mapi \
src/glsl \
src/mesa \
src/util \
src/egl/main
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)

7
CleanSpec.mk Normal file
View File

@@ -0,0 +1,7 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libmesa_*_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/i9*5_dri_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libglapi_intermediates)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libGLES_mesa_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/EXECUTABLES/mesa_*_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/EXECUTABLES/glsl_compiler_intermediates)
$(call add-clean-step, rm -rf $(OUT_DIR)/host/$(HOST_OS)-$(HOST_ARCH)/obj/STATIC_LIBRARIES/libmesa_glsl_utils_intermediates)

View File

@@ -64,14 +64,13 @@ 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/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip
tarballs: md5
tarballs: checksums
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
manifest.txt: .git
@@ -98,9 +97,9 @@ $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
checksums: $(ARCHIVES)
@-sha256sum $(PACKAGE_NAME).tar.gz
@-sha256sum $(PACKAGE_NAME).tar.bz2
@-sha256sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

View File

@@ -59,13 +59,6 @@ else:
Help(opts.GenerateHelpText(env))
# fail early for a common error on windows
if env['gles']:
try:
import libxml2
except ImportError:
raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
#######################################################################
# Environment setup
@@ -87,9 +80,6 @@ env.Append(CPPPATH = [
'#/src/gallium/winsys',
])
if env['msvc']:
env.Append(CPPPATH = ['#include/c99'])
# for debugging
#print env.Dump()
@@ -122,9 +112,6 @@ if env['crosscompile'] and not env['embedded']:
host_env['hostonly'] = True
assert host_env['crosscompile'] == False
if host_env['msvc']:
host_env.Append(CPPPATH = ['#include/c99'])
target_env = env
env = host_env
Export('env')

View File

@@ -1 +1 @@
10.1.0-devel
10.3.7

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\|CC:.*mesa-stable\)' HEAD..origin/master |\
git log --reverse --pretty=%H -i --grep='^\([[:space:]]*NOTE: .*[Cc]andidate\|CC:.*10\.3.*mesa-stable\)' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.

View File

@@ -91,6 +91,7 @@ def AddOptions(opts):
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add(BoolOption('analyze', 'enable static code analysis where available', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
@@ -100,4 +101,4 @@ def AddOptions(opts):
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVC_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0', '10.0', '11.0', '12.0')))
opts.Add('MSVC_VERSION', 'Microsoft Visual C/C++ version')

File diff suppressed because it is too large Load Diff

View File

@@ -18,9 +18,8 @@ are exposed in the 3.0 context as extensions.
Feature Status
----------------------------------------------------- ------------------------
GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL 3.0, GLSL 1.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 1.30 DONE ()
glBindFragDataLocation, glGetFragDataLocation DONE
Conditional rendering (GL_NV_conditional_render) DONE (r300, swrast)
Map buffer subranges (GL_ARB_map_buffer_range) DONE (r300, swrast)
@@ -30,7 +29,7 @@ GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL_EXT_texture_shared_exponent DONE (swrast)
Float depth buffers (GL_ARB_depth_buffer_float) DONE ()
Framebuffer objects (GL_ARB_framebuffer_object) DONE (r300, swrast)
GL_ARB_half_float_pixel DONE (r300, swrast)
GL_ARB_half_float_pixel DONE (all drivers)
GL_ARB_half_float_vertex DONE (r300, swrast)
GL_EXT_texture_integer DONE ()
GL_EXT_texture_array DONE ()
@@ -49,9 +48,8 @@ GL 3.0 --- all DONE: i965, nv50, nvc0, r600, radeonsi
Multisample anti-aliasing DONE (r300)
GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GL 3.1, GLSL 1.40 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 1.40 DONE ()
Forward compatible context support/deprecations DONE ()
Instanced drawing (GL_ARB_draw_instanced) DONE (swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (r300, swrast)
@@ -63,71 +61,78 @@ GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi
Signed normalized textures (GL_EXT_texture_snorm) DONE (r300)
GL 3.2 --- all DONE: i965, nv50, nvc0, radeonsi
GL 3.2, GLSL 1.50 --- all DONE: i965, nv50, nvc0, r600, radeonsi
Core/compatibility profiles DONE
GLSL 1.50 DONE ()
Geometry shaders DONE ()
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (r300, r600, swrast)
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (r300, r600, swrast)
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (r300, r600, swrast)
Provoking vertex (GL_ARB_provoking_vertex) DONE (r300, r600, swrast)
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE (r600)
Multisample textures (GL_ARB_texture_multisample) DONE (r600)
Frag depth clamp (GL_ARB_depth_clamp) DONE (r600, swrast)
Fence objects (GL_ARB_sync) DONE (r300, r600, swrast)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (r300, swrast)
Base vertex offset(GL_ARB_draw_elements_base_vertex) DONE (r300, swrast)
Frag shader coord (GL_ARB_fragment_coord_conventions) DONE (r300, swrast)
Provoking vertex (GL_ARB_provoking_vertex) DONE (r300, swrast)
Seamless cubemaps (GL_ARB_seamless_cube_map) DONE ()
Multisample textures (GL_ARB_texture_multisample) DONE ()
Frag depth clamp (GL_ARB_depth_clamp) DONE (swrast)
Fence objects (GL_ARB_sync) DONE (r300, swrast)
GLX_ARB_create_context_profile DONE
GL 3.3 --- all DONE: i965, nv50, nvc0, radeonsi
GL 3.3, GLSL 3.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi
GLSL 3.30 DONE ()
GL_ARB_blend_func_extended DONE (r600, softpipe)
GL_ARB_blend_func_extended DONE (softpipe)
GL_ARB_explicit_attrib_location DONE (all drivers that support GLSL)
GL_ARB_occlusion_query2 DONE (r300, r600, swrast)
GL_ARB_occlusion_query2 DONE (r300, swrast)
GL_ARB_sampler_objects DONE (all drivers)
GL_ARB_shader_bit_encoding DONE (r600)
GL_ARB_texture_rgb10_a2ui DONE (r600)
GL_ARB_texture_swizzle DONE (r300, r600, swrast)
GL_ARB_timer_query DONE (r600)
GL_ARB_instanced_arrays DONE (r300, r600)
GL_ARB_vertex_type_2_10_10_10_rev DONE (r600)
GL_ARB_shader_bit_encoding DONE ()
GL_ARB_texture_rgb10_a2ui DONE ()
GL_ARB_texture_swizzle DONE (r300, swrast)
GL_ARB_timer_query DONE ()
GL_ARB_instanced_arrays DONE (r300)
GL_ARB_vertex_type_2_10_10_10_rev DONE ()
GL 4.0:
GL 4.0, GLSL 4.00:
GLSL 4.0 not started
GL_ARB_texture_query_lod DONE (i965)
GL_ARB_draw_buffers_blend DONE (i965, nv50, nvc0, r600, radeonsi, softpipe)
GL_ARB_draw_indirect DONE (i965)
GL_ARB_gpu_shader5 started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading DONE (i965)
GL_ARB_draw_indirect DONE (i965, nvc0, radeonsi, softpipe, llvmpipe)
GL_ARB_gpu_shader5 DONE (i965, nvc0)
- 'precise' qualifier DONE
- Dynamically uniform sampler array indices DONE ()
- Dynamically uniform UBO array indices DONE ()
- Implicit signed -> unsigned conversions DONE
- Fused multiply-add DONE ()
- Packing/bitfield/conversion functions DONE (r600)
- Enhanced textureGather DONE (r600, radeonsi)
- Geometry shader instancing DONE ()
- Geometry shader multiple streams DONE ()
- Enhanced per-sample shading DONE (r600)
- Interpolation functions DONE ()
- New overload resolution rules DONE
GL_ARB_gpu_shader_fp64 started (Dave)
GL_ARB_sample_shading DONE (i965, nv50, nvc0, radeonsi)
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 DONE (i965, r600, radeonsi, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, nvc0, r600, softpipe)
GL_ARB_texture_gather DONE (i965)
GL_ARB_tessellation_shader started (Fabian)
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, nv50, nvc0, r600, radeonsi, softpipe)
GL_ARB_texture_gather DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_texture_query_lod DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_transform_feedback2 DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_transform_feedback3 DONE (i965, nv50, nvc0, r600, radeonsi)
GL 4.1:
GL 4.1, GLSL 4.10:
GLSL 4.1 not started
GL_ARB_ES2_compatibility DONE (i965, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_get_program_binary DONE (0 binary formats)
GL_ARB_separate_shader_objects started (Ian Romanick, Gregory Hainaut)
GL_ARB_shader_precision not started
GL_ARB_vertex_attrib_64bit not started
GL_ARB_viewport_array DONE (i965)
GL_ARB_separate_shader_objects DONE (all drivers)
GL_ARB_shader_precision started (Micah)
GL_ARB_vertex_attrib_64bit started (Dave)
GL_ARB_viewport_array DONE (i965, nv50, nvc0, r600)
GL 4.2:
GL 4.2, GLSL 4.20:
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_texture_compression_bptc DONE (i965, nvc0, r600, radeonsi)
GL_ARB_compressed_texture_pixel_storage DONE (all drivers)
GL_ARB_shader_atomic_counters DONE (i965)
GL_ARB_texture_storage DONE (all drivers)
GL_ARB_transform_feedback_instanced DONE (i965, nv50, nvc0, r600, radeonsi)
@@ -139,45 +144,75 @@ GL 4.2:
GL_ARB_map_buffer_alignment DONE (all drivers)
GL 4.3:
GL 4.3, GLSL 4.30:
GLSL 4.3 not started
GL_ARB_arrays_of_arrays started
GL_ARB_ES3_compatibility DONE (i965)
GL_ARB_arrays_of_arrays started (Timothy)
GL_ARB_ES3_compatibility DONE (all drivers that support GLSL 3.30)
GL_ARB_clear_buffer_object DONE (all drivers)
GL_ARB_compute_shader started (Paul Berry)
GL_ARB_copy_image not started
GL_ARB_compute_shader started (currently stalled)
GL_ARB_copy_image DONE (i965)
GL_KHR_debug DONE (all drivers)
GL_ARB_explicit_uniform_location not started
GL_ARB_fragment_layer_viewport not started
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
GL_ARB_fragment_layer_viewport DONE (nv50, nvc0, r600)
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 DONE (i965)
GL_ARB_multi_draw_indirect DONE (i965, nvc0, radeonsi, softpipe, llvmpipe)
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_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi)
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi)
GL_ARB_texture_query_levels DONE (i965)
GL_ARB_texture_query_levels DONE (all drivers that support GLSL 1.30)
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
GL_ARB_texture_view started (Courtney Goeltzenleuchter, Chris Forbes)
GL_ARB_texture_view DONE (i965)
GL_ARB_vertex_attrib_binding DONE (all drivers)
GL 4.4:
GL 4.4, GLSL 4.40:
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_buffer_storage DONE (i965, nv30, nv50, nvc0, r300, r600, radeonsi)
GL_ARB_clear_texture DONE (i965)
GL_ARB_enhanced_layouts not started
GL_ARB_multi_bind started (Fredrik Höglund)
GL_ARB_multi_bind DONE (all drivers)
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)
GL_ARB_vertex_type_10f_11f_11f_rev DONE (i965, nv50, nvc0, r600, radeonsi)
GL 4.5, GLSL 4.50:
GL_ARB_ES3_1_compatibility not started
GL_ARB_clip_control not started
GL_ARB_conditional_render_inverted DONE (i965, nvc0, softpipe, llvmpipe)
GL_ARB_cull_distance not started
GL_ARB_derivative_control DONE (i965, nv50, nvc0, r600)
GL_ARB_direct_state_access not started
GL_ARB_get_texture_sub_image started (Brian Paul)
GL_ARB_shader_texture_image_samples not started
GL_ARB_texture_barrier DONE (nv50, nvc0, r300, r600, radeonsi)
GL_KHR_context_flush_control not started
GL_KHR_robust_buffer_access_behavior not started
GL_KHR_robustness 90% done (the ARB variant)
These are the extensions cherry-picked to make GLES 3.1
GLES3.1, GLSL ES 3.1
GL_ARB_arrays_of_arrays started (Timothy)
GL_ARB_compute_shader started (currently stalled)
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
GL_ARB_framebuffer_no_attachments not started
GL_ARB_program_interface_query not started
GL_ARB_shader_atomic_counters DONE (i965)
GL_ARB_shader_image_load_store in progress (curro)
GL_ARB_shader_storage_buffer_object not started
GL_ARB_separate_shader_objects DONE (all drivers)
GL_ARB_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi)
GL_ARB_vertex_attrib_binding DONE (all drivers)
GS5 Enhanced textureGather DONE (i965, nvc0, r600, radeonsi)
GS5 Packing/bitfield/conversion functions DONE (i965, nvc0, r600)
GL_EXT_shader_integer_mix DONE (all drivers that support GLSL)
More info about these features and the work involved can be found at

View File

@@ -11,3 +11,34 @@ INFORMATION FOR PACKAGED MEDIA IS EXPRESSLY PROHIBITED WITHOUT A LICENSE
UNDER APPLICABLE PATENTS IN THE MPEG-2 PATENT PORTFOLIO, WHICH LICENSES IS
AVAILABLE FROM MPEG LA, LLC, 6312 S. Fiddlers Green Circle, Suite 400E,
Greenwood Village, Colorado 80111 U.S.A.
WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE WILL RUN
UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF TRADE OR
COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE SOFTWARE IS
ASSUMED BY YOU. Some jurisdictions do not allow the exclusion of implied
warranties, so the above exclusion may not apply to You.
LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL NOT,
UNDER ANY CIRCUMSTANCES BE LIABLE FOR ANY PUNITIVE, DIRECT, INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF THE SOFTWARE OR
THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. In no event shall AMD's total liability to You
for all damages, losses, and causes of action (whether in contract, tort
(including negligence) or otherwise) exceed the amount of $100 USD. You agree
to defend, indemnify and hold harmless AMD and its licensors, and any of their
directors, officers, employees, affiliates or agents from and against any and
all loss, damage, liability and other expenses (including reasonable
attorneys' fees), resulting from Your use of the Software or violation of the
terms and conditions of this Agreement.
U.S. GOVERNMENT RESTRICTED RIGHTS: The Software is provided with "RESTRICTED
RIGHTS." Use, duplication, or disclosure by the Government is subject to the
restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or
its successor. Use of the Software by the Government constitutes
acknowledgement of AMD's proprietary rights in them.
EXPORT RESTRICTIONS: The Software may be subject to export restrictions as
stated in the Software License Agreement.

43
docs/README.VCE Normal file
View File

@@ -0,0 +1,43 @@
The software may implement third party technologies (e.g. third party
libraries) that are not licensed to you by AMD and for which you may need
to obtain licenses from other parties. Unless explicitly stated otherwise,
these third party technologies are not licensed hereunder. Such third
party technologies include, but are not limited, to H.264, MPEG-2, MPEG-4,
AVC, and VC-1.
For MPEG-2 Intermediate Products: ANY USE OF THIS PRODUCT IN ANY MANNER OTHER
THAN PERSONAL USE THAT COMPLIES WITH THE MPEG-2 STANDARD IS EXPRESSLY
PROHIBITED WITHOUT A LICENSE UNDER APPLICABLE PATENTS IN THE MPEG-2 PATENT
PORTFOLIO, WHICH LICENSES IS AVAILABLE FROM MPEG LA, LLC, 6312 S. Fiddlers
Green Circle, Suite 400E, Greenwood Village, Colorado 80111 U.S.A.
WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE WILL RUN
UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF TRADE OR
COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE SOFTWARE IS
ASSUMED BY YOU. Some jurisdictions do not allow the exclusion of implied
warranties, so the above exclusion may not apply to You.
LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL NOT,
UNDER ANY CIRCUMSTANCES BE LIABLE FOR ANY PUNITIVE, DIRECT, INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF THE SOFTWARE OR
THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. In no event shall AMD's total liability to You
for all damages, losses, and causes of action (whether in contract, tort
(including negligence) or otherwise) exceed the amount of $100 USD. You agree
to defend, indemnify and hold harmless AMD and its licensors, and any of their
directors, officers, employees, affiliates or agents from and against any and
all loss, damage, liability and other expenses (including reasonable
attorneys' fees), resulting from Your use of the Software or violation of the
terms and conditions of this Agreement.
U.S. GOVERNMENT RESTRICTED RIGHTS: The Software is provided with "RESTRICTED
RIGHTS." Use, duplication, or disclosure by the Government is subject to the
restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or
its successor. Use of the Software by the Government constitutes
acknowledgement of AMD's proprietary rights in them.
EXPORT RESTRICTIONS: The Software may be subject to export restrictions as
stated in the Software License Agreement.

View File

@@ -36,17 +36,15 @@ Recipe
Building on windows requires several open-source packages. These are
steps that work as of this writing.
1) install python 2.7
2) install scons (latest)
3) install mingw, flex, and bison
4) install libxml2 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
get libxml2-python-2.9.1.win-amd64-py2.7.exe
5) install pywin32 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
- install python 2.7
- install scons (latest)
- install mingw, flex, and bison
- install pywin32 from here: http://www.lfd.uci.edu/~gohlke/pythonlibs
get pywin32-218.4.win-amd64-py2.7.exe
6) install git
7) download mesa from git
- install git
- download mesa from git
see http://www.mesa3d.org/repository.html
8) run scons
- run scons
General
-------

View File

@@ -97,20 +97,22 @@ shared libraries in a single pass.</p>
<dt><code>CC, CFLAGS, CXX, CXXFLAGS</code></dt>
<dd><p>These environment variables
control the C and C++ compilers used during the build. By default,
<code>gcc</code> and <code>g++</code> are used with the options
<code>"-g -O2"</code>.</p>
<code>gcc</code> and <code>g++</code> are used and the debug/optimisation
level is left unchanged.</p>
</dd>
<dt><code>LDFLAGS</code></dt>
<dd><p>An environment variable specifying flags to
pass when linking programs. These are normally empty, but can be used
to direct the linker to use libraries in nonstandard directories. For
example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.</p>
pass when linking programs. These should be empty and
<code>PKG_CONFIG_PATH</code> is recommended to be used instead. If needed
it can be used to direct the linker to use libraries in nonstandard
directories. For example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.</p>
</dd>
<dt><code>PKG_CONFIG_PATH</code></dt>
<dd><p>When available, the
<code>pkg-config</code> utility is used to search for external libraries
<dd><p>The
<code>pkg-config</code> utility is a hard requirement for cofiguring and
building mesa. It is used to search for external libraries
on the system. This environment variable is used to control the search
path for <code>pkg-config</code>. For instance, setting
<code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for
@@ -135,14 +137,32 @@ one of these architectures is detected. This option ensures that
assembly will not be used.</p>
</dd>
<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
<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. Note that these options are mutually exclusive.</p>
<dt><code>--build=</code></dt>
<dt><code>--host=</code></dt>
<dd><p>By default, the build will compile code for the architecture that
it's running on. In order to build cross-compile Mesa on a x86-64 machine
that is to run on a i686, one would need to set the options to:</p>
<p><code>--build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu</code></p>
Note that these can vary from distribution to distribution. For more
information check with the
<a href="https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Specifying-Target-Triplets.html">
autoconf manual</a>.
Note that you will need to correctly set <code>PKG_CONFIG_PATH</code> as well.
<p>In some cases a single compiler is capable of handling both architectures
(multilib) in that case one would need to set the <code>CC,CXX</code> variables
appending the correct machine options. Seek your compiler documentation for
further information -
<a href="https://gcc.gnu.org/onlinedocs/gcc/Submodel-Options.html"> gcc
machine dependent options</a></p>
<p>In addition to specifying correct <code>PKG_CONFIG_PATH</code> for the target
architecture, the following should be sufficient to configure multilib Mesa</p>
<code>./configure CC="gcc -m32" CXX="g++ -m32" --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu ...</code>
</dd>
</dl>
@@ -194,7 +214,9 @@ kernel DRM modules are not available.
<dt><code>--enable-glx-tls</code> <dd><p>
Enable Thread Local Storage (TLS) in
GLX.
<dt><code>--with-expat=DIR</code> <dd> The DRI-enabled libGL uses expat to
<dt><code>--with-expat=DIR</code>
<dd><p><strong>DEPRECATED</strong>, use <code>PKG_CONFIG_PATH</code> instead.</p>
<p>The DRI-enabled libGL uses expat to
parse the DRI configuration files in <code>/etc/drirc</code> and
<code>~/.drirc</code>. This option allows a specific expat installation
to be used. For example, <code>--with-expat=/usr/local</code> will

View File

@@ -56,6 +56,11 @@ To add a new GL extension to Mesa you have to do at least the following.
If the new extension adds new GL state, the functions in get.c, enable.c
and attrib.c will most likely require new code.
</li>
<li>
The dispatch tests check_table.cpp and dispatch_sanity.cpp
should be updated with details about the new extensions functions. These
tests are run using 'make check'
</li>
</ul>
@@ -211,6 +216,11 @@ you can send a note directly to the mesa-stable@lists.freedesktop.org where
the Mesa stable-branch maintainers will receive it. Be sure to mention the
commit ID of the commit of interest (as it appears in the mesa master branch).
The latest set of patches that have been nominated, accepted, or rejected for
the upcoming stable release can always be seen on the
<a href=http://cworth.org/~cworth/mesa-stable-queue/">Mesa Stable Queue</a>
page.
<h2>Cherry-picking candidates for a stable branch</h2>
<p>

View File

@@ -232,16 +232,6 @@ The supported platforms are X11, DRM, FBDEV, and GDI.</p>
</dd>
<dt><code>egl_glx</code></dt>
<dd>
<p>This driver provides a wrapper to GLX. It uses exclusively GLX to implement
the EGL API. It supports both direct and indirect rendering when the GLX does.
It is accelerated when the GLX is. As such, it cannot provide functions that
is not available in GLX or GLX extensions.</p>
</dd>
</dl>
<h2>Packaging</h2>
<p>The ABI between the main library and its drivers are not stable. Nor is
@@ -262,10 +252,6 @@ is disabled by default.</p>
<code>src/egl/</code>. The sources of the <code>egl</code> state tracker can
be found at <code>src/gallium/state_trackers/egl/</code>.</p>
<p>The suggested way to learn to write a EGL driver is to see how other drivers
are written. <code>egl_glx</code> should be a good reference. It works in any
environment that has GLX support, and it is simpler than most drivers.</p>
<h3>Lifetime of Display Resources</h3>
<p>Contexts and surfaces are examples of display resources. They might live

View File

@@ -16,6 +16,132 @@
<h1>News</h1>
<h2>September 19, 2014</h2>
<p>
<a href="relnotes/10.3.html">Mesa 10.3</a> is released. This is a new
development release. See the release notes for more information about
the release.
</p>
<p>
Also, <a href="relnotes/10.2.8.html">Mesa 10.2.8</a> is released.
This is a bug fix release from the 10.2 branch.
</p>
<h2>August 19, 2014</h2>
<p>
<a href="relnotes/10.2.6.html">Mesa 10.2.6</a> is released.
This is a bug-fix release.
</p>
<h2>August 2, 2014</h2>
<p>
<a href="relnotes/10.2.5.html">Mesa 10.2.5</a> is released.
This is a bug-fix release.
</p>
<h2>July 18, 2014</h2>
<p>
<a href="relnotes/10.2.4.html">Mesa 10.2.4</a> is released.
This is a bug-fix release.
</p>
<h2>July 7, 2014</h2>
<p>
<a href="relnotes/10.2.3.html">Mesa 10.2.3</a> is released.
This is a bug-fix release.
</p>
<h2>July 5, 2014</h2>
<p>
Mesa demos 8.2.0 is released.
See the <a href="http://lists.freedesktop.org/archives/mesa-announce/2014-July/000100.html">announcement</a> for more information about the release.
You can download it from <a href="ftp://ftp.freedesktop.org/pub/mesa/demos/8.2.0/">ftp.freedesktop.org/pub/mesa/demos/8.2.0/</a>.
</p>
<h2>June 24, 2014</h2>
<p>
<a href="relnotes/10.1.6.html">Mesa 10.1.6</a>
and <a href="relnotes/10.2.2.html">Mesa 10.2.2</a> are released.
These are bug-fix releases from the 10.1 and 10.2 branches, respectively.
</p>
<h2>June 6, 2014</h2>
<p>
<a href="relnotes/10.2.1.html">Mesa 10.2.1</a> is released. This release
only fixes a build error in the radeonsi driver that was introduced between
10.2-rc5 and the 10.2 final release.
</p>
<h2>June 6, 2014</h2>
<p>
<a href="relnotes/10.2.html">Mesa 10.2</a> is released. This is a new
development release. See the release notes for more information about
the release.
</p>
<p>
Also, <a href="relnotes/10.1.5.html">Mesa 10.1.5</a> is released.
This is a bug fix release from the 10.1 branch.
</p>
<h2>May 20, 2014</h2>
<p>
<a href="relnotes/10.1.4.html">Mesa 10.1.4</a> is released.
This is a bug-fix release.
</p>
<h2>May 9, 2014</h2>
<p>
<a href="relnotes/10.1.3.html">Mesa 10.1.3</a> is released.
This is a bug-fix release, and is being released sooner than
originally scheduled to fix a performance regression (vmware
swapbuffers falling back to software) introduced to the
10.1.2 release.
</p>
<h2>May 5, 2014</h2>
<p>
<a href="relnotes/10.1.2.html">Mesa 10.1.2</a> is released.
This is a bug-fix release.
</p>
<h2>April 18, 2014</h2>
<p>
<a href="relnotes/10.1.1.html">Mesa 10.1.1</a> is released.
This is a bug-fix release.
</p>
<h2>April 18, 2014</h2>
<p>
<a href="relnotes/10.0.5.html">Mesa 10.0.5</a> is released.
This is a bug-fix release.
<br>
NOTE: Since the 10.1.1 release is being released concurrently, it is
anticipated that 10.0.5 will be the final release in the 10.0
series. Users of 10.0 are encouraged to migrate to the 10.1 series in
order to obtain future fixes.
</p>
<h2>March 12, 2014</h2>
<p>
<a href="relnotes/10.0.4.html">Mesa 10.0.4</a> is released.
This is a bug-fix release.
</p>
<h2>March 4, 2014</h2>
<p>
<a href="relnotes/10.1.html">Mesa 10.1</a> is released.
This is a new development release.
See the release notes for more information about the release.
</p>
<h2>February 3, 2014</h2>
<p>
<a href="relnotes/10.0.3.html">Mesa 10.0.3</a> is released.
This is a bug-fix release.
</p>
<h2>January 9, 2014</h2>
<p>
<a href="relnotes/10.0.2.html">Mesa 10.0.2</a> is released.

View File

@@ -34,20 +34,25 @@
<h2>1.1 General</h2>
<ul>
<li><a href="http://www.python.org/">Python</a> - Python is required.
Version 2.6.4 or later should work.
</li>
<br>
<li><a href="http://www.scons.org/">SCons</a> is required for building on
Windows and optional for Linux (it's an alternative to autoconf/automake.)
</li>
<br>
<li>lex / yacc - for building the GLSL compiler.
<br>
<br>
On Linux systems, flex and bison are used.
Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
<br>
<br>
On Windows with MinGW, install flex and bison with:
<pre>mingw-get install msys-flex msys-bison</pre>
</li>
<li>python - Python is needed for building the Gallium components.
Version 2.6.4 or later should work.
<br>
<br>
To build OpenGL ES 1.1 and 2.0 you'll also need
<a href="http://xmlsoft.org/sources/win32/python/libxml2-python-2.7.7.win32-py2.7.exe">libxml2-python</a>.
For MSVC on Windows, you can find flex/bison programs on the
<a href="ftp://ftp.freedesktop.org/pub/mesa/windows-utils/">Mesa ftp site</a>.
</li>
</ul>

View File

@@ -43,11 +43,7 @@ It's the fastest software rasterizer for Mesa.
</p>
</li>
<li>
<p>LLVM: version 2.9 recommended; 2.6 or later required.</p>
<p><b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
</p>
<p>LLVM: version 3.4 recommended; 3.1 or later required.</p>
<p>
For Linux, on a recent Debian based distribution do:
</p>
@@ -101,13 +97,15 @@ but the rest of these instructions assume that scons is used.
For Windows the procedure is similar except the target:
<pre>
scons build=debug libgl-gdi
scons platform=windows build=debug libgl-gdi
</pre>
<h1>Using</h1>
On Linux, building will create a drop-in alternative for libGL.so into
<h2>Linux</h2>
<p>On Linux, building will create a drop-in alternative for libGL.so into</p>
<pre>
build/foo/gallium/targets/libgl-xlib/libGL.so
@@ -117,15 +115,45 @@ or
lib/gallium/libGL.so
</pre>
To use it set the LD_LIBRARY_PATH environment variable accordingly.
<p>To use it set the LD_LIBRARY_PATH environment variable accordingly.</p>
For performance evaluation pass debug=no to scons, and use the corresponding
lib directory without the "-debug" suffix.
<p>For performance evaluation pass build=release to scons, and use the corresponding
lib directory without the "-debug" suffix.</p>
On Windows, building will create a drop-in alternative for opengl32.dll. To use
it put it in the same directory as the application. It can also be used by
<h2>Windows</h2>
<p>
On Windows, building will create
<code>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll</code>
which is a drop-in alternative for system's <code>opengl32.dll</code>. To use
it put it in the same directory as your application. It can also be used by
replacing the native ICD driver, but it's quite an advanced usage, so if you
need to ask, don't even try it.
</p>
<p>
There is however an easy way to replace the OpenGL software renderer that comes
with Microsoft Windows 7 (or later) with llvmpipe (that is, on systems without
any OpenGL drivers):
</p>
<ul>
<li><p>copy build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll to C:\Windows\SysWOW64\mesadrv.dll</p></li>
<li><p>load this registry settings:</p>
<pre>REGEDIT4
; http://technet.microsoft.com/en-us/library/cc749368.aspx
; http://www.msfn.org/board/topic/143241-portable-windows-7-build-from-winpe-30/page-5#entry942596
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL]
"DLL"="mesadrv.dll"
"DriverVersion"=dword:00000001
"Flags"=dword:00000001
"Version"=dword:00000002
</pre>
</li>
<li>Ditto for 64 bits drivers if you need them.</li>
</ul>
<h1>Profiling</h1>

View File

@@ -21,7 +21,25 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
<li><a href="relnotes/10.3.html">10.3 release notes</a>
<li><a href="relnotes/10.2.8.html">10.2.8 release notes</a>
<li><a href="relnotes/10.2.6.html">10.2.6 release notes</a>
<li><a href="relnotes/10.2.5.html">10.2.5 release notes</a>
<li><a href="relnotes/10.2.4.html">10.2.4 release notes</a>
<li><a href="relnotes/10.2.3.html">10.2.3 release notes</a>
<li><a href="relnotes/10.2.2.html">10.2.2 release notes</a>
<li><a href="relnotes/10.2.1.html">10.2.1 release notes</a>
<li><a href="relnotes/10.2.html">10.2 release notes</a>
<li><a href="relnotes/10.1.6.html">10.1.6 release notes</a>
<li><a href="relnotes/10.1.5.html">10.1.5 release notes</a>
<li><a href="relnotes/10.1.4.html">10.1.4 release notes</a>
<li><a href="relnotes/10.1.3.html">10.1.3 release notes</a>
<li><a href="relnotes/10.1.2.html">10.1.2 release notes</a>
<li><a href="relnotes/10.1.1.html">10.1.1 release notes</a>
<li><a href="relnotes/10.1.html">10.1 release notes</a>
<li><a href="relnotes/10.0.5.html">10.0.5 release notes</a>
<li><a href="relnotes/10.0.4.html">10.0.4 release notes</a>
<li><a href="relnotes/10.0.3.html">10.0.3 release notes</a>
<li><a href="relnotes/10.0.2.html">10.0.2 release notes</a>
<li><a href="relnotes/10.0.1.html">10.0.1 release notes</a>
<li><a href="relnotes/10.0.html">10.0 release notes</a>

206
docs/relnotes/10.0.3.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 10.0.3 Release Notes / (February 3, 2014)</h1>
<p>
Mesa 10.0.3 is a bug fix release which fixes bugs found since the 10.0.2 release.
</p>
<p>
Mesa 10.0.3 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>
5f9f463ef08129f6762106b434910adb MesaLib-10.0.3.tar.bz2
fb3997b6500e153bc32370cb3fc4ca9e MesaLib-10.0.3.tar.gz
a07b4b6b9eb449b88a6cb5061e51c331 MesaLib-10.0.3.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=72708">Bug 72708</a> - Master fails to build with older gcc due to -msse4.1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72926">Bug 72926</a> - [REGRESSION,swrast] Memory-related crash with anti-aliasing enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73096">Bug 73096</a> - Query GL_RGBA_SIGNED_COMPONENTS_EXT missing</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73100">Bug 73100</a> - Please use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73418">Bug 73418</a> - OpenCL hangs graphics on CAYMAN</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73473">Bug 73473</a> - Potential crash bug in src/gallium/auxiliary/rtasm/rtasm_execmem.c</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73915">Bug 73915</a> - sample shading + centroid broken since f5cfb4a</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73956">Bug 73956</a> - SIGSEGV when passing GL_NONE to glReadBuffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74026">Bug 74026</a> - Compiler rejects chained assignments involving array dereferences</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.2..mesa-10.0.3
</pre>
<p>Aaron Watry (2):</p>
<ul>
<li>radeon: Move gfx/dma cs cleanup to r600_common_context_cleanup</li>
<li>st/dri: prevent leak of dri option default values</li>
</ul>
<p>Andreas Fänger (1):</p>
<ul>
<li>swrast: fix delayed texel buffer allocation regression for OpenMP</li>
</ul>
<p>Anuj Phogat (3):</p>
<ul>
<li>glsl: Disable ARB_texture_rectangle in shader version 100.</li>
<li>i965: Use sample barycentric coordinates with per sample shading</li>
<li>i965: Ignore 'centroid' interpolation qualifier in case of persample shading</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: implement missing glGet(GL_RGBA_SIGNED_COMPONENTS_EXT) query</li>
<li>st/mesa: fix glReadBuffer(GL_NONE) segfault</li>
<li>draw: fix incorrect vertex size computation in LLVM drawing code</li>
</ul>
<p>Carl Worth (5):</p>
<ul>
<li>Add md5sums for 10.0.2. release.</li>
<li>cherry-ignore: Ignore several patches not yet ready for the stable branch</li>
<li>Drop another couple of patches.</li>
<li>cherry-ignore: Ignore 4 patches at teh request of the author, (Anuj).</li>
<li>Update version to 10.0.3</li>
</ul>
<p>Chad Versace (1):</p>
<ul>
<li>i965/gen6/blorp: Emit more flushes to workaround hangs</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965: fold offset into coord for textureOffset(gsampler2DRect)</li>
</ul>
<p>Emil Velikov (5):</p>
<ul>
<li>mesa: use signed temporary variable to store _ColorDrawBufferIndexes</li>
<li>st/mesa: use signed temporary variable to store _ColorDrawBufferIndexes</li>
<li>nv50: access only the available amount of textures</li>
<li>nv50: access only the available amount of constbuf</li>
<li>gallium/rtasm: handle mmap failures appropriately</li>
</ul>
<p>Eric Anholt (2):</p>
<ul>
<li>i965: Fix handling of MESA_pack_invert in blit (PBO) readpixels.</li>
<li>i965: Don't do the temporary-and-blit-copy for INVALIDATE_RANGE maps.</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>mesa: Add COMPRESSED_RGBA_S3TC_DXT1_EXT to COMPRESSED_TEXTURE_FORMATS for GLES</li>
<li>radeon / r200: Pass the API into _mesa_initialize_context</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>mesa: fix GL_COLOR_SUM enum for drivers without ARB_vertex_program</li>
<li>st/vdpau: don't return a device if the screen doesn't support NPOT</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>mesa: Use IROUND instead of roundf.</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>glsl: Rename "expr" to "lhs_expr" in vector_extract munging code.</li>
<li>glsl: Fix chained assignments of vector channels.</li>
</ul>
<p>Lauri Kasanen (1):</p>
<ul>
<li>mesa: Fix build to properly check for supported compiler flags</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>st/mesa: use sRGB formats for MSAA resolving if destination is sRGB</li>
<li>gallium/util: util_format_srgb should not return FORMAT_NONE for sRGB formats</li>
</ul>
<p>Matt Turner (2):</p>
<ul>
<li>glcpp: Define GL_EXT_shader_integer_mix in both GL and ES.</li>
<li>glx: Update glxext.h to revision 24777.</li>
</ul>
<p>Michał Górny (1):</p>
<ul>
<li>Use AC_PATH_TOOL instead of AC_PATH_PROG for llvm-config.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965: Ensure that all necessary state is re-emitted if we run out of aperture.</li>
</ul>
<p>Paul Seidler (1):</p>
<ul>
<li>build: move ARCH_LIBS definition outside of ASM definition</li>
</ul>
<p>Thomas Sondergaard (4):</p>
<ul>
<li>mesa: Preliminary support for MSVC_VERSION=12.0</li>
<li>mesa: Fix compile error with MSVC 2013</li>
<li>mesa: Work around internal compiler error</li>
<li>mesa: Namespace qualify fma to override ambiguity with fma from math.h</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>r600g/compute: Emit DEALLOC_STATE on cayman after dispatching a compute shader.</li>
</ul>
</div>
</body>
</html>

191
docs/relnotes/10.0.4.html Normal file
View File

@@ -0,0 +1,191 @@
<!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.4 Release Notes / (March 12, 2014)</h1>
<p>
Mesa 10.0.4 is a bug fix release which fixes bugs found since the 10.0.3 release.
</p>
<p>
Mesa 10.0.4 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>
5a3c5b90776ec8a9fcd777c99e0607e2 MesaLib-10.0.4.tar.gz
8b148869d2620b0720c8a8d2b7eb3e38 MesaLib-10.0.4.tar.bz2
da2418d25bfbc273660af7e755fb367e MesaLib-10.0.4.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=71870">Bug 71870</a> - Metro: Last Light rendering issues</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72895">Bug 72895</a> - Missing trees in flightgear 2.12.1 with mesa 10.0.1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74251">Bug 74251</a> - Segfault in st_finalize_texture with Texture Buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74723">Bug 74723</a> - main/shaderapi.c:407: detach_shader: Assertion `shProg-&gt;Shaders[j]-&gt;Type == 0x8B31 || shProg-&gt;Shaders[j]-&gt;Type == 0x8B30' failed.</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.3..mesa-10.0.4
</pre>
<p>Anuj Phogat (4):</p>
<ul>
<li>mesa: Generate correct error code in glDrawBuffers()</li>
<li>mesa: Add GL_TEXTURE_CUBE_MAP_ARRAY to legal_get_tex_level_parameter_target()</li>
<li>glsl: Fix condition to generate shader link error</li>
<li>i965: Fix the region's pitch condition to use blitter</li>
</ul>
<p>Brian Paul (8):</p>
<ul>
<li>r200: move driContextSetFlags(ctx) call after ctx var is initialized</li>
<li>radeon: move driContextSetFlags(ctx) call after ctx var is initialized</li>
<li>gallium/auxiliary/indices: replace free() with FREE()</li>
<li>draw: fix incorrect color of flat-shaded clipped lines</li>
<li>st/mesa: avoid sw fallback for getting/decompressing textures</li>
<li>mesa: update assertion in detach_shader() for geom shaders</li>
<li>mesa: do depth/stencil format conversion in glGetTexImage</li>
<li>softpipe: use 64-bit arithmetic in softpipe_resource_layout()</li>
</ul>
<p>Carl Worth (4):</p>
<ul>
<li>docs: Add md5sums for 10.0.3 release</li>
<li>main: Avoid double-free of shader Label</li>
<li>get-pick-list: Update to only find patches nominated for the 10.0 branch</li>
<li>Update version to 10.0.4</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>i965: Validate (and resolve) all the bound textures.</li>
</ul>
<p>Christian König (1):</p>
<ul>
<li>radeon/uvd: fix feedback buffer handling v2</li>
</ul>
<p>Daniel Kurtz (1):</p>
<ul>
<li>glsl: Add locking to builtin_builder singleton</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>dri/nouveau: Pass the API into _mesa_initialize_context</li>
<li>nv50: correctly calculate the number of vertical blocks during transfer map</li>
<li>dri/i9*5: correctly calculate the amount of system memory</li>
</ul>
<p>Fredrik Höglund (3):</p>
<ul>
<li>mesa: Preserve the NewArrays state when copying a VAO</li>
<li>glx: Fix the default values for GLXFBConfig attributes</li>
<li>glx: Fix the GLXFBConfig attrib sort priorities</li>
</ul>
<p>Hans (2):</p>
<ul>
<li>util: don't define isfinite(), isnan() for MSVC &gt;= 1800</li>
<li>mesa: don't define c99 math functions for MSVC &gt;= 1800</li>
</ul>
<p>Ian Romanick (6):</p>
<ul>
<li>meta: Release resources used by decompress_texture_image</li>
<li>meta: Release resources used by _mesa_meta_DrawPixels</li>
<li>meta: Fallback to software for GetTexImage of compressed GL_TEXTURE_CUBE_MAP_ARRAY</li>
<li>meta: Consistenly use non-Apple VAO functions</li>
<li>glcpp: Only warn for macro names containing __</li>
<li>glsl: Only warn for macro names containing __</li>
</ul>
<p>Ilia Mirkin (3):</p>
<ul>
<li>nv30: report 8 maximum inputs</li>
<li>nouveau/video: make sure that firmware is present when checking caps</li>
<li>nouveau: fix chipset checks for nv1a by using the oclass instead</li>
</ul>
<p>Julien Cristau (1):</p>
<ul>
<li>glx/dri2: fix build failure on HURD</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>glsl: Don't lose precision qualifiers when encountering "centroid".</li>
<li>i965: Create a hardware context before initializing state module.</li>
</ul>
<p>Kusanagi Kouichi (1):</p>
<ul>
<li>targets/vdpau: Always use c++ to link</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>st/mesa: fix crash when a shader uses a TBO and it's not bound</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>glsl: Initialize ubo_binding_mask flags to zero.</li>
</ul>
<p>Paul Berry (2):</p>
<ul>
<li>glsl: Make condition_to_hir() callable from outside ast_iteration_statement.</li>
<li>glsl: Fix continue statements in do-while loops.</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>r600g/compute: PIPE_CAP_COMPUTE should be false for pre-evergreen GPUs</li>
</ul>
<p>Topi Pohjolainen (1):</p>
<ul>
<li>i965/blorp: do not use unnecessary hw-blending support</li>
</ul>
</div>
</body>
</html>

173
docs/relnotes/10.0.5.html Normal file
View File

@@ -0,0 +1,173 @@
<!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.5 Release Notes / April 18, 2014</h1>
<p>
Mesa 10.0.5 is a bug fix release which fixes bugs found since the 10.0.4 release.
</p>
<p>
Mesa 10.0.5 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>
db606aadd0fe321f3664099677d159bc MesaLib-10.0.5.tar.gz
e6009ccd8898d7104bb325b6af9ec354 MesaLib-10.0.5.tar.bz2
c8ab9e502542bf32299a4df85b0b704d MesaLib-10.0.5.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=58660">Bug 58660</a> - CAYMAN broken with HyperZ on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=64471">Bug 64471</a> - Radeon HD6570 lockup in Brütal Legend with HyperZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66352">Bug 66352</a> - GPU lockup in L4D2 on TURKS with HyperZ</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68799">Bug 68799</a> - [APITRACE] Hyper-Z lockup with Falcon BMS 4.32u6 on CAYMAN</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71547">Bug 71547</a> - compilation failure :#error &quot;SSE4.1 instruction set not enabled&quot;</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=72685">Bug 72685</a> - [radeonsi hyperz] Artifacts in Unigine Sanctuary</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73088">Bug 73088</a> - [HyperZ] Juniper (6770): Gone Home / Unigine Heaven 4.0 lock up system after several minutes of use</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74428">Bug 74428</a> - hyperz causes gpu hang in Counter-strike: Source</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74803">Bug 74803</a> - [r600g] HyperZ broken on RV630 (Cogs shadows are broken)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74863">Bug 74863</a> - [r600g] HyperZ broken on RV770 and CYPRESS (Left 4 Dead 2 trees corruption) bisected!</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74892">Bug 74892</a> - HyperZ GPU lockup with radeonsi 7970M PITCAIRN and Distance Alpha game</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74988">Bug 74988</a> - Buffer overrun (segfault) decompressing ETC2 texture in GLBenchmark 3.0 Manhattan</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75279">Bug 75279</a> - XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77102">Bug 77102</a> - gallium nouveau has no profile in vdpau and libva</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77207">Bug 77207</a> - [ivb/hsw] batch overwritten with garbage</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.4..mesa-10.0.5
</pre>
<p>Alex Deucher (1):</p>
<ul>
<li>radeon: reverse DBG_NO_HYPERZ logic</li>
</ul>
<p>Brian Paul (9):</p>
<ul>
<li>mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINT</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SARGB8()</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SRGB8()</li>
<li>mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up</li>
<li>st/mesa: add null pointer checking in query object functions</li>
<li>mesa: fix glMultiDrawArrays inside a display list</li>
<li>cso: fix sampler view count in cso_set_sampler_views()</li>
<li>svga: replace sampler assertion with conditional</li>
<li>svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add md5sums for the 10.0.4 release.</li>
<li>Ignore patches which don't apply.</li>
<li>Update version to 10.0.5</li>
</ul>
<p>Christian König (2):</p>
<ul>
<li>st/mesa: recreate sampler view on context change v3</li>
<li>st/mesa: fix sampler view handling with shared textures v4</li>
</ul>
<p>Courtney Goeltzenleuchter (1):</p>
<ul>
<li>mesa: add bounds checking to eliminate buffer overrun</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>mesa: return v.value_int64 when the requested type is TYPE_INT64</li>
<li>glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix buffer overruns in MSAA MCS buffer clearing.</li>
</ul>
<p>Ilia Mirkin (6):</p>
<ul>
<li>nouveau: fix fence waiting logic in screen destroy</li>
<li>nv50: adjust blit_3d handling of ms output textures</li>
<li>mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture</li>
<li>nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list</li>
<li>nouveau: there may not have been a texture if the fbo was incomplete</li>
<li>nouveau: fix firmware check on nvd7/nvd9</li>
</ul>
<p>Johannes Nixdorf (1):</p>
<ul>
<li>configure.ac: fix the detection of expat with pkg-config</li>
</ul>
<p>Jonathan Gray (1):</p>
<ul>
<li>gallium: add endian detection for OpenBSD</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>draw: Duplicate TGSI tokens in draw_pipe_pstipple module.</li>
</ul>
<p>Matt Turner (1):</p>
<ul>
<li>mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.</li>
</ul>
<p>Paul Berry (1):</p>
<ul>
<li>i965/gen7: Prefer vertical alignment of 4 when possible.</li>
</ul>
</div>
</body>
</html>

254
docs/relnotes/10.1.1.html Normal file
View File

@@ -0,0 +1,254 @@
<!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.1.1 Release Notes / April 18, 2014</h1>
<p>
Mesa 10.1.1 is a bug fix release which fixes bugs found since the 10.1 release.
</p>
<p>
Mesa 10.1.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 are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
96e63674ccfa98e7ec6eb4fee3f770c3 MesaLib-10.1.1.tar.gz
1fde7ed079df7aeb9b6a744ca033de8d MesaLib-10.1.1.tar.bz2
e64d0a562638664b13d2edf22321df59 MesaLib-10.1.1.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71547">Bug 71547</a> - compilation failure :#error &quot;SSE4.1 instruction set not enabled&quot;</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74868">Bug 74868</a> - r600g: Diablo III Crashes After a few minutes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74988">Bug 74988</a> - Buffer overrun (segfault) decompressing ETC2 texture in GLBenchmark 3.0 Manhattan</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75279">Bug 75279</a> - XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75543">Bug 75543</a> - OSMesa Gallium OSMesaMakeCurrent</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75660">Bug 75660</a> - u_inlines.h:277:pipe_buffer_map_range: Assertion `length' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76323">Bug 76323</a> - GLSL compiler ignores layout(binding=N) on uniform blocks</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76377">Bug 76377</a> - DRI3 should only be enabled on Linux due to a udev dependency</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76749">Bug 76749</a> - [HSW] DOTA world lighting has no effect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77102">Bug 77102</a> - gallium nouveau has no profile in vdpau and libva</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77207">Bug 77207</a> - [ivb/hsw] batch overwritten with garbage</li>
</ul>
<h2>Changes</h2>
<p>Aaron Watry (1):</p>
<ul>
<li>gallium/util: Fix memory leak</li>
</ul>
<p>Alexander von Gluck IV (1):</p>
<ul>
<li>haiku: Fix build through scons corrections and viewport fixes</li>
</ul>
<p>Anuj Phogat (2):</p>
<ul>
<li>mesa: Set initial internal format of a texture to GL_RGBA</li>
<li>mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in glTexImage{123}D()</li>
</ul>
<p>Brian Paul (12):</p>
<ul>
<li>softpipe: use 64-bit arithmetic in softpipe_resource_layout()</li>
<li>mesa: don't call ctx-&gt;Driver.ClearBufferSubData() if size==0</li>
<li>st/osmesa: check buffer size when searching for buffers</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SARGB8()</li>
<li>mesa: fix copy &amp; paste bugs in pack_ubyte_SRGB8()</li>
<li>c11/threads: don't include assert.h if the assert macro is already defined</li>
<li>mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up</li>
<li>st/mesa: add null pointer checking in query object functions</li>
<li>mesa: fix glMultiDrawArrays inside a display list</li>
<li>cso: fix sampler view count in cso_set_sampler_views()</li>
<li>svga: replace sampler assertion with conditional</li>
<li>svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>cherry-ignore: Ignore a few patches</li>
<li>glsl: Allow explicit binding on atomics again</li>
<li>Update VERSION to 10.1.1</li>
</ul>
<p>Chia-I Wu (1):</p>
<ul>
<li>i965/vec4: fix record clearing in copy propagation</li>
</ul>
<p>Christian König (2):</p>
<ul>
<li>st/mesa: recreate sampler view on context change v3</li>
<li>st/mesa: fix sampler view handling with shared textures v4</li>
</ul>
<p>Courtney Goeltzenleuchter (1):</p>
<ul>
<li>mesa: add bounds checking to eliminate buffer overrun</li>
</ul>
<p>Emil Velikov (5):</p>
<ul>
<li>nv50: add missing brackets when handling the samplers array</li>
<li>mesa: return v.value_int64 when the requested type is TYPE_INT64</li>
<li>configure: enable dri3 only for linux</li>
<li>glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path</li>
<li>configure: cleanup libudev handling</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix buffer overruns in MSAA MCS buffer clearing.</li>
</ul>
<p>Hans (2):</p>
<ul>
<li>util: don't define isfinite(), isnan() for MSVC &gt;= 1800</li>
<li>mesa: don't define c99 math functions for MSVC &gt;= 1800</li>
</ul>
<p>Ian Romanick (7):</p>
<ul>
<li>linker: Split set_uniform_binding into separate functions for blocks and samplers</li>
<li>linker: Various trivial clean-ups in set_sampler_binding</li>
<li>linker: Fold set_uniform_binding into call site</li>
<li>linker: Clean up "unused parameter" warnings</li>
<li>linker: Set block bindings based on UniformBlocks rather than UniformStorage</li>
<li>linker: Set binding for all elements of UBO array</li>
<li>glsl: Propagate explicit binding information from the AST all the way to the linker</li>
</ul>
<p>Ilia Mirkin (8):</p>
<ul>
<li>nouveau: fix fence waiting logic in screen destroy</li>
<li>nv50: adjust blit_3d handling of ms output textures</li>
<li>loader: add special logic to distinguish nouveau from nouveau_vieux</li>
<li>mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture</li>
<li>nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list</li>
<li>nouveau: there may not have been a texture if the fbo was incomplete</li>
<li>nvc0/ir: move sample id to second source arg to fix sampler2DMS</li>
<li>nouveau: fix firmware check on nvd7/nvd9</li>
</ul>
<p>Johannes Nixdorf (1):</p>
<ul>
<li>configure.ac: fix the detection of expat with pkg-config</li>
</ul>
<p>Jonathan Gray (7):</p>
<ul>
<li>gallium: add endian detection for OpenBSD</li>
<li>loader: use 0 instead of FALSE which isn't defined</li>
<li>loader: don't limit the non-udev path to only android</li>
<li>megadriver_stub.c: don't use _GNU_SOURCE to gate the compat code</li>
<li>egl/dri2: don't require libudev to build drm/wayland platforms</li>
<li>egl/dri2: use drm macros to construct device name</li>
<li>configure: don't require libudev for gbm or egl drm/wayland</li>
</ul>
<p>José Fonseca (4):</p>
<ul>
<li>c11/threads: Fix nano to milisecond conversion.</li>
<li>mapi/u_thread: Use GetCurrentThreadId</li>
<li>c11/threads: Don't implement thrd_current on Windows.</li>
<li>draw: Duplicate TGSI tokens in draw_pipe_pstipple module.</li>
</ul>
<p>Kenneth Graunke (4):</p>
<ul>
<li>i965/fs: Fix register comparisons in saturate propagation.</li>
<li>glsl: Fix lack of i2u in lower_ubo_reference.</li>
<li>i965: Stop advertising GL_MESA_ycbcr_texture.</li>
<li>glsl: Try vectorizing when seeing a repeated assignment to a channel.</li>
</ul>
<p>Marek Olšák (13):</p>
<ul>
<li>r600g: fix texelFetchOffset GLSL functions</li>
<li>r600g: fix blitting the last 2 mipmap levels for Evergreen</li>
<li>mesa: fix the format of glEdgeFlagPointer</li>
<li>r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits</li>
<li>st/mesa: fix per-vertex edge flags and GLSL support (v2)</li>
<li>mesa: mark GL_RGB9_E5 as not color-renderable</li>
<li>mesa: fix texture border handling for cube arrays</li>
<li>mesa: allow generating mipmaps for cube arrays</li>
<li>mesa: fix software fallback for generating mipmaps for cube arrays</li>
<li>mesa: fix software fallback for generating mipmaps for 3D textures</li>
<li>st/mesa: fix generating mipmaps for cube arrays</li>
<li>st/mesa: drop the lowering of quad strips to triangle strips</li>
<li>r600g: implement edge flags</li>
</ul>
<p>Matt Turner (4):</p>
<ul>
<li>mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.</li>
<li>i965/fs: Fix off-by-one in saturate propagation.</li>
<li>i965/fs: Don't propagate saturate modifiers into partial writes.</li>
<li>i965/fs: Don't propagate saturation modifiers if there are source modifiers.</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>r600g: Don't leak bytecode on shader compile failure</li>
</ul>
<p>Mike Stroyan (1):</p>
<ul>
<li>i965: Avoid dependency hints on math opcodes</li>
</ul>
<p>Thomas Hellstrom (5):</p>
<ul>
<li>winsys/svga: Replace the query mm buffer pool with a slab pool v3</li>
<li>winsys/svga: Update the vmwgfx_drm.h header to latest version from kernel</li>
<li>winsys/svga: Fix prime surface references also for guest-backed surfaces</li>
<li>st/xa: Bind destination before setting new state</li>
<li>st/xa: Make sure unused samplers are set to NULL</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>configure: Use LLVM shared libraries by default</li>
</ul>
</div>
</body>
</html>

179
docs/relnotes/10.1.2.html Normal file
View File

@@ -0,0 +1,179 @@
<!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.1.2 Release Notes / (May 5, 2014)</h1>
<p>
Mesa 10.1.2 is a bug fix release which fixes bugs found since the 10.1.1 release.
</p>
<p>
Mesa 10.1.2 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>
37d79f94b1f41852a89d1fc3900bea76 MesaLib-10.1.2.tar.gz
28b60d15ac9f364da1e0155911eaf44e MesaLib-10.1.2.tar.bz2
05300039085a65fc53c5472c4bb5747a MesaLib-10.1.2.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=27499">Bug 27499</a> - [855GM i915] GL_LINE_STIPPLE displays incorrect colors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75723">Bug 75723</a> - (regression since Linux 3.14?) brw_get_graphics_reset_status: Assertion `brw-&gt;hw_ctx != ((void *)0)' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76894">Bug 76894</a> - Piglit/spec/EXT_framebuffer_object/fbo-bind-renderbuffer failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77702">Bug 77702</a> - [i965 Bisected]Piglit spec/NV_conditional_render_blitframebuffer fails</li>
</ul>
<h2>Changes</h2>
<p>Ander Conselvan de Oliveira (2):</p>
<ul>
<li>gbm/dri: Fix out-of-memory error path in dri_device_create()</li>
<li>egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM</li>
</ul>
<p>Anuj Phogat (27):</p>
<ul>
<li>mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)</li>
<li>swrast: Add glBlitFramebuffer to commands affected by conditional rendering</li>
<li>mesa: Fix error condition for multisample proxy texture targets</li>
<li>i965: Put an assertion to check valid varying_to_slot[varying]</li>
<li>i965: Fix component mask and varying_to_slot mapping for gl_Layer</li>
<li>i965: Fix component mask and varying_to_slot mapping for gl_ViewportIndex</li>
<li>mesa: Add helper function _mesa_is_format_integer()</li>
<li>mesa: Add error condition for integer formats in glGetTexImage()</li>
<li>mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()</li>
<li>mesa: Fix error code generation in glReadPixels()</li>
<li>glsl: Allow overlapping locations for vertex input attributes</li>
<li>mesa: Fix querying location of nth element of an array variable</li>
<li>mesa: Use location VERT_ATTRIB_GENERIC0 for vertex attribute 0</li>
<li>glsl: Compile error if fs defines conflicting qualifiers for gl_FragCoord</li>
<li>glsl: Compile error if fs uses gl_FragCoord before first redeclaration</li>
<li>mesa: Add entry for extension ARB_texture_stencil8</li>
<li>mesa: Add error condition for format=STENCIL_INDEX in glGetTexImage()</li>
<li>i965: Fix crash in do_blit_readpixels()</li>
<li>mesa: Add missing types in _mesa_texstore_xx_xx() functions</li>
<li>mesa: Allow srcFormat=GL_DEPTH_STENCIL in _mesa_texstore_xx_xx() functions</li>
<li>mesa: Add new helper function _mesa_unpack_depth_stencil_row()</li>
<li>mesa: Add support to unpack depth-stencil texture in to FLOAT_32_UNSIGNED_INT_24_8_REV</li>
<li>mesa: Allow FLOAT_32_UNSIGNED_INT_24_8_REV in get_tex_depth_stencil()</li>
<li>i965: Add glBlitFramebuffer to commands affected by conditional rendering</li>
<li>glsl: Use switch to allow adding more shader types</li>
<li>glsl: Link error if fs defines conflicting qualifiers for gl_FragCoord</li>
<li>glsl: Apply the link error conditions to GL_ARB_fragment_coord_conventions</li>
</ul>
<p>Benjamin Bellec (1):</p>
<ul>
<li>mesa: fix GetStringi error message with correct function name</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>swrast: allocate swrast_texture_image::ImageSlices array if needed</li>
</ul>
<p>Carl Worth (4):</p>
<ul>
<li>docs: Add the MD5 sums for the 10.1.1 release tar files.</li>
<li>cherry-ignore: Ignore a patch causing a regression</li>
<li>cherry-ignore: Drop an ignored patch now that piglit has been updated.</li>
<li>Update VERSION to 10.1.2</li>
</ul>
<p>Chris Forbes (1):</p>
<ul>
<li>glsl: Only allow `invariant` on shader in/out between stages.</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Fix render-to-texture in non-FinishRenderTexture cases.</li>
</ul>
<p>Ian Romanick (1):</p>
<ul>
<li>dri3: Enable GLX_MESA_query_renderer on DRI3 too</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>i965: Don't enable reset notification support on Gen4-5.</li>
<li>i965: Actually emit PIPELINE_SELECT and 3DSTATE_VF_STATISTICS.</li>
</ul>
<p>Marek Olšák (10):</p>
<ul>
<li>r300g: don't crash when getting NULL colorbuffers</li>
<li>st/mesa: remove trailing NULL colorbuffers</li>
<li>r600g: fix edge flags and layered rendering on R600-R700</li>
<li>r600g: disable async DMA on R700</li>
<li>r600g: fix MSAA resolve on R6xx when the destination is 1D-tiled</li>
<li>r600g: fix flushing on RV670, RS780, RS880 again</li>
<li>r600g: fix buffer copying on R600-R700</li>
<li>r600g: fix for broken CULL_FRONT behavior on R6xx</li>
<li>r600g: fix for an MSAA hang on RV770</li>
<li>r600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISC</li>
</ul>
<p>Michel Dänzer (2):</p>
<ul>
<li>r600g: Disable LLVM by default at runtime for graphics</li>
<li>st/mesa: Fix NULL pointer dereference for incomplete framebuffers</li>
</ul>
<p>Neil Roberts (1):</p>
<ul>
<li>wayland: Fix the logic in disabling the prime capability</li>
</ul>
<p>Samuel Iglesias Gonsalvez (1):</p>
<ul>
<li>mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Cache render target surface</li>
</ul>
<p>nick (1):</p>
<ul>
<li>swrast: Fix vertex color in _swsetup_Translate()</li>
</ul>
</div>
</body>
</html>

90
docs/relnotes/10.1.3.html Normal file
View File

@@ -0,0 +1,90 @@
<!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.1.3 Release Notes / (May 9, 2014)</h1>
<p>
Mesa 10.1.3 is a bug fix release which fixes bugs found since the 10.1.2 release.
</p>
<p>
Note: Mesa 10.1.3 is being released sooner than originally scheduled to make
available a fix for a performance rgression that was inadvertently introduced
to Mesa 10.1.2. The performance regression is reported to make vmware
swapbuffers fall back to software.
</p>
<p>
Mesa 10.1.3 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>
665fe1656aaa2c37b32042068aff92cb MesaLib-10.1.3.tar.gz
ba6dbe2b9cab0b4de840c996b9b6a3ad MesaLib-10.1.3.tar.bz2
4e6f26330a63d3c47e62ac4bdead39e8 MesaLib-10.1.3.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=77245">Bug 77245</a> - Bogus GL_ARB_explicit_attrib_location layout identifier warnings</li>
</ul>
<h2>Changes</h2>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add MD5 sums for Mesa 10.1.2</li>
<li>get-pick-list.sh: Require explicit "10.1" for nominating stable patches</li>
<li>VERSION: Update to 10.1.3</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>mesa: Fix MaxNumLayers for 1D array textures.</li>
<li>i965: Fix depth (array slices) computation for 1D_ARRAY render targets.</li>
</ul>
<p>Tapani Pälli (1):</p>
<ul>
<li>glsl: fix bogus layout qualifier warnings</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Fix performance regression introduced by commit "Cache render target surface"</li>
</ul>
</div>
</body>
</html>

100
docs/relnotes/10.1.4.html Normal file
View File

@@ -0,0 +1,100 @@
<!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.1.4 Release Notes / (May 20, 2014)</h1>
<p>
Mesa 10.1.4 is a bug fix release which fixes bugs found since the 10.1.3 release.
</p>
<p>
Mesa 10.1.4 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>
e934365d77f384bfaec844999440bef8 MesaLib-10.1.4.tar.gz
6fddee101f49b7409cd29994c34ddee7 MesaLib-10.1.4.tar.bz2
ba5f48e7d5e373922c804c2651fec6c1 MesaLib-10.1.4.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=78225">Bug 78225</a> - Compile error due to undefined reference to `gbm_dri_backend', fix attached</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78537">Bug 78537</a> - no anisotropic filtering in a native Half-Life 2</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix double-freeing of dispatch tables inside glBegin/End.</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add MD5 sums for 10.1.3</li>
<li>cherry-ignore: Roland and Michel agreed to drop these patches.</li>
<li>VERSION: Update to 10.1.4</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>configure: error out if building GBM without dri</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/vs: Use samplers for UBOs in the VS like we do for non-UBO pulls.</li>
</ul>
<p>Ilia Mirkin (3):</p>
<ul>
<li>nv50/ir: make sure to reverse cond codes on all the OP_SET variants</li>
<li>nv50: fix setting of texture ms info to be per-stage</li>
<li>nv50/ir: fix integer mul lowering for u32 x u32 -&gt; high u32</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Fix anisotropic filtering state setup</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>configure.ac: Add LLVM_VERSION_PATCH to DEFINES</li>
<li>radeonsi: Enable geometry shaders with LLVM 3.4.1</li>
</ul>
</div>
</body>
</html>

105
docs/relnotes/10.1.5.html Normal file
View File

@@ -0,0 +1,105 @@
<!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.1.5 Release Notes / (June 6, 2014)</h1>
<p>
Mesa 10.1.5 is a bug fix release which fixes bugs found since the 10.1.4 release.
</p>
<p>
Mesa 10.1.5 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>SHA256 checksums</h2>
<pre>
b0aceaa75bc9a9b2d9215a113e2ad488b5cf85c99005a7624f8cf7c37c5d0eaa MesaLib-10.1.5.tar.gz
bc6c5ec7836f254a49d055a29d9aa34c97c54c038f47ad3a00fa57a5fef15bbc MesaLib-10.1.5.tar.bz2
78b7255cab0af7918945452a84de7989096ebcdd27e99b31c56c0589274cbc77 MesaLib-10.1.5.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=79115">Bug 79115</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79421">Bug 79421</a> - </li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>glsl: fix use-after free bug/crash in ast_declarator_list::hir()</li>
</ul>
<p>Carl Worth (5):</p>
<ul>
<li>docs: Add md5sums for 10.1.4 release</li>
<li>Merge remote-tracking branch 'origin/10.1' into 10.1</li>
<li>cherry-ignore: Ignore two commits.</li>
<li>Ignore a patch that is not needed for the 10.1 branch.</li>
<li>Update version to 10.1.5</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>glx: do not leak dri3Display</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv50/ir: fix s32 x s32 -&gt; high s32 multiply logic</li>
<li>nv50/ir: fix constant folding for OP_MUL subop HIGH</li>
</ul>
<p>James Legg (1):</p>
<ul>
<li>mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT</li>
</ul>
<p>Jeremy Huddleston Sequoia (2):</p>
<ul>
<li>glapi: Avoid heap corruption in _glapi_table</li>
<li>darwin: Fix test for kCGLPFAOpenGLProfile support at runtime</li>
</ul>
<p>Pavel Popov (2):</p>
<ul>
<li>i965: Properly return *RESET* status in glGetGraphicsResetStatusARB</li>
<li>i965: Fix Line Stipple enable bit in 3DSTATE_SF for Haswell.</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>llvmpipe: fix crash when not all attachments are populated in a fb</li>
</ul>
</div>
</body>
</html>

138
docs/relnotes/10.1.6.html Normal file
View File

@@ -0,0 +1,138 @@
<!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.1.6 Release Notes / (June 24, 2014)</h1>
<p>
Mesa 10.1.6 is a bug fix release which fixes bugs found since the 10.1.5 release.
</p>
<p>
Mesa 10.1.6 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>SHA256 checksums</h2>
<pre>
cde60e06b340d7598802fe4a4484b3fb8befd714f9ab9caabe1f27d3149e8815 MesaLib-10.1.6.tar.bz2
e4e726d7805a442f7ed07d12f71335e6126796ec85328a5989eb5348a8042d00 MesaLib-10.1.6.tar.gz
bf7e3f721a7ad0c2057a034834b6fea688e64f26a66cf8d1caa2827e405e72dd MesaLib-10.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=54372">Bug 54372</a> - GLX_INTEL_swap_event crashes driver when swapping window buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74005">Bug 74005</a> - [i965 Bisected]Piglit/glx_glx-make-glxdrawable-current fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78581">Bug 78581</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79729">Bug 79729</a> - [i965] glClear on a multisample texture doesn't work</li>
</ul>
<h2>Changes</h2>
<p>Adrian Negreanu (7):</p>
<ul>
<li>add megadriver_stub_FILES</li>
<li>android: adapt to the megadriver mechanism</li>
<li>android: add libloader to libGLES_mesa and libmesa_egl_dri2</li>
<li>android: add src/gallium/auxiliary as include path for libmesa_dricore</li>
<li>android, egl: add correct drm include for libmesa_egl_dri2</li>
<li>android, mesa_gen_matypes: pull in timespec POSIX definition</li>
<li>android, dricore: undefined reference to _mesa_streaming_load_memcpy</li>
</ul>
<p>Beren Minor (1):</p>
<ul>
<li>egl/main: Fix eglMakeCurrent when releasing context from current thread.</li>
</ul>
<p>Carl Worth (3):</p>
<ul>
<li>docs: Add SHA256 checksums for the 10.1.5 release</li>
<li>cherry-ignore: Add a patch to ignore</li>
<li>Update VERSION to 10.1.6</li>
</ul>
<p>Daniel Manjarres (1):</p>
<ul>
<li>glx: Don't crash on swap event for a Window (non-GLXWindow)</li>
</ul>
<p>Emil Velikov (1):</p>
<ul>
<li>configure: error out when building opencl without LLVM</li>
</ul>
<p>Iago Toral Quiroga (1):</p>
<ul>
<li>mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.</li>
</ul>
<p>José Fonseca (3):</p>
<ul>
<li>mesa/main: Make get_hash.c values constant.</li>
<li>mesa: Make glGetIntegerv(GL_*_ARRAY_SIZE) return GL_BGRA.</li>
<li>mesa/main: Prevent sefgault on glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING).</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>mesa: Remove glClear optimization based on drawable size</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>configure: Only check for OpenCL without LLVM when the latter is certain</li>
</ul>
<p>Neil Roberts (1):</p>
<ul>
<li>i965: Set the fast clear color value for texture surfaces</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>draw: (trivial) fix clamping of viewport index</li>
</ul>
<p>Tobias Klausmann (1):</p>
<ul>
<li>nv50/ir: clear subop when folding constant expressions</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>clover: Prevent Clang from printing number of errors and warnings to stderr.</li>
<li>clover: Don't use llvm's global context</li>
</ul>
</div>
</body>
</html>

View File

@@ -14,7 +14,7 @@
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 10.1 Release Notes / TBD</h1>
<h1>Mesa 10.1 Release Notes / March 4, 2014</h1>
<p>
Mesa 10.1 is a new development release.
@@ -33,7 +33,9 @@ because compatibility contexts are not supported.
<h2>MD5 checksums</h2>
<pre>
TBD.
3ec43f79dbcd9aa2a4a27bf1f51655b6 MesaLib-10.1.0.tar.bz2
08e796ec7122aa299d32d4f67a254315 MesaLib-10.1.0.tar.gz
bd365356543f4b38e57c1ddf7a317c40 MesaLib-10.1.0.zip
</pre>
@@ -52,7 +54,7 @@ it.</li>
<li>GL_AMD_shader_trinary_minmax.</li>
<li>GL_EXT_framebuffer_blit on r200 and radeon.</li>
<li>Reduced memory usage for display lists.</li>
<li>OpenGL 3.3 support on nv50, nvc0</li>
<li>OpenGL 3.3 support on nv50, nvc0, r600 and radeonsi</li>
</ul>

61
docs/relnotes/10.2.1.html Normal file
View File

@@ -0,0 +1,61 @@
<!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.2.1 Release Notes / June 6, 2014</h1>
<p>
Mesa 10.2.1 is a bug fix release which fixes bugs found since the 10.2 release.
</p>
<p>
Mesa 10.2.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 are not supported.
</p>
<h2>MD5 checksums</h2>
<pre>
96f892dae2d0bb14ac9c2113f586c909 MesaLib-10.2.1.tar.gz
093f9b5d077e5f6061dcd7b01b7aa51a MesaLib-10.2.1.tar.bz2
6ab76c1608e5deed1eb8b54c62d7a48a MesaLib-10.2.1.zip
</pre>
<h2>New features</h2>
<p>None</p>
<h2>Bug fixes</h2>
<p>
Mesa 10.2 had a build problem in the radeonsi driver due to an error resolving
conflicts in a patch cherry-pick from master. The build error is fixed.
</p>
<h2>Changes</h2>
<p>Ian Romanick (3):</p>
<ul>
<li>docs: Add MD5 checksum, etc. for 10.1 release</li>
<li>radeonsi: Fix build error introduced in 5ab9a9c</li>
<li>Bump version to 10.2.1</li>
</ul>
</div>
</body>
</html>

181
docs/relnotes/10.2.2.html Normal file
View File

@@ -0,0 +1,181 @@
<!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.2.2 Release Notes / June 24, 2014</h1>
<p>
Mesa 10.2.2 is a bug fix release which fixes bugs found since the 10.2.1 release.
</p>
<p>
Mesa 10.2.2 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>SHA256 checksums</h2>
<pre>
38c4a40364000f89cddaa1694f6f3cfb444981d1110238ce603093585477399c MesaLib-10.2.2.tar.bz2
2af2ec8b4db624c352e961eefbcce6c8d1f86d44c5542f6f378c50e1b958d453 MesaLib-10.2.2.tar.gz
d4c0372da59367a344d62ebcdf5cf61039c9cae6925f40f2dab8f8d95cf22da9 MesaLib-10.2.2.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=54372">Bug 54372</a> - GLX_INTEL_swap_event crashes driver when swapping window buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66452">Bug 66452</a> - JUNIPER UVD accelerated playback of WMV3 streams does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74005">Bug 74005</a> - [i965 Bisected]Piglit/glx_glx-make-glxdrawable-current fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77865">Bug 77865</a> - [BDW] Many Ogles3conform framebuffer_blit cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78581">Bug 78581</a> - OpenCL: clBuildProgram prints error messages directly rather than storing them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79029">Bug 79029</a> - INTEL_DEBUG=shader_time is full of lies</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79729">Bug 79729</a> - [i965] glClear on a multisample texture doesn't work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79907">Bug 79907</a> - Mesa 10.2.1 --enable-vdpau default=auto broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80115">Bug 80115</a> - MESA_META_DRAW_BUFFERS induced GL_INVALID_VALUE errors</li>
</ul>
<h2>Changes</h2>
<p>Adrian Negreanu (8):</p>
<ul>
<li>add megadriver_stub_FILES</li>
<li>android: adapt to the megadriver mechanism</li>
<li>android: add libloader to libGLES_mesa and libmesa_egl_dri2</li>
<li>android: add src/gallium/auxiliary as include path for libmesa_dricore</li>
<li>android, egl: add correct drm include for libmesa_egl_dri2</li>
<li>android, egl: typo dri2_fallback_pixmap_surface -&gt; dri2_fallback_create_pixmap_surface</li>
<li>android, mesa_gen_matypes: pull in timespec POSIX definition</li>
<li>android, dricore: undefined reference to _mesa_streaming_load_memcpy</li>
</ul>
<p>Carl Worth (1):</p>
<ul>
<li>Update VERSION to 10.2.2</li>
</ul>
<p>Daniel Manjarres (1):</p>
<ul>
<li>glx: Don't crash on swap event for a Window (non-GLXWindow)</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>targets/xa: limit the amount of exported symbols</li>
<li>configure: error out when building opencl without LLVM</li>
<li>configure: correctly autodetect xvmc/vdpau/omx</li>
</ul>
<p>Grigori Goronzy (1):</p>
<ul>
<li>radeon/uvd: disable VC-1 simple/main on UVD 2.x</li>
</ul>
<p>Iago Toral Quiroga (1):</p>
<ul>
<li>mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.</li>
</ul>
<p>Ian Romanick (3):</p>
<ul>
<li>docs: Add initial 10.2.1 release notes</li>
<li>docs: Add MD5 checksum, etc. for 10.2.1 release</li>
<li>meta: Respect the driver's maximum number of draw buffers</li>
</ul>
<p>Ilia Mirkin (7):</p>
<ul>
<li>gk110/ir: emit saturate flag on fadd when needed</li>
<li>gk110/ir: fix emitting constbuf file index</li>
<li>gk110/ir: fix bfind emission</li>
<li>nv50: make sure to mark first scissor dirty after blit</li>
<li>nv30: plug some memory leaks on screen destroy and shader compile</li>
<li>nv30: avoid dangling references to deleted contexts</li>
<li>nv30: hack to avoid errors on unexpected color/zeta combinations</li>
</ul>
<p>Jason Ekstrand (1):</p>
<ul>
<li>meta_blit: properly compute texture width for the CopyTexSubImage fallback</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>mesa/main: Prevent sefgault on glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING).</li>
</ul>
<p>Kenneth Graunke (9):</p>
<ul>
<li>i965: Don't use the head sentinel as an fs_inst in Gen4 workaround code.</li>
<li>i965: Invalidate live intervals when inserting Gen4 SEND workarounds.</li>
<li>i965/vec4: Fix dead code elimination for VGRFs of size &gt; 1.</li>
<li>i965: Add missing MOCS setup for 3DSTATE_INDEX_BUFFER on Broadwell.</li>
<li>i965: Drop Broadwell perf_debugs about missing MOCS that aren't missing.</li>
<li>i965: Add missing newlines to a few perf_debug messages.</li>
<li>i965/vec4: Use the sampler for pull constant loads on Broadwell.</li>
<li>i965: Use 8x4 aligned rectangles for HiZ operations on Broadwell.</li>
<li>i965: Save meta stencil blit programs in the context.</li>
</ul>
<p>Kristian Høgsberg (1):</p>
<ul>
<li>mesa: Remove glClear optimization based on drawable size</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>configure: Only check for OpenCL without LLVM when the latter is certain</li>
</ul>
<p>Neil Roberts (1):</p>
<ul>
<li>i965: Set the fast clear color value for texture surfaces</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>clover: Prevent Clang from printing number of errors and warnings to stderr.</li>
<li>clover: Don't use llvm's global context</li>
</ul>
<p>Ville Syrjälä (1):</p>
<ul>
<li>i915: Fix gen2 texblend setup</li>
</ul>
</div>
</body>
</html>

130
docs/relnotes/10.2.3.html Normal file
View File

@@ -0,0 +1,130 @@
<!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.2.3 Release Notes / July 7, 2014</h1>
<p>
Mesa 10.2.3 is a bug fix release which fixes bugs found since the 10.2.2 release.
</p>
<p>
Mesa 10.2.3 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>SHA256 checksums</h2>
<pre>
e482a96170c98b17d6aba0d6e4dda4b9a2e61c39587bb64ac38cadfa4aba4aeb MesaLib-10.2.3.tar.bz2
96cffacaa1c52ae659b3b0f91be2eebf5528b748934256751261fb79ea3d6636 MesaLib-10.2.3.tar.gz
82cab6ff14c8038ee39842dbdea0d447a78d119efd8d702d1497bc7c246434e9 MesaLib-10.2.3.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=76223">Bug 76223</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79823">Bug 79823</a> - </li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80015">Bug 80015</a> - </li>
</ul>
<h2>Changes</h2>
<p>Aaron Watry (1):</p>
<ul>
<li>radeon/llvm: Allocate space for kernel metadata operands</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.2.2 release</li>
<li>cherry-ignore: Add a patch that's been rejected</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>nouveau: dup fd before passing it to device</li>
<li>nv50: disable dedicated ubo upload method</li>
<li>nv50: do an explicit flush on draw when there are persistent buffers</li>
<li>nvc0: add a memory barrier when there are persistent UBOs</li>
</ul>
<p>Jasper St. Pierre (1):</p>
<ul>
<li>glxext: Send the Drawable's ID in the GLX_BufferSwapComplete event</li>
</ul>
<p>Kenneth Graunke (3):</p>
<ul>
<li>i965: Don't emit SURFACE_STATEs for gather workarounds on Broadwell.</li>
<li>i965: Include marketing names for Broadwell GPUs.</li>
<li>i965/disasm: Fix INTEL_DEBUG=fs on Broadwell for ARB_fp applications.</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeon/llvm: Use the llvm.rsq.clamped intrinsic for RSQ</li>
</ul>
<p>Rob Clark (9):</p>
<ul>
<li>xa: fix segfault</li>
<li>freedreno: use OUT_RELOCW when buffer is written</li>
<li>freedreno/a3xx: fix depth/stencil GMEM positioning</li>
<li>freedreno/a3xx: fix depth/stencil gmem restore</li>
<li>freedreno/a3xx: fix blend opcode</li>
<li>freedreno: few caps fixes</li>
<li>freedreno/a3xx: texture fixes</li>
<li>freedreno: fix for null textures</li>
<li>freedreno/a3xx: vtx formats</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>draw: (trivial) fix clamping of viewport index</li>
</ul>
<p>Takashi Iwai (1):</p>
<ul>
<li>llvmpipe: Fix zero-division in llvmpipe_texture_layout()</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Don't close the drm fd on failure v2</li>
</ul>
<p>Tobias Klausmann (1):</p>
<ul>
<li>nv50/ir: allow gl_ViewportIndex to work on non-provoking vertices</li>
</ul>
</div>
</body>
</html>

127
docs/relnotes/10.2.4.html Normal file
View File

@@ -0,0 +1,127 @@
<!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.2.4 Release Notes / July 18, 2014</h1>
<p>
Mesa 10.2.4 is a bug fix release which fixes bugs found since the 10.2.3 release.
</p>
<p>
Mesa 10.2.4 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>SHA256 checksums</h2>
<pre>
06a2341244eb85c283f59f70161e06ded106f835ed9b6be1ef0243bd9344811a MesaLib-10.2.4.tar.bz2
33e3c8b4343503e7d7d17416c670438860a2fd99ec93ea3327f73c3abe33b5e4 MesaLib-10.2.4.tar.gz
e26791a4a62a61b82e506e6ba031812d09697d1a831e8239af67e5722a8ee538 MesaLib-10.2.4.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=81157">Bug 81157</a> - [BDW]Piglit some spec_glsl-1.50_execution_built-in-functions* cases fail</li>
</ul>
<h2>Changes</h2>
<p>Abdiel Janulgue (3):</p>
<ul>
<li>i965/fs: Refactor check for potential copy propagated instructions.</li>
<li>i965/fs: skip copy-propate for logical instructions with negated src entries</li>
<li>i965/vec4: skip copy-propate for logical instructions with negated src entries</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: fix geometry shader memory leaks</li>
<li>st/mesa: fix geometry shader memory leak</li>
<li>gallium/u_blitter: fix some shader memory leaks</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 checksums for the 10.2.3 release</li>
<li>Update VERSION to 10.2.4</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Generalize the pixel_x/y workaround for all UW types.</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>nv50/ir: retrieve shadow compare from first arg</li>
<li>nv50/ir: ignore bias for samplerCubeShadow on nv50</li>
<li>nvc0/ir: do quadops on the right texture coordinates for TXD</li>
<li>nvc0/ir: use manual TXD when offsets are involved</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>i965: Add auxiliary surface field #defines for Broadwell.</li>
</ul>
<p>Kenneth Graunke (9):</p>
<ul>
<li>i965: Don't copy propagate abs into Broadwell logic instructions.</li>
<li>i965: Set execution size to 8 for instructions with force_sechalf set.</li>
<li>i965/fs: Set force_uncompressed and force_sechalf on samplepos setup.</li>
<li>i965/fs: Use WE_all for gl_SampleID header register munging.</li>
<li>i965: Add plumbing for Broadwell's auxiliary surface support.</li>
<li>i965: Drop SINT workaround for CMS layout on Broadwell.</li>
<li>i965: Hook up the MCS buffers in SURFACE_STATE on Broadwell.</li>
<li>i965: Add 2x MSAA support to the MCS allocation function.</li>
<li>i965: Enable compressed multisample support (CMS) on Broadwell.</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>gallium: fix u_default_transfer_inline_write for textures</li>
<li>st/mesa: fix samplerCubeShadow with bias</li>
<li>radeonsi: fix samplerCubeShadow with bias</li>
<li>radeonsi: add support for TXB2</li>
</ul>
<p>Matt Turner (8):</p>
<ul>
<li>i965/vec4: Don't return void from a void function.</li>
<li>i965/vec4: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Make try_constant_propagate() static.</li>
<li>i965/fs: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/vec4: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/fs: Don't use brw_imm_* unnecessarily.</li>
<li>i965/fs: Set correct number of regs_written for MCS fetches.</li>
</ul>
</div>
</body>
</html>

188
docs/relnotes/10.2.5.html Normal file
View File

@@ -0,0 +1,188 @@
<!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.2.5 Release Notes / August 2, 2014</h1>
<p>
Mesa 10.2.5 is a bug fix release which fixes bugs found since the 10.2.4 release.
</p>
<p>
Mesa 10.2.5 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>SHA256 checksums</h2>
<pre>
b4459f0bf7f4a3c8fb78ece3c9d2eac3d0e5bf38cb470f2a72705e744bd0310d MesaLib-10.2.5.tar.bz2
7b4dd0cb683f8c7dc48a3e7a315742bed58ddcd7b756c462aca4177bd1acdc79 MesaLib-10.2.5.tar.gz
6180565914fb238dd77ccdaff96b6155d9a6e1b3e981ebbf6a6851301b384fed MesaLib-10.2.5.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=80991">Bug 80991</a> - [BDW]Piglit spec_ARB_sample_shading_builtin-gl-sample-mask_2 fails</li>
</ul>
<h2>Changes</h2>
<p>Abdiel Janulgue (3):</p>
<ul>
<li>i965/fs: Refactor check for potential copy propagated instructions.</li>
<li>i965/fs: skip copy-propate for logical instructions with negated src entries</li>
<li>i965/vec4: skip copy-propate for logical instructions with negated src entries</li>
</ul>
<p>Adel Gadllah (1):</p>
<ul>
<li>i915: Fix up intelInitScreen2 for DRI3</li>
</ul>
<p>Anuj Phogat (2):</p>
<ul>
<li>i965: Fix z_offset computation in intel_miptree_unmap_depthstencil()</li>
<li>mesa: Don't use memcpy() in _mesa_texstore() for float depth texture data</li>
</ul>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: fix geometry shader memory leaks</li>
<li>st/mesa: fix geometry shader memory leak</li>
<li>gallium/u_blitter: fix some shader memory leaks</li>
</ul>
<p>Carl Worth (6):</p>
<ul>
<li>docs: Add sha256 checksums for the 10.2.3 release</li>
<li>Update VERSION to 10.2.4</li>
<li>Add release notes for 10.2.4</li>
<li>docs: Add SHA256 checksums for the 10.2.4 release</li>
<li>cherry-ignore: Ignore a few patches picked in the previous stable release</li>
<li>Update version to 10.2.5</li>
</ul>
<p>Christian König (1):</p>
<ul>
<li>radeonsi: fix order of r600_need_dma_space and r600_context_bo_reloc</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965: Generalize the pixel_x/y workaround for all UW types.</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>mesa: Don't allow GL_TEXTURE_BORDER queries outside compat profile</li>
<li>mesa: Don't allow GL_TEXTURE_{LUMINANCE,INTENSITY}_* queries outside compat profile</li>
</ul>
<p>Ilia Mirkin (5):</p>
<ul>
<li>nv50/ir: retrieve shadow compare from first arg</li>
<li>nv50/ir: ignore bias for samplerCubeShadow on nv50</li>
<li>nvc0/ir: do quadops on the right texture coordinates for TXD</li>
<li>nvc0/ir: use manual TXD when offsets are involved</li>
<li>nvc0: make sure that the local memory allocation is aligned to 0x10</li>
</ul>
<p>Jason Ekstrand (2):</p>
<ul>
<li>main/format_pack: Fix a wrong datatype in pack_ubyte_R8G8_UNORM</li>
<li>main/get_hash_params: Add GL_SAMPLE_SHADING_ARB</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>i965: Add auxiliary surface field #defines for Broadwell.</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>st/wgl: Clamp wglChoosePixelFormatARB's output nNumFormats to nMaxFormats.</li>
</ul>
<p>Kenneth Graunke (13):</p>
<ul>
<li>i965: Don't copy propagate abs into Broadwell logic instructions.</li>
<li>i965: Set execution size to 8 for instructions with force_sechalf set.</li>
<li>i965/fs: Set force_uncompressed and force_sechalf on samplepos setup.</li>
<li>i965/fs: Use WE_all for gl_SampleID header register munging.</li>
<li>i965: Add plumbing for Broadwell's auxiliary surface support.</li>
<li>i965: Drop SINT workaround for CMS layout on Broadwell.</li>
<li>i965: Hook up the MCS buffers in SURFACE_STATE on Broadwell.</li>
<li>i965: Add 2x MSAA support to the MCS allocation function.</li>
<li>i965: Enable compressed multisample support (CMS) on Broadwell.</li>
<li>i965: Add missing persample_shading field to brw_wm_debug_recompile.</li>
<li>i965/fs: Fix gl_SampleID for 2x MSAA and SIMD16 mode.</li>
<li>i965/fs: Fix gl_SampleMask handling for SIMD16 on Gen8+.</li>
<li>i965/fs: Set LastRT on the final FB write on Broadwell.</li>
</ul>
<p>Marek Olšák (14):</p>
<ul>
<li>gallium: fix u_default_transfer_inline_write for textures</li>
<li>st/mesa: fix samplerCubeShadow with bias</li>
<li>radeonsi: fix samplerCubeShadow with bias</li>
<li>radeonsi: add support for TXB2</li>
<li>r600g: switch SNORM conversion to DX and GLES behavior</li>
<li>radeonsi: fix CMASK and HTILE calculations for Hawaii</li>
<li>gallium/util: add a helper for calculating primitive count from vertex count</li>
<li>radeonsi: fix a hang with instancing on Hawaii</li>
<li>radeonsi: fix a hang with streamout on Hawaii</li>
<li>winsys/radeon: fix vram_size overflow with Hawaii</li>
<li>radeonsi: fix occlusion queries on Hawaii</li>
<li>r600g,radeonsi: switch all occurences of array_size to util_max_layer</li>
<li>radeonsi: fix build because of lack of draw_indirect infrastructure in 10.2</li>
<li>radeonsi: use DRAW_PREAMBLE on CIK</li>
</ul>
<p>Matt Turner (8):</p>
<ul>
<li>i965/vec4: Don't return void from a void function.</li>
<li>i965/vec4: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Don't fix_math_operand() on Gen &gt;= 8.</li>
<li>i965/fs: Make try_constant_propagate() static.</li>
<li>i965/fs: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/vec4: Constant propagate into 2-src math instructions on Gen8.</li>
<li>i965/fs: Don't use brw_imm_* unnecessarily.</li>
<li>i965/fs: Set correct number of regs_written for MCS fetches.</li>
</ul>
<p>Thorsten Glaser (1):</p>
<ul>
<li>nv50: fix build failure on m68k due to invalid struct alignment assumptions</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>clover: Call end_query before getting timestamp result v2</li>
</ul>
</div>
</body>
</html>

118
docs/relnotes/10.2.6.html Normal file
View File

@@ -0,0 +1,118 @@
<!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.2.6 Release Notes / August 19, 2014</h1>
<p>
Mesa 10.2.6 is a bug fix release which fixes bugs found since the 10.2.5 release.
</p>
<p>
Mesa 10.2.6 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>SHA256 checksums</h2>
<pre>
193314d2adba98e43697d726739ac46b4299aae324fa1821aa226890c28ac806 MesaLib-10.2.6.tar.bz2
f7a45a5977b485eb95ac024205c584a0c112fe3951c2313c797579bb16a7a448 MesaLib-10.2.6.tar.gz
6d086d6fcda8f317adfaaae40011decf2f2e2dc80819c4a7a77c76f73512e8d8 MesaLib-10.2.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=81450">Bug 81450</a> - [BDW]Piglit spec_glsl-1.30_execution_tex-miplevel-selection_textureGrad_1DArray cases intel_do_flush_locked failed</li>
</ul>
<h2>Changes</h2>
<p>Anuj Phogat (15):</p>
<ul>
<li>mesa: Fix error condition for valid texture targets in glTexStorage* functions</li>
<li>mesa: Turn target_can_be_compressed() in to a utility function</li>
<li>mesa: Add error condition for using compressed internalformat in glTexStorage3D()</li>
<li>mesa: Fix condition for using compressed internalformat in glCompressedTexImage3D()</li>
<li>mesa: Add utility function _mesa_is_enum_format_snorm()</li>
<li>mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3</li>
<li>mesa: Add a helper function _mesa_is_enum_format_unsized()</li>
<li>mesa: Add a gles3 error condition for sized internalformat in glCopyTexImage*()</li>
<li>mesa: Add gles3 error condition for GL_RGBA10_A2 buffer format in glCopyTexImage*()</li>
<li>mesa: Add utility function _mesa_is_enum_format_unorm()</li>
<li>mesa: Add gles3 condition for normalized internal formats in glCopyTexImage*()</li>
<li>mesa: Allow GL_TEXTURE_CUBE_MAP target with compressed internal formats</li>
<li>meta: Use _mesa_get_format_bits() to get the GL_RED_BITS</li>
<li>egl: Fix OpenGL ES version checks in _eglParseContextAttribList()</li>
<li>meta: Fix datatype computation in get_temp_image_type()</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix assertion in _mesa_drawbuffers()</li>
</ul>
<p>Carl Worth (2):</p>
<ul>
<li>docs: Add sha256 sums to the 10.2.5 release notes</li>
<li>Update VERSION to 10.2.6</li>
</ul>
<p>Ilia Mirkin (1):</p>
<ul>
<li>mesa/st: only convert AND(a, NOT(b)) into MAD when not using native integers</li>
</ul>
<p>Jordan Justen (1):</p>
<ul>
<li>i965/miptree: Layout 1D Array as 2D Array with height of 1</li>
</ul>
<p>Maarten Lankhorst (1):</p>
<ul>
<li>configure.ac: Do not require llvm on x32</li>
</ul>
<p>Marek Olšák (4):</p>
<ul>
<li>st/mesa: fix blit-based partial TexSubImage for 1D arrays</li>
<li>radeon,r200: fix buffer validation after CS flush</li>
<li>radeonsi: fix a hang with instancing in Unigine Heaven/Valley on Hawaii</li>
<li>radeonsi: fix CMASK and HTILE allocation on Tahiti</li>
</ul>
<p>Pali Rohár (1):</p>
<ul>
<li>configure: check for dladdr via AC_CHECK_FUNC/AC_CHECK_LIB</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix up out-of-bounds level when using conformant out-of-bound behavior</li>
</ul>
</div>
</body>
</html>

97
docs/relnotes/10.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 10.2 Release Notes / June 6, 2014</h1>
<p>
Mesa 10.2 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.2.1.
</p>
<p>
Mesa 10.2 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>
c87bfb6dd5cbcf1fdef42e5ccd972581 MesaLib-10.2.0.tar.gz
7aaba90bd7169a94ae2fe83febdec963 MesaLib-10.2.0.tar.bz2
58b203aca15dadc25ab4d1126db1052b MesaLib-10.2.0.zip
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ARB_buffer_storage on i965, nv30, nv50, nvc0, r300, r600, and radeonsi</li>
<li>GL_ARB_multi_bind on all drivers</li>
<li>GL_ARB_sample_shading on nv50 (GT21x only), nvc0</li>
<li>GL_ARB_separate_shader_objects (desktop OpenGL) and
GL_EXT_separate_shader_objects (OpenGL ES 2.0 and 3.0) on all drivers</li>
<li>GL_ARB_stencil_texturing on i965/gen8+</li>
<li>GL_ARB_texture_cube_map_array on nv50 (GT21x only)</li>
<li>GL_ARB_texture_gather on nv50 (GT21x only), nvc0</li>
<li>GL_ARB_texture_query_lod on nv50 (GT21x only), nvc0</li>
<li>GL_ARB_texture_view on i965/gen7</li>
<li>GL_ARB_vertex_type_10f_11f_11f_rev on nv50, nvc0, radeonsi</li>
<li>GL_ARB_viewport_array on nv50, r600</li>
<li>GL_INTEL_performance_query on i965/gen5+</li>
</ul>
<h2>Bug fixes</h2>
TBD.
<h2>Changes</h2>
<ul>
<li>Renamed <i>--with-llvm-shared-libs</i> to <i>--enable-llvm-shared-libs</i></li>
<p>
The option is used to control how mesa is linked against LLVM, and now
defaults to enabled (shared linking).
</p>
<li>Split <i>libxatracker.so</i> into a standalone library which can be used
with any gallium driver.</li>
<p>
Previously the library was linked statically against vmware's virtual gpu
driver(svga), whereas now it loads a shared pipe_*.so driver. Provide the
following options during configure, if you would like support for svga driver
<i>--enable-xa --with-gallium-drivers=svga</i>
</p>
<p>
Note: The files are installed in $(libdir)/gallium-pipe/ and the interface
between them and libxatracker.so is <strong>not</strong> stable.
</p>
<li>The environment variable GALLIUM_MSAA that forced a multisample GLX visual was removed.</li>
</ul>
</div>
</body>
</html>

158
docs/relnotes/10.3.1.html Normal file
View File

@@ -0,0 +1,158 @@
<!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.3.1 Release Notes / October 12, 2014</h1>
<p>
Mesa 10.3.1 is a bug fix release which fixes bugs found since the 10.3 release.
</p>
<p>
Mesa 10.3.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 are not supported.
</p>
<h2>SHA256 checksums</h2>
<pre>
155afcbad17be8bb80282c761b957d5cc716c14a1fa16c4f5ee04e76df729c6d MesaLib-10.3.1.tar.gz
b081d077d717e5d56f2d59677490856052c41573e50378ff86d6c72456714add MesaLib-10.3.1.tar.bz2
07a14febfed06412d519e091a62d24513fee6745f1a6f8a8f1956bfe04b77d15 MesaLib-10.3.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=79462">Bug 79462</a> - [NVC0/Codegen] Shader compilation falis in spill logic</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82932">Bug 82932</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_direct_read_vertex fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83506">Bug 83506</a> - [UBO] row_major layout ignored inside structures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83533">Bug 83533</a> - [UBO] nested structures don't get appropriate padding</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83570">Bug 83570</a> - Glyphy demo throws unhandled Integer division by zero exception</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83741">Bug 83741</a> - [UBO] row_major layout partially ignored for arrays of structures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84178">Bug 84178</a> - Big glamor regression in Xorg server 1.6.99.1 GIT: x11perf 1.5 Test: PutImage XY 500x500 Square</li>
</ul>
<h2>Changes</h2>
<p>Andreas Pokorny (2):</p>
<ul>
<li>egl/drm: expose KHR_image_pixmap extension</li>
<li>i915: Fix black buffers when importing prime fds</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix prog_optimize.c assertions triggered by SWZ opcode</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add 10.3 sha256 sums, news item and link release notes</li>
<li>Update VERSION to 10.3.1</li>
</ul>
<p>Ian Romanick (4):</p>
<ul>
<li>glsl: Make sure fields after small structs have correct padding</li>
<li>glsl: Make sure row-major array-of-structure get correct layout</li>
<li>glsl: Round struct size up to at least 16 bytes</li>
<li>glsl: Strip arrayness from ir_type_dereference_variable too</li>
</ul>
<p>Ilia Mirkin (5):</p>
<ul>
<li>nv50/ir: avoid deleting pseudo instructions too early</li>
<li>gm107/ir: fix manual TXD for array targets</li>
<li>gm107/ir: fix texture argument order</li>
<li>gm107/ir: add support for indirect const buffer selection</li>
<li>gm107/ir: take relative pfetch offset into account</li>
</ul>
<p>Keith Packard (1):</p>
<ul>
<li>glx/dri3: Provide error diagnostics when DRI3 allocation fails</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>mesa: Use proper structure for glGet*(GL_TEXTURE_COORD_ARRAY*).</li>
<li>mesa: Set correct array element in vbo_exec_vtx_init.</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>radeonsi: release GS rings at context destruction</li>
<li>radeonsi: properly destroy the GS copy shader and scratch_bo for compute</li>
<li>st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers</li>
</ul>
<p>Richard Sandiford (2):</p>
<ul>
<li>mesa: Fix alpha component in unpack_R8G8B8X8_SRGB.</li>
<li>swrast: Fix handling of MESA_FORMAT_L8A8_SRGB for big-endian</li>
</ul>
<p>Roland Scheidegger (1):</p>
<ul>
<li>gallivm: fix idiv</li>
</ul>
<p>Thomas Hellstrom (1):</p>
<ul>
<li>st/xa: Fix regression in xa_yuv_planar_blit()</li>
</ul>
<p>Tom Stellard (2):</p>
<ul>
<li>clover: Add support to mem objects for multiple destructor callbacks v2</li>
<li>configure.ac: Compute LLVM_VERSION_PATCH using llvm-config</li>
</ul>
<p>Tomasz Figa (3):</p>
<ul>
<li>util: Include in Android builds</li>
<li>st/mesa: Generate format_info.c in Android builds</li>
<li>st/mesa: Fix paths used in Android builds</li>
</ul>
<p>rconde (1):</p>
<ul>
<li>gallivm,tgsi: fix idiv by zero crash</li>
</ul>
</div>
</body>
</html>

115
docs/relnotes/10.3.2.html Normal file
View File

@@ -0,0 +1,115 @@
<!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.3.2 Release Notes / October 24, 2014</h1>
<p>
Mesa 10.3.2 is a bug fix release which fixes bugs found since the 10.3 release.
</p>
<p>
Mesa 10.3.2 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>SHA256 checksums</h2>
<pre>
e65f8e691f06f111c1aeb3a376b13c9cc88cb162bee2709e0e7e6b0e6628ca75 MesaLib-10.3.2.tar.gz
e9849bcb9aa9acd98a753d6d46d2e7d7238d3367036e11357a60efd16de8bea3 MesaLib-10.3.2.tar.bz2
427dc0d670d38e713ebff2675665ec2fe4ff7d04ce227bd54de946999fc1d234 MesaLib-10.3.2.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=54372">Bug 54372</a> - GLX_INTEL_swap_event crashes driver when swapping window buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81680">Bug 81680</a> - [r600g] Firefox crashes with hardware acceleration turned on</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84140">Bug 84140</a> - mplayer crashes playing some files using vdpau output</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84662">Bug 84662</a> - Long pauses with Unreal demo Elemental on R9270X since : Always flush the HDP cache before submitting a CS to the GPU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85267">Bug 85267</a> - vlc crashes with vdpau (Radeon 3850HD) [r600]</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (3):</p>
<ul>
<li>mesa: fix spurious wglGetProcAddress / GL_INVALID_OPERATION error</li>
<li>st/wgl: add WINAPI qualifiers on wgl function typedefs</li>
<li>glsl: fix several use-after-free bugs</li>
</ul>
<p>Daniel Manjarres (1):</p>
<ul>
<li>glx: Fix glxUseXFont for glxWindow and glxPixmaps</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>mesa: fix GetTexImage for 1D array depth textures</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.1 release</li>
<li>Update VERSION to 10.3.2</li>
</ul>
<p>Ilia Mirkin (4):</p>
<ul>
<li>gm107/ir: add dnz emission for fmul</li>
<li>gk110/ir: add dnz flag emission for fmul/fmad</li>
<li>nouveau: 3d textures are unsupported, limit 3d levels to 1</li>
<li>st/gbm: fix order of arguments passed to is_format_supported</li>
</ul>
<p>Kenneth Graunke (3):</p>
<ul>
<li>i965: Add a BRW_MOCS_PTE #define.</li>
<li>i965: Use BDW_MOCS_PTE for renderbuffers.</li>
<li>i965: Fix register write checks.</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>st/mesa: use pipe_sampler_view_release for releasing sampler views</li>
<li>glsl_to_tgsi: fix the value of gl_FrontFacing with native integers</li>
</ul>
<p>Michel Dänzer (4):</p>
<ul>
<li>radeonsi: Clear sampler view flags when binding a buffer</li>
<li>r600g,radeonsi: Always use GTT again for PIPE_USAGE_STREAM buffers</li>
<li>winsys/radeon: Use separate caching buffer manager for each set of flags</li>
<li>r600g: Drop references to destroyed blend state</li>
</ul>
</div>
</body>
</html>

209
docs/relnotes/10.3.3.html Normal file
View File

@@ -0,0 +1,209 @@
<!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.3.3 Release Notes / November 8, 2014</h1>
<p>
Mesa 10.3.3 is a bug fix release which fixes bugs found since the 10.3.2 release.
</p>
<p>
Mesa 10.3.3 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>SHA256 checksums</h2>
<pre>
23a0c36d88cd5d8968ae6454160de2878192fd1d37b5d606adca1f1b7e788b79 MesaLib-10.3.3.tar.gz
0e4eee4a2ddf86456eed2fc44da367f95471f74249636710491e85cc256c4753 MesaLib-10.3.3.tar.bz2
a83648f17d776b7cf6c813fbb15782d2644b937dc6a7c53d8c0d1b35411f4840 MesaLib-10.3.3.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=70410">Bug 70410</a> - egl-static/Makefile: linking fails with llvm &gt;= 3.4</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82921">Bug 82921</a> - layout(location=0) emits error &gt;= MAX_UNIFORM_LOCATIONS due to integer underflow</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83574">Bug 83574</a> - [llvmpipe] [softpipe] piglit arb_explicit_uniform_location-use-of-unused-loc regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85454">Bug 85454</a> - Unigine Sanctuary with Wine crashes on Mesa Git</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85918">Bug 85918</a> - Mesa: MSVC 2010/2012 Compile error</li>
</ul>
<h2>Changes</h2>
<p>Anuj Phogat (2):</p>
<ul>
<li>glsl: Fix crash due to negative array index</li>
<li>glsl: Use signed array index in update_max_array_access()</li>
</ul>
<p>Brian Paul (1):</p>
<ul>
<li>mesa: fix UNCLAMPED_FLOAT_TO_UBYTE() macro for MSVC</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.2 release</li>
<li>Update version to 10.3.3</li>
</ul>
<p>Ilia Mirkin (27):</p>
<ul>
<li>freedreno/ir3: fix FSLT/etc handling to return 0/-1 instead of 0/1.0</li>
<li>freedreno/ir3: INEG operates on src0, not src1</li>
<li>freedreno/ir3: add UARL support</li>
<li>freedreno/ir3: negate result of USLT/etc</li>
<li>freedreno/ir3: use unsigned comparison for UIF</li>
<li>freedreno/ir3: add TXL support</li>
<li>freedreno/ir3: fix UCMP handling</li>
<li>freedreno/ir3: implement UMUL correctly</li>
<li>freedreno: add default .dir-locals.el for emacs settings</li>
<li>freedreno/ir3: make texture instruction construction more dynamic</li>
<li>freedreno/ir3: fix TXB/TXL to actually pull the bias/lod argument</li>
<li>freedreno/ir3: add TXQ support</li>
<li>freedreno/ir3: add TXB2 support</li>
<li>freedreno: dual-source render targets are not supported</li>
<li>freedreno: instanced drawing/compute not yet supported</li>
<li>freedreno/ir3: avoid fan-in sources referring to same instruction</li>
<li>freedreno/ir3: add IDIV/UDIV support</li>
<li>freedreno/ir3: add UMOD support, based on UDIV</li>
<li>freedreno/ir3: add MOD support</li>
<li>freedreno/ir3: add ISSG support</li>
<li>freedreno/ir3: add UMAD support</li>
<li>freedreno/ir3: make TXQ return integers, not floats</li>
<li>freedreno/ir3: shadow comes before array</li>
<li>freedreno/ir3: add texture offset support</li>
<li>freedreno/ir3: add TXD support and expose ARB_shader_texture_lod</li>
<li>freedreno/ir3: add TXF support</li>
<li>freedreno: positions come out as integers, not half-integers</li>
</ul>
<p>Jan Vesely (1):</p>
<ul>
<li>configure: include llvm systemlibs when using static llvm</li>
</ul>
<p>Marek Olšák (5):</p>
<ul>
<li>r600g: fix polygon mode for points and lines and point/line fill modes</li>
<li>radeonsi: fix polygon mode for points and lines and point/line fill modes</li>
<li>radeonsi: fix incorrect index buffer max size for lowered 8-bit indices</li>
<li>Revert "st/mesa: set MaxUnrollIterations = 255"</li>
<li>r300g: remove enabled/disabled hyperz and AA compression messages</li>
</ul>
<p>Mauro Rossi (1):</p>
<ul>
<li>gallium/nouveau: fully build the driver under android</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeon/llvm: Dynamically allocate branch/loop stack arrays</li>
</ul>
<p>Rob Clark (62):</p>
<ul>
<li>freedreno/ir3: detect scheduler fail</li>
<li>freedreno/ir3: add TXB</li>
<li>freedreno/ir3: add DDX/DDY</li>
<li>freedreno/ir3: bit of debug</li>
<li>freedreno/ir3: fix error in bail logic</li>
<li>freedreno/ir3: fix constlen with relative addressing</li>
<li>freedreno/ir3: add no-copy-propagate fallback step</li>
<li>freedreno: don't overflow cmdstream buffer so much</li>
<li>freedreno/ir3: fix potential segfault in RA</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: enable hw primitive-restart</li>
<li>freedreno/a3xx: handle rendering to layer != 0</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: format fixes</li>
<li>util/u_format: add _is_alpha()</li>
<li>freedreno/a3xx: alpha render-target shenanigans</li>
<li>freedreno/ir3: catch incorrect usage of tmp-dst</li>
<li>freedreno/ir3: add missing put_dst</li>
<li>freedreno: "fix" problems with excessive flushes</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: 3d/array textures</li>
<li>freedreno: add DRM_CONF_SHARE_FD</li>
<li>freedreno/a3xx: more texture array fixes</li>
<li>freedreno/a3xx: initial texture border-color</li>
<li>freedreno: fix compiler warning</li>
<li>freedreno: don't advertise mirror-clamp support</li>
<li>freedreno: update generated headers</li>
<li>freedreno: we have more than 0 viewports!</li>
<li>freedreno: turn missing caps into compile warnings</li>
<li>freedreno/a3xx: add LOD_BIAS</li>
<li>freedreno/a3xx: add flat interpolation mode</li>
<li>freedreno/a3xx: add 32bit integer vtx formats</li>
<li>freedreno/a3xx: fix border color order</li>
<li>freedreno: move bind_sampler_states to per-generation</li>
<li>freedreno: add texcoord clamp support to lowering</li>
<li>freedreno/a3xx: add support to emulate GL_CLAMP</li>
<li>freedreno/a3xx: re-emit shaders on variant change</li>
<li>freedreno/lowering: fix token calculation for lowering</li>
<li>freedreno: destroy transfer pool after blitter</li>
<li>freedreno: max-texture-lod-bias should be 15.0f</li>
<li>freedreno: update generated headers</li>
<li>freedreno/a3xx: handle large shader program sizes</li>
<li>freedreno/a3xx: emit all immediates in one shot</li>
<li>freedreno/ir3: fix lockups with lame FRAG shaders</li>
<li>freedreno/a3xx: handle VS only outputting BCOLOR</li>
<li>freedreno: query fixes</li>
<li>freedreno/a3xx: refactor vertex state emit</li>
<li>freedreno/a3xx: refactor/optimize emit</li>
<li>freedreno/ir3: optimize shader key comparision</li>
<li>freedreno: inline fd_draw_emit()</li>
<li>freedreno: fix layer_stride</li>
<li>freedreno: update generated headers</li>
<li>freedreno/ir3: large const support</li>
<li>freedreno/a3xx: more layer/level fixes</li>
<li>freedreno/ir3: comment + better fxn name</li>
<li>freedreno/ir3: fix potential gpu lockup with kill</li>
<li>freedreno/a3xx: disable early-z when we have kill's</li>
<li>freedreno/ir3: add debug flag to disable cp</li>
<li>freedreno: clear vs scissor</li>
<li>freedreno: mark scissor state dirty when enable bit changes</li>
<li>freedreno/a3xx: fix viewport state during clear</li>
<li>freedreno/a3xx: fix depth/stencil restore format</li>
</ul>
<p>Tapani Pälli (2):</p>
<ul>
<li>glsl: fix uniform location count used for glsl types</li>
<li>mesa: check that uniform exists in glUniform* functions</li>
</ul>
</div>
</body>
</html>

106
docs/relnotes/10.3.4.html Normal file
View File

@@ -0,0 +1,106 @@
<!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.3.4 Release Notes / November 21, 2014</h1>
<p>
Mesa 10.3.4 is a bug fix release which fixes bugs found since the 10.3.3 release.
</p>
<p>
Mesa 10.3.4 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>SHA256 checksums</h2>
<pre>
26482495ef6177f889dbd87c7edcccfedd995598785bbbd7e3e066352574c8e0 MesaLib-10.3.4.tar.gz
e6373913142338d10515daf619d659433bfd2989988198930c13b0945a15e98a MesaLib-10.3.4.tar.bz2
8c3ebbb6535daf3414305860ebca6ac67dbb6e3d35058c7a6ce18b84b5945b7f MesaLib-10.3.4.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=76252">Bug 76252</a> - Dynamic loading/unloading of opengl32.dll results in a deadlock</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78770">Bug 78770</a> - [SNB bisected]Webglc conformance/textures/texture-size-limit.html fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83500">Bug 83500</a> - si_dma_copy_tile causes GPU hangs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=85647">Bug 85647</a> - Random radeonsi crashes with mesa 10.3.x</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (1):</p>
<ul>
<li>st/mesa: copy sampler_array_size field when copying instructions</li>
</ul>
<p>Chad Versace (1):</p>
<ul>
<li>i965: Fix segfault in WebGL Conformance on Ivybridge</li>
</ul>
<p>Dave Airlie (5):</p>
<ul>
<li>r600g/cayman: fix integer multiplication output overwrite (v2)</li>
<li>r600g/cayman: fix texture gather tests</li>
<li>r600g/cayman: handle empty vertex shaders</li>
<li>r600g: geom shaders: always load texture src regs from inputs</li>
<li>r600g: limit texture offset application to specific types (v2)</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.3 release</li>
<li>configure.ac: roll up a program for the sse4.1 check</li>
<li>get-pick-list.sh: Require explicit "10.3" for nominating stable patches</li>
</ul>
<p>Ilia Mirkin (1):</p>
<ul>
<li>st/mesa: add a fallback for clear_with_quad when no vs_layer</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>llvmpipe: Avoid deadlock when unloading opengl32.dll</li>
</ul>
<p>Kenneth Graunke (1):</p>
<ul>
<li>i915g: we also have more than 0 viewports!</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Disable asynchronous DMA except for PIPE_BUFFER</li>
</ul>
</div>
</body>
</html>

88
docs/relnotes/10.3.5.html Normal file
View File

@@ -0,0 +1,88 @@
<!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.3.5 Release Notes / December 5, 2014</h1>
<p>
Mesa 10.3.5 is a bug fix release which fixes bugs found since the 10.3.4 release.
</p>
<p>
Mesa 10.3.5 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>SHA256 checksums</h2>
<pre>
7ea71c3cce89114df3dc050376afa1c6f6bf235d77a68f9703273603d6a90621 MesaLib-10.3.5.tar.gz
eb75d2790f1606d59d50a6acaa637b6c75f2155b3e0eca3d5099165c0d9556ae MesaLib-10.3.5.tar.bz2
164bc64ba63fb07ff255ff8de6ed3c95ff545dfe8f864c44c33abe94788da910 MesaLib-10.3.5.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=86618">Bug 86618</a> - [NV96] neg modifiers not working in MIN and MAX operations</li>
</ul>
<h2>Changes</h2>
<p>Brian Paul (2):</p>
<ul>
<li>mesa: fix arithmetic error in _mesa_compute_compressed_pixelstore()</li>
<li>mesa: fix height error check for 1D array textures</li>
</ul>
<p>Chris Forbes (2):</p>
<ul>
<li>i965: Handle nested uniform array indexing</li>
<li>mesa: Fix Get(GL_TRANSPOSE_CURRENT_MATRIX_ARB) to transpose</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.5 release</li>
<li>Update version to 10.3.5</li>
</ul>
<p>Ilia Mirkin (6):</p>
<ul>
<li>nv50/ir: set neg modifiers on min/max args</li>
<li>nv50,nvc0: actually check constbufs for invalidation</li>
<li>nv50,nvc0: buffer resources can be bound as other things down the line</li>
<li>freedreno/ir3: don't pass consts to madsh.m16 in MOD logic</li>
<li>freedreno/a3xx: only enable blend clamp for non-float formats</li>
<li>freedreno/ir3: fix UMAD</li>
</ul>
<p>Rob Clark (1):</p>
<ul>
<li>configure.ac: bump libdrm_freedreno requirement</li>
</ul>
</div>
</body>
</html>

124
docs/relnotes/10.3.6.html Normal file
View File

@@ -0,0 +1,124 @@
<!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.3.6 Release Notes / December 29, 2014</h1>
<p>
Mesa 10.3.6 is a bug fix release which fixes bugs found since the 10.3.5 release.
</p>
<p>
Mesa 10.3.6 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>SHA256 checksums</h2>
<pre>
c4d053d6bc6604cb5c93c99e0ef2e815c539f26dc5a03737eb3809bc1767d12f MesaLib-10.3.6.tar.gz
8d43673c6788fbf85f9c36c3a95c61ccf46f8835fc9c0d85d34474490d80572b MesaLib-10.3.6.tar.bz2
6b5b1e9a13949cfdb76fe51e8dcc3ea71e464a5ca73d11fdc29c20c4ba3f411a MesaLib-10.3.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=60879">Bug 60879</a> - [radeonsi] X11 can't start with acceleration enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82585">Bug 82585</a> - geometry shader with optional out variable segfaults</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82991">Bug 82991</a> - Inverted bumpmap in webgl applications</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84777">Bug 84777</a> - [BSW]Piglit spec_glsl-1.50_execution_geometry-basic fails</li>
</ul>
<h2>Changes</h2>
<p>Andres Gomez (1):</p>
<ul>
<li>i965/brw_reg: struct constructor now needs explicit negate and abs values.</li>
</ul>
<p>Ben Widawsky (1):</p>
<ul>
<li>i965/gs: Avoid DW * DW mul</li>
</ul>
<p>Dave Airlie (1):</p>
<ul>
<li>r600g: only init GS_VERT_ITEMSIZE on r600</li>
</ul>
<p>Emil Velikov (3):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.5 release</li>
<li>Revert "glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)"</li>
<li>Update version to 10.3.6</li>
</ul>
<p>Ian Romanick (2):</p>
<ul>
<li>linker: Wrap access of producer_var with a NULL check</li>
<li>linker: Assign varying locations geometry shader inputs for SSO</li>
</ul>
<p>Ilia Mirkin (3):</p>
<ul>
<li>util/primconvert: pass index bias through</li>
<li>util/primconvert: support instanced rendering</li>
<li>util/primconvert: take ib offset into account</li>
</ul>
<p>José Fonseca (1):</p>
<ul>
<li>util/primconvert: Avoid point arithmetic; apply offset on all cases.</li>
</ul>
<p>Marek Olšák (1):</p>
<ul>
<li>docs/relnotes: document the removal of GALLIUM_MSAA</li>
</ul>
<p>Mario Kleiner (4):</p>
<ul>
<li>glx/dri3: Fix glXWaitForSbcOML() to handle targetSBC==0 correctly. (v2)</li>
<li>glx/dri3: Track separate (ust, msc) for PresentPixmap vs. PresentNotifyMsc (v2)</li>
<li>glx/dri3: Request non-vsynced Present for swapinterval zero. (v3)</li>
<li>glx/dri3: Don't fail on glXSwapBuffersMscOML(dpy, window, 0, 0, 0) (v2)</li>
</ul>
<p>Maxence Le Doré (1):</p>
<ul>
<li>glsl: Add gl_MaxViewports to available builtin constants</li>
</ul>
<p>Tom Stellard (1):</p>
<ul>
<li>radeonsi: Program RASTER_CONFIG for harvested GPUs v5</li>
</ul>
</div>
</body>
</html>

93
docs/relnotes/10.3.7.html Normal file
View File

@@ -0,0 +1,93 @@
<!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.3.7 Release Notes / January 12, 2015</h1>
<p>
Mesa 10.3.7 is a bug fix release which fixes bugs found since the 10.3.6 release.
</p>
<p>
Mesa 10.3.7 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>SHA256 checksums</h2>
<pre>
bc13f33c19bc9f44a0565fdd51a8f9d1c0153a3365c429ceaf4ef43b7022b052 MesaLib-10.3.7.tar.gz
43c6ced15e237cbb21b3082d7c0b42777c50c1f731d0d4b5efb5231063fb6a5b MesaLib-10.3.7.tar.bz2
d821fd46baf804fecfcf403e901800a4b996c7dd1c83f20a354b46566a49026f MesaLib-10.3.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=85529">Bug 85529</a> - Surfaces not drawn in Unvanquished</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87619">Bug 87619</a> - Changes to state such as render targets change fragment shader without marking it dirty.</li>
</ul>
<h2>Changes</h2>
<p>Chad Versace (2):</p>
<ul>
<li>i965: Use safer pointer arithmetic in intel_texsubimage_tiled_memcpy()</li>
<li>i965: Use safer pointer arithmetic in gather_oa_results()</li>
</ul>
<p>Emil Velikov (2):</p>
<ul>
<li>docs: Add sha256 sums for the 10.3.6 release</li>
<li>Update version to 10.3.7</li>
</ul>
<p>Ilia Mirkin (2):</p>
<ul>
<li>nv50,nvc0: set vertex id base to index_bias</li>
<li>nv50/ir: fix texture offsets in release builds</li>
</ul>
<p>Kenneth Graunke (2):</p>
<ul>
<li>i965: Add missing BRW_NEW_*_PROG_DATA to texture/renderbuffer atoms.</li>
<li>i965: Fix start/base_vertex_location for &gt;1 prims but !BRW_NEW_VERTICES.</li>
</ul>
<p>Marek Olšák (3):</p>
<ul>
<li>glsl_to_tgsi: fix a bug in copy propagation</li>
<li>vbo: ignore primitive restart if FixedIndex is enabled in DrawArrays</li>
<li>st/mesa: fix GL_PRIMITIVE_RESTART_FIXED_INDEX</li>
</ul>
<p>Michel Dänzer (1):</p>
<ul>
<li>radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0</li>
</ul>
</div>
</body>
</html>

335
docs/relnotes/10.3.html Normal file
View File

@@ -0,0 +1,335 @@
<!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.3 Release Notes / September 19, 2014</h1>
<p>
Mesa 10.3 is a new development release.
People who are concerned with stability and reliability should stick
with a previous release or wait for Mesa 10.3.1.
</p>
<p>
Mesa 10.3 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>SHA256 checksums</h2>
<pre>
9a1bf52040fc3dda81e83a35f944f1c3f532847dbe9fdf57161265cf71ea1bae MesaLib-10.3.0.tar.gz
0283bfe710fa449ed82e465cfa09612a269e19abb7e0382082608062ce7960b5 MesaLib-10.3.0.tar.bz2
221420763c2c3a244836a736e735612c4a6a0377b4e5223fca1e612f49906789 MesaLib-10.3.0.zip
</pre>
<h2>New features</h2>
<p>
Note: some of the new features are only available with certain drivers.
</p>
<ul>
<li>GL_ARB_ES3_compatibility on nv50, nvc0, r600, radeonsi, softpipe, llvmpipe</li>
<li>GL_ARB_clear_texture on i965</li>
<li>GL_ARB_compressed_texture_pixel_storage on all drivers</li>
<li>GL_ARB_conditional_render_inverted on i965, nvc0, softpipe, llvmpipe</li>
<li>GL_ARB_derivative_control on i965, nv50, nvc0, r600</li>
<li>GL_ARB_draw_indirect on nvc0, radeonsi</li>
<li>GL_ARB_explicit_uniform_location (all drivers that support GLSL)</li>
<li>GL_ARB_fragment_layer_viewport on nv50, nvc0, llvmpipe, r600</li>
<li>GL_ARB_gpu_shader5 on i965/gen7, nvc0</li>
<li>GL_ARB_multi_draw_indirect on nvc0, radeonsi</li>
<li>GL_ARB_sample_shading on radeonsi</li>
<li>GL_ARB_seamless_cubemap_per_texture on i965, llvmpipe, nvc0, r600, radeonsi, softpipe</li>
<li>GL_ARB_stencil_texturing on nv50, nvc0, r600, and radeonsi</li>
<li>GL_ARB_texture_barrier on nv50, nvc0, r300, r600, radeonsi</li>
<li>GL_ARB_texture_compression_bptc on i965/gen7+, nvc0, r600/evergreen+, radeonsi</li>
<li>GL_ARB_texture_cube_map_array on radeonsi</li>
<li>GL_ARB_texture_gather on r600, radeonsi</li>
<li>GL_ARB_texture_query_levels on nv50, nvc0, llvmpipe, r600, radeonsi, softpipe</li>
<li>GL_ARB_texture_query_lod on r600, radeonsi</li>
<li>GL_ARB_viewport_array on nvc0</li>
<li>GL_AMD_vertex_shader_viewport_index on i965/gen7+, r600</li>
<li>GL_OES_compressed_ETC1_RGB8_texture on nv30, nv50, nvc0, r300, r600, radeonsi, softpipe, llvmpipe</li>
<li>GLX_MESA_query_renderer on nv30, nv50, nvc0, r300, r600, radeonsi, softpipe, llvmpipe</li>
<li>A new software rasterizer driver (kms_swrast_dri.so) that works with
DRM drivers that don't have a full-fledged GEM (such as qxl or simpledrm)</li>
<li>Distribute the Khronos GL/glcorearb.h header file.</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50754">Bug 50754</a> - Building 32 bit mesa on 64 bit OS fails since change for automake</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=53617">Bug 53617</a> - [llvmpipe] piglit fbo-depthtex regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=54372">Bug 54372</a> - GLX_INTEL_swap_event crashes driver when swapping window buffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=56127">Bug 56127</a> - [ILK bisected]unigine-sanctruary performance reduced by 98%</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66184">Bug 66184</a> - src/mesa/state_tracker/st_glsl_to_tgsi.cpp:3216:simplify_cmp: Assertion `inst-&gt;dst.index &lt; 4096' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66452">Bug 66452</a> - JUNIPER UVD accelerated playback of WMV3 streams does not work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=68365">Bug 68365</a> - [SNB Bisected]Piglit spec_ARB_framebuffer_object_fbo-blit-stretch fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70441">Bug 70441</a> - [Gen4-5 clip] Piglit spec_OpenGL_1.1_polygon-offset hits (execsize &gt;= width) assertion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73846">Bug 73846</a> - [llvmpipe] lp_test_format fails with llvm-3.5svn &gt;= r199602</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74005">Bug 74005</a> - [i965 Bisected]Piglit/glx_glx-make-glxdrawable-current fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=74863">Bug 74863</a> - [r600g] HyperZ broken on RV770 and CYPRESS (Left 4 Dead 2 trees corruption) bisected!</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75010">Bug 75010</a> - clang: error: unknown argument: '-fstack-protector-strong'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75478">Bug 75478</a> - [BDW]Some Piglit and Ogles2conform cases cause GPU hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75664">Bug 75664</a> - Unigine Valley &amp; Heaven &quot;error: syntax error, unexpected EXTENSION, expecting $end&quot; IVB HD4000</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=75878">Bug 75878</a> - [BDW] GPU hang running Raytracer WebGL demo</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76188">Bug 76188</a> - EGL_EXT_image_dma_buf_import fd ownership is incorrect</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76223">Bug 76223</a> - [radeonsi] luxmark segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76939">Bug 76939</a> - [BDW] GPU hang when running “Metro:Last Light “ /“Crusader Kings II”</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77245">Bug 77245</a> - Bogus GL_ARB_explicit_attrib_location layout identifier warnings</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77493">Bug 77493</a> - lp_test_arit fails with llvm &gt;= llvm-3.5svn r206094</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77703">Bug 77703</a> - [ILK Bisected]Piglit glean_texCombine4 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77704">Bug 77704</a> - [IVB/HSW Bisected]Ogles3conform GL3Tests_shadow_shadow_execution_frag.test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77705">Bug 77705</a> - [SNB/IVB/HSW/BYT/BDW Bisected]Ogles3conform GL3Tests/packed_pixels/packed_pixels_pixelstore.test segfault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77707">Bug 77707</a> - [ILK Bisected]Ogles2conform GL_sin_sin_float_frag_xvary.test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77740">Bug 77740</a> - i965: Relax accumulator dependency scheduling on Gen &lt; 6</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77852">Bug 77852</a> - [BDW]Piglit spec_ARB_framebuffer_object_fbo-drawbuffers-none_glBlitFramebuffer fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77856">Bug 77856</a> - [BDW]Piglit spec_OpenGL_3.0_clearbuffer-mixed-format fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=77865">Bug 77865</a> - [BDW] Many Ogles3conform framebuffer_blit cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78225">Bug 78225</a> - Compile error due to undefined reference to `gbm_dri_backend', fix attached</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78258">Bug 78258</a> - make check link_varyings.gl_ClipDistance failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78403">Bug 78403</a> - query_renderer_implementation_unittest.cpp:144:4: error: expected primary-expression before . token</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78468">Bug 78468</a> - Compiling of shader gets stuck in infinite loop</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78537">Bug 78537</a> - no anisotropic filtering in a native Half-Life 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78546">Bug 78546</a> - [swrast] piglit copyteximage-border regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78581">Bug 78581</a> - OpenCL: clBuildProgram prints error messages directly rather than storing them</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78648">Bug 78648</a> - Texture artifacts in Kerbal Space Program</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78665">Bug 78665</a> - macros in builtin_functions.cpp make invalid assumptions about M_PI definitions</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78679">Bug 78679</a> - Gen4-5 code lost: runtime_check_aads_emit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78691">Bug 78691</a> - [G45 - Tesseract] Mesa 10.1.2 implementation error: Unsupported opcode 169872468 in FS</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78692">Bug 78692</a> - Football Manager 2014, gameplay rendered black &amp; white</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78716">Bug 78716</a> - Fix Mesa bugs for running Unreal Engine 4.1 Cave effects demo compiled for Linux</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78803">Bug 78803</a> - gallivm/lp_bld_debug.cpp:42:28: fatal error: llvm/IR/Module.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78842">Bug 78842</a> - [swrast] piglit fcc-read-after-clear copy rb regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78843">Bug 78843</a> - [swrast] piglit copyteximage 1D regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78872">Bug 78872</a> - [ILK Bisected]Piglit spec_ARB_depth_buffer_float_fbo-depthstencil-GL_DEPTH32F_STENCIL8-blit Aborted</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78875">Bug 78875</a> - [ILK Bisected]Webglc conformance/uniforms/uniform-default-values.html fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=78888">Bug 78888</a> - test_eu_compact.c:54:3: error: implicit declaration of function brw_disasm [-Werror=implicit-function-declaration]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79029">Bug 79029</a> - INTEL_DEBUG=shader_time is full of lies</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79095">Bug 79095</a> - x86/common_x86.c:348:14: error: use of undeclared identifier 'bit_SSE4_1'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79115">Bug 79115</a> - glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0) doesn't unbind stencil buffer</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79263">Bug 79263</a> - Linking error in egl_gallium.la when compiling 32 bit on multiarch</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79294">Bug 79294</a> - Xlib-based build broken on non x86/x86-64 architectures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79373">Bug 79373</a> - Non-const initializers for matrix and vector constructors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79382">Bug 79382</a> - build error: multiple definition of `loader_get_pci_id_for_fd'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79421">Bug 79421</a> - [llvmpipe] SIGSEGV src/gallium/drivers/llvmpipe/lp_rast_priv.h:218</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79440">Bug 79440</a> - prog_hash_table.c:146: undefined reference to `_mesa_error_no_memory'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79469">Bug 79469</a> - Commit e3cc0d90e14e62a0a787b6c07a6df0f5c84039be breaks unigine heaven</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79534">Bug 79534</a> - gen&lt;7 renders garbage</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79616">Bug 79616</a> - L4D2 crash on startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79724">Bug 79724</a> - switch statement type check</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79729">Bug 79729</a> - [i965] glClear on a multisample texture doesn't work</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79809">Bug 79809</a> - radeonsi: mouse cursor corruption using weston on AMD Kaveri</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79823">Bug 79823</a> - [NV30/gallium] Mozilla apps freeze on startup with nouveau-dri-10.2.1 libs on dual-screen</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79885">Bug 79885</a> - commit b52a530 (gallium/egl: st_profiles are build time decision, treat them as such) broke egl</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79903">Bug 79903</a> - [HSW Bisected]Some Piglit and Ogles2conform cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79907">Bug 79907</a> - Mesa 10.2.1 --enable-vdpau default=auto broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79948">Bug 79948</a> - [i965] Incorrect pixels when using discard and uniform loads</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80015">Bug 80015</a> - Transparency glitches in native Civilization 5 (Civ5) port</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80115">Bug 80115</a> - MESA_META_DRAW_BUFFERS induced GL_INVALID_VALUE errors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80211">Bug 80211</a> - [ILK/SNB Bisected]Piglit shaders_glsl-fs-copy-propagation-texcoords-1 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80247">Bug 80247</a> - Khronos conformance test ES3-CTS.gtf.GL3Tests.transform_feedback.transform_feedback_vertex_id fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80254">Bug 80254</a> - pipe_loader_sw.c:90: undefined reference to `dri_create_sw_winsys'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80541">Bug 80541</a> - [softpipe] piglit levelclamp regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80561">Bug 80561</a> - Incorrect implementation of some VDPAU APIs.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80614">Bug 80614</a> - [regression] Error in `omxregister-bellagio': munmap_chunk(): invalid pointer: 0x00007f5f76626dab</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80778">Bug 80778</a> - [bisected regression] piglit spec/glsl-1.50/compiler/incorrect-in-layout-qualifier-repeated-prim.geom</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80827">Bug 80827</a> - [radeonsi,R9 270X] Corruptions in window menus in KDE</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80880">Bug 80880</a> - Unreal Engine 4 demos fail GLSL compiler assertion</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=80991">Bug 80991</a> - [BDW]Piglit spec_ARB_sample_shading_builtin-gl-sample-mask_2 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81020">Bug 81020</a> - [radeonsi][regresssion] Wireframe of background rendered through objects in Half-Life 2: Episode 2 with MSAA enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81150">Bug 81150</a> - [SNB]Piglit spec_arb_shading_language_packing_execution_built-in-functions_fs-packSnorm4x8 fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81157">Bug 81157</a> - [BDW]Piglit some spec_glsl-1.50_execution_built-in-functions* cases fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81450">Bug 81450</a> - [BDW]Piglit spec_glsl-1.30_execution_tex-miplevel-selection_textureGrad_1DArray cases intel_do_flush_locked failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81828">Bug 81828</a> - [BDW Bisected]Ogles3conform GL3Tests_packed_pixels_packed_pixels_pbo.test fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81834">Bug 81834</a> - TGSI constant buffer overrun causes assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81857">Bug 81857</a> - [SNB+]Piglit spec_glsl-1.30_execution_switch_fs-default_last sporadically fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81967">Bug 81967</a> - [regression] Selections in Blender renders wrong</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82139">Bug 82139</a> - [r600g, bisected] multiple ubo piglit regressions</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82159">Bug 82159</a> - No rule to make target `../../../../src/mesa/libmesa.la', needed by `collision'.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82255">Bug 82255</a> - [VP2] Chroma planes are vertically stretched during VDPAU playback</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82268">Bug 82268</a> - Add support for the OpenRISC architecture (or1k)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82428">Bug 82428</a> - [radeonsi,R9 270X] System lockup when using mplayer/mpv with VDPAU</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82472">Bug 82472</a> - piglit 16385-consecutive-chars regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82483">Bug 82483</a> - format_srgb.h:145: undefined reference to `util_format_srgb_to_linear_8unorm_table'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82517">Bug 82517</a> - [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82534">Bug 82534</a> - src\egl\main\eglapi.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2E02</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82536">Bug 82536</a> - u_current.h:72: undefined reference to `__imp__glapi_Dispatch'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82538">Bug 82538</a> - Super Maryo Chronicles fails with st/mesa assertion failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82539">Bug 82539</a> - vmw_screen_dri.lo In file included from vmw_screen_dri.c:41: vmwgfx_drm.h:32:17: error: drm.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82546">Bug 82546</a> - [regression] libOSMesa build failure</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82574">Bug 82574</a> - GLSL: opt_vectorize goes wrong on texture lookups</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82628">Bug 82628</a> - bisected: GALLIUM_HUD hangs radeon 7970M (PRIME)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82671">Bug 82671</a> - [r600g-evergreen][compute]Empty kernel execution causes crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82709">Bug 82709</a> - OpenCL not working on radeon hainan</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82796">Bug 82796</a> - [IVB/BYT-M/HSW/BDW Bisected]Synmark2_v6.0_OglTerrainFlyInst/OglTerrainPanInst cannot run as image validation failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82804">Bug 82804</a> - unreal engine 4 rendering errors</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82814">Bug 82814</a> - glDrawBuffers(0, NULL) segfaults in _mesa_drawbuffers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82828">Bug 82828</a> - Regression: Crash in 3Dmark2001</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82846">Bug 82846</a> - [BDW Bisected] Gpu hang when running Lightsmark v2008/Warsow v1.0/Xonotic v0.7/unigine-demos</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82881">Bug 82881</a> - test_vec4_register_coalesce regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82882">Bug 82882</a> - [swrast] piglit glsl-fs-uniform-bool-1 regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82929">Bug 82929</a> - [BDW Bisected]glxgears causes X hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82932">Bug 82932</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.indexing.vector_subscript.vec3_static_loop_subscript_write_direct_read_vertex fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83046">Bug 83046</a> - [BDW bisected]] Warsow v1.0/Xonotic v0.7/Gputest v0.5_triangle_fullscreen/synmark2_v6/GLBenchmark v2.5.0/GLBenchmark v2.7.0/Ungine-demos performance reduced 30%~60%</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83079">Bug 83079</a> - [NVC0] Dota 2 (Linux native and Wine) crash with Nouveau Drivers</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83081">Bug 83081</a> - [BDW Bisected]Piglit spec_ARB_sample_shading_builtin-gl-sample-mask_2 is core dumped</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83127">Bug 83127</a> - [ILK Bisected]Piglit glean_texCombine fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83355">Bug 83355</a> - FTBFS: src/mesa/program/program_lexer.l:122:64: error: unknown type name 'YYSTYPE'</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83432">Bug 83432</a> - r600_query.c:269:r600_emit_query_end: Assertion `ctx-&gt;num_pipelinestat_queries &gt; 0' failed [Gallium HUD]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83468">Bug 83468</a> - [UBO] Using bool from UBO as if-statement condition asserts</li>
</ul>
<h2>Changes</h2>
<ul>
<li>Removed support for the GL_ATI_envmap_bumpmap extension</li>
<li>The hacky --enable-32/64-bit is no longer available in configure. To build
32/64 bit mesa refer to the default method recommended by your distribution</li>
</li>The environment variable GALLIUM_MSAA that forced a multisample GLX visual was removed.</li>
</ul>
</div>
</body>
</html>

View File

@@ -0,0 +1,125 @@
Name
MESA_configless_context
Name Strings
EGL_MESA_configless_context
Contact
Neil Roberts <neil.s.roberts@intel.com>
Status
Proposal
Version
Version 1, February 28, 2014
Number
EGL Extension #not assigned
Dependencies
Requires EGL 1.4 or later. This extension is written against the
wording of the EGL 1.4 specification.
Overview
This extension provides a means to use a single context to render to
multiple surfaces which have different EGLConfigs. Without this extension
the EGLConfig for every surface used by the context must be compatible
with the one used by the context. The only way to render to surfaces with
different formats would be to create multiple contexts but this is
inefficient with modern GPUs where this restriction is unnecessary.
IP Status
Open-source; freely implementable.
New Procedures and Functions
None.
New Tokens
Accepted as <config> in eglCreateContext
EGL_NO_CONFIG_MESA ((EGLConfig)0)
Additions to the EGL Specification section "2.2 Rendering Contexts and Drawing
Surfaces"
Add the following to the 3rd paragraph:
"EGLContexts can also optionally be created with respect to an EGLConfig
depending on the parameters used at creation time. If a config is provided
then additional restrictions apply on what surfaces can be used with the
context."
Replace the last sentence of the 6th paragraph with:
"In order for a context to be compatible with a surface they both must have
been created with respect to the same EGLDisplay. If the context was
created without respect to an EGLConfig then there are no further
constraints. Otherwise they are only compatible if:"
Remove the last bullet point in the list of constraints.
Additions to the EGL Specification section "3.7.1 Creating Rendering Contexts"
Replace the paragraph starting "If config is not a valid EGLConfig..."
with
"The config argument can either be a valid EGLConfig or EGL_NO_CONFIG_MESA.
If it is neither of these then an EGL_BAD_CONFIG error is generated. If a
valid config is passed then the error will also be generated if the config
does not support the requested client API (this includes requesting
creation of an OpenGL ES 1.x context when the EGL_RENDERABLE_TYPE
attribute of config does not contain EGL_OPENGL_ES_BIT, or creation of an
OpenGL ES 2.x context when the attribute does not contain
EGL_OPENGL_ES2_BIT).
Passing EGL_NO_CONFIG_MESA will create a configless context. When a
configless context is used with the OpenGL API it can be assumed that the
initial values of the context's state will be decided when the context is
first made current. In particular this means that the decision of whether
to use GL_BACK or GL_FRONT for the initial value of the first output in
glDrawBuffers will be decided based on the config of the draw surface when
it is first bound."
Additions to the EGL Specification section "3.7.3 Binding Contexts and
Drawables"
Replace the first bullet point with the following:
"* If draw or read are not compatible with ctx as described in section 2.2,
then an EGL_BAD_MATCH error is generated."
Add a second bullet point after that:
"* If draw and read are not compatible with each other as described in
section 2.2, then an EGL_BAD_MATCH error is generated."
Issues
1. What happens when an OpenGL context with a double-buffered surface and
draw buffer set to GL_BACK is made current with a single-buffered
surface?
NOT RESOLVED: There are a few options here. An implementation can
raise an error, change the drawbuffer state to GL_FRONT or just do
nothing, expecting the application to set GL_FRONT drawbuffer before
drawing. However, this extension deliberately does not specify any
required behavior in this corner case and applications should avoid
mixing single- and double-buffered surfaces with configless contexts.
Future extensions may specify required behavior in this case.
Revision History
Version 1, February 28, 2014
Initial draft (Neil Roberts)

View File

@@ -16,11 +16,11 @@ IP Status
Status
Incomplete. DO NOT SHIP.
Shipping as of Mesa 10.0
Version
Version 6, 7-November-2013
Version 8, 14-February-2014
Number
@@ -211,7 +211,7 @@ Additions to the GLX 1.4 Specification
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.
GLX_RENDERER_ID_MESA is 0.
[Add to list of errors for glXCreateContextAttribsARB in section section
@@ -373,7 +373,7 @@ Issues
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.
0x5143, but GLX_RENDERER_DEVICE_ID_MESA will return 0xFFFFFFFF.
Revision History
@@ -403,3 +403,8 @@ Revision History
Version 7, 2013/11/07 - Fix a couple more typos. Add issue #17 regarding
the PCI queries on systems that don't have PCI.
Version 8, 2014/02/14 - Fix a couple typos. GLX_RENDER_ID_MESA should
read GLX_RENDERER_ID_MESA. The VENDOR/DEVICE_ID
example given in issue #17 should be 0x5143 and
0xFFFFFFFF respectively.

View File

@@ -73,7 +73,6 @@ FILE_PATTERNS = \
fog.h \
get.h \
glheader.h \
glthread.h \
hash.[ch] \
hint.h \
histogram.h \

View File

@@ -34,7 +34,7 @@ SEARCH_INCLUDES = YES
INCLUDE_PATH = ../include/
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED = _glthread_DECLARE_STATIC_MUTEX
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008 - 2012 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
@@ -21,8 +21,6 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
/* $Revision: 11985 $ on $Date: 2010-07-15 11:16:06 -0700 (Thu, 15 Jul 2010) $ */
#ifndef __OPENCL_CL_H
#define __OPENCL_CL_H
@@ -58,8 +56,10 @@ typedef cl_uint cl_device_mem_cache_type;
typedef cl_uint cl_device_local_mem_type;
typedef cl_bitfield cl_device_exec_capabilities;
typedef cl_bitfield cl_command_queue_properties;
typedef intptr_t cl_device_partition_property;
typedef cl_bitfield cl_device_affinity_domain;
typedef intptr_t cl_context_properties;
typedef intptr_t cl_context_properties;
typedef cl_uint cl_context_info;
typedef cl_uint cl_command_queue_info;
typedef cl_uint cl_channel_order;
@@ -67,6 +67,7 @@ typedef cl_uint cl_channel_type;
typedef cl_bitfield cl_mem_flags;
typedef cl_uint cl_mem_object_type;
typedef cl_uint cl_mem_info;
typedef cl_bitfield cl_mem_migration_flags;
typedef cl_uint cl_image_info;
typedef cl_uint cl_buffer_create_type;
typedef cl_uint cl_addressing_mode;
@@ -75,24 +76,43 @@ typedef cl_uint cl_sampler_info;
typedef cl_bitfield cl_map_flags;
typedef cl_uint cl_program_info;
typedef cl_uint cl_program_build_info;
typedef cl_uint cl_program_binary_type;
typedef cl_int cl_build_status;
typedef cl_uint cl_kernel_info;
typedef cl_uint cl_kernel_arg_info;
typedef cl_uint cl_kernel_arg_address_qualifier;
typedef cl_uint cl_kernel_arg_access_qualifier;
typedef cl_bitfield cl_kernel_arg_type_qualifier;
typedef cl_uint cl_kernel_work_group_info;
typedef cl_uint cl_event_info;
typedef cl_uint cl_command_type;
typedef cl_uint cl_profiling_info;
typedef struct _cl_image_format {
cl_channel_order image_channel_order;
cl_channel_type image_channel_data_type;
} cl_image_format;
typedef struct _cl_image_desc {
cl_mem_object_type image_type;
size_t image_width;
size_t image_height;
size_t image_depth;
size_t image_array_size;
size_t image_row_pitch;
size_t image_slice_pitch;
cl_uint num_mip_levels;
cl_uint num_samples;
cl_mem buffer;
} cl_image_desc;
typedef struct _cl_buffer_region {
size_t origin;
size_t size;
} cl_buffer_region;
/******************************************************************************/
/* Error Codes */
@@ -111,6 +131,11 @@ typedef struct _cl_buffer_region {
#define CL_MAP_FAILURE -12
#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13
#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14
#define CL_COMPILE_PROGRAM_FAILURE -15
#define CL_LINKER_NOT_AVAILABLE -16
#define CL_LINK_PROGRAM_FAILURE -17
#define CL_DEVICE_PARTITION_FAILED -18
#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19
#define CL_INVALID_VALUE -30
#define CL_INVALID_DEVICE_TYPE -31
@@ -147,14 +172,21 @@ typedef struct _cl_buffer_region {
#define CL_INVALID_MIP_LEVEL -62
#define CL_INVALID_GLOBAL_WORK_SIZE -63
#define CL_INVALID_PROPERTY -64
#define CL_INVALID_IMAGE_DESCRIPTOR -65
#define CL_INVALID_COMPILER_OPTIONS -66
#define CL_INVALID_LINKER_OPTIONS -67
#define CL_INVALID_DEVICE_PARTITION_COUNT -68
/* OpenCL Version */
#define CL_VERSION_1_0 1
#define CL_VERSION_1_1 1
#define CL_VERSION_1_2 1
/* cl_bool */
#define CL_FALSE 0
#define CL_TRUE 1
#define CL_BLOCKING CL_TRUE
#define CL_NON_BLOCKING CL_FALSE
/* cl_platform_info */
#define CL_PLATFORM_PROFILE 0x0900
@@ -168,6 +200,7 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_TYPE_CPU (1 << 1)
#define CL_DEVICE_TYPE_GPU (1 << 2)
#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3)
#define CL_DEVICE_TYPE_CUSTOM (1 << 4)
#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF
/* cl_device_info */
@@ -221,7 +254,7 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_VERSION 0x102F
#define CL_DEVICE_EXTENSIONS 0x1030
#define CL_DEVICE_PLATFORM 0x1031
/* 0x1032 reserved for CL_DEVICE_DOUBLE_FP_CONFIG */
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG */
#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034
#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035
@@ -233,6 +266,20 @@ typedef struct _cl_buffer_region {
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B
#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C
#define CL_DEVICE_OPENCL_C_VERSION 0x103D
#define CL_DEVICE_LINKER_AVAILABLE 0x103E
#define CL_DEVICE_BUILT_IN_KERNELS 0x103F
#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040
#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041
#define CL_DEVICE_PARENT_DEVICE 0x1042
#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043
#define CL_DEVICE_PARTITION_PROPERTIES 0x1044
#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045
#define CL_DEVICE_PARTITION_TYPE 0x1046
#define CL_DEVICE_REFERENCE_COUNT 0x1047
#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048
#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049
#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A
#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B
/* cl_device_fp_config - bitfield */
#define CL_FP_DENORM (1 << 0)
@@ -242,6 +289,7 @@ typedef struct _cl_buffer_region {
#define CL_FP_ROUND_TO_INF (1 << 4)
#define CL_FP_FMA (1 << 5)
#define CL_FP_SOFT_FLOAT (1 << 6)
#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7)
/* cl_device_mem_cache_type */
#define CL_NONE 0x0
@@ -266,8 +314,23 @@ typedef struct _cl_buffer_region {
#define CL_CONTEXT_PROPERTIES 0x1082
#define CL_CONTEXT_NUM_DEVICES 0x1083
/* cl_context_info + cl_context_properties */
/* cl_context_properties */
#define CL_CONTEXT_PLATFORM 0x1084
#define CL_CONTEXT_INTEROP_USER_SYNC 0x1085
/* cl_device_partition_property */
#define CL_DEVICE_PARTITION_EQUALLY 0x1086
#define CL_DEVICE_PARTITION_BY_COUNTS 0x1087
#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0
#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088
/* cl_device_affinity_domain */
#define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0)
#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1)
#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2)
#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3)
#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4)
#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5)
/* cl_command_queue_info */
#define CL_QUEUE_CONTEXT 0x1090
@@ -282,6 +345,14 @@ typedef struct _cl_buffer_region {
#define CL_MEM_USE_HOST_PTR (1 << 3)
#define CL_MEM_ALLOC_HOST_PTR (1 << 4)
#define CL_MEM_COPY_HOST_PTR (1 << 5)
/* reserved (1 << 6) */
#define CL_MEM_HOST_WRITE_ONLY (1 << 7)
#define CL_MEM_HOST_READ_ONLY (1 << 8)
#define CL_MEM_HOST_NO_ACCESS (1 << 9)
/* cl_mem_migration_flags - bitfield */
#define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0)
#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1)
/* cl_channel_order */
#define CL_R 0x10B0
@@ -297,6 +368,8 @@ typedef struct _cl_buffer_region {
#define CL_Rx 0x10BA
#define CL_RGx 0x10BB
#define CL_RGBx 0x10BC
#define CL_DEPTH 0x10BD
#define CL_DEPTH_STENCIL 0x10BE
/* cl_channel_type */
#define CL_SNORM_INT8 0x10D0
@@ -314,11 +387,16 @@ typedef struct _cl_buffer_region {
#define CL_UNSIGNED_INT32 0x10DC
#define CL_HALF_FLOAT 0x10DD
#define CL_FLOAT 0x10DE
#define CL_UNORM_INT24 0x10DF
/* cl_mem_object_type */
#define CL_MEM_OBJECT_BUFFER 0x10F0
#define CL_MEM_OBJECT_IMAGE2D 0x10F1
#define CL_MEM_OBJECT_IMAGE3D 0x10F2
#define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3
#define CL_MEM_OBJECT_IMAGE1D 0x10F4
#define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5
#define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6
/* cl_mem_info */
#define CL_MEM_TYPE 0x1100
@@ -339,6 +417,10 @@ typedef struct _cl_buffer_region {
#define CL_IMAGE_WIDTH 0x1114
#define CL_IMAGE_HEIGHT 0x1115
#define CL_IMAGE_DEPTH 0x1116
#define CL_IMAGE_ARRAY_SIZE 0x1117
#define CL_IMAGE_BUFFER 0x1118
#define CL_IMAGE_NUM_MIP_LEVELS 0x1119
#define CL_IMAGE_NUM_SAMPLES 0x111A
/* cl_addressing_mode */
#define CL_ADDRESS_NONE 0x1130
@@ -361,6 +443,7 @@ typedef struct _cl_buffer_region {
/* cl_map_flags - bitfield */
#define CL_MAP_READ (1 << 0)
#define CL_MAP_WRITE (1 << 1)
#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2)
/* cl_program_info */
#define CL_PROGRAM_REFERENCE_COUNT 0x1160
@@ -370,11 +453,20 @@ typedef struct _cl_buffer_region {
#define CL_PROGRAM_SOURCE 0x1164
#define CL_PROGRAM_BINARY_SIZES 0x1165
#define CL_PROGRAM_BINARIES 0x1166
#define CL_PROGRAM_NUM_KERNELS 0x1167
#define CL_PROGRAM_KERNEL_NAMES 0x1168
/* cl_program_build_info */
#define CL_PROGRAM_BUILD_STATUS 0x1181
#define CL_PROGRAM_BUILD_OPTIONS 0x1182
#define CL_PROGRAM_BUILD_LOG 0x1183
#define CL_PROGRAM_BINARY_TYPE 0x1184
/* cl_program_binary_type */
#define CL_PROGRAM_BINARY_TYPE_NONE 0x0
#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1
#define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2
#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4
/* cl_build_status */
#define CL_BUILD_SUCCESS 0
@@ -388,6 +480,32 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_REFERENCE_COUNT 0x1192
#define CL_KERNEL_CONTEXT 0x1193
#define CL_KERNEL_PROGRAM 0x1194
#define CL_KERNEL_ATTRIBUTES 0x1195
/* cl_kernel_arg_info */
#define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196
#define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197
#define CL_KERNEL_ARG_TYPE_NAME 0x1198
#define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199
#define CL_KERNEL_ARG_NAME 0x119A
/* cl_kernel_arg_address_qualifier */
#define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B
#define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C
#define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D
#define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E
/* cl_kernel_arg_access_qualifier */
#define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0
#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1
#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2
#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3
/* cl_kernel_arg_type_qualifer */
#define CL_KERNEL_ARG_TYPE_NONE 0
#define CL_KERNEL_ARG_TYPE_CONST (1 << 0)
#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1)
#define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2)
/* cl_kernel_work_group_info */
#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0
@@ -395,6 +513,7 @@ typedef struct _cl_buffer_region {
#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2
#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3
#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4
#define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5
/* cl_event_info */
#define CL_EVENT_COMMAND_QUEUE 0x11D0
@@ -425,13 +544,17 @@ typedef struct _cl_buffer_region {
#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202
#define CL_COMMAND_COPY_BUFFER_RECT 0x1203
#define CL_COMMAND_USER 0x1204
#define CL_COMMAND_BARRIER 0x1205
#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206
#define CL_COMMAND_FILL_BUFFER 0x1207
#define CL_COMMAND_FILL_IMAGE 0x1208
/* command execution status */
#define CL_COMPLETE 0x0
#define CL_RUNNING 0x1
#define CL_SUBMITTED 0x2
#define CL_QUEUED 0x3
/* cl_buffer_create_type */
#define CL_BUFFER_CREATE_TYPE_REGION 0x1220
@@ -470,22 +593,35 @@ clGetDeviceInfo(cl_device_id /* device */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clCreateSubDevices(cl_device_id /* in_device */,
const cl_device_partition_property * /* properties */,
cl_uint /* num_devices */,
cl_device_id * /* out_devices */,
cl_uint * /* num_devices_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseDevice(cl_device_id /* device */) CL_API_SUFFIX__VERSION_1_2;
/* Context APIs */
extern CL_API_ENTRY cl_context CL_API_CALL
clCreateContext(const cl_context_properties * /* properties */,
cl_uint /* num_devices */,
const cl_device_id * /* devices */,
cl_uint /* num_devices */,
const cl_device_id * /* devices */,
void (CL_CALLBACK * /* pfn_notify */)(const char *, const void *, size_t, void *),
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_context CL_API_CALL
clCreateContextFromType(const cl_context_properties * /* properties */,
cl_device_type /* device_type */,
cl_device_type /* device_type */,
void (CL_CALLBACK * /* pfn_notify*/ )(const char *, const void *, size_t, void *),
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
void * /* user_data */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainContext(cl_context /* context */) CL_API_SUFFIX__VERSION_1_0;
@@ -520,25 +656,6 @@ clGetCommandQueueInfo(cl_command_queue /* command_queue */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
/*
* WARNING:
* This API introduces mutable state into the OpenCL implementation. It has been REMOVED
* to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the
* OpenCL 1.1 conformance test, and consequently may not work or may not work dependably.
* It is likely to be non-performant. Use of this API is not advised. Use at your own risk.
*
* Software developers previously relying on this API are instructed to set the command queue
* properties when creating the queue, instead.
*/
extern CL_API_ENTRY cl_int CL_API_CALL
clSetCommandQueueProperty(cl_command_queue /* command_queue */,
cl_command_queue_properties /* properties */,
cl_bool /* enable */,
cl_command_queue_properties * /* old_properties */) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
/* Memory Object APIs */
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateBuffer(cl_context /* context */,
@@ -555,26 +672,12 @@ clCreateSubBuffer(cl_mem /* buffer */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateImage2D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_row_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateImage3D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_depth */,
size_t /* image_row_pitch */,
size_t /* image_slice_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
clCreateImage(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
const cl_image_desc * /* image_desc */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainMemObject(cl_mem /* memobj */) CL_API_SUFFIX__VERSION_1_0;
@@ -609,7 +712,7 @@ clSetMemObjectDestructorCallback( cl_mem /* memobj */,
void (CL_CALLBACK * /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
void * /*user_data */ ) CL_API_SUFFIX__VERSION_1_1;
/* Sampler APIs */
/* Sampler APIs */
extern CL_API_ENTRY cl_sampler CL_API_CALL
clCreateSampler(cl_context /* context */,
cl_bool /* normalized_coords */,
@@ -647,6 +750,13 @@ clCreateProgramWithBinary(cl_context /* context */,
cl_int * /* binary_status */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_program CL_API_CALL
clCreateProgramWithBuiltInKernels(cl_context /* context */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* kernel_names */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainProgram(cl_program /* program */) CL_API_SUFFIX__VERSION_1_0;
@@ -662,7 +772,30 @@ clBuildProgram(cl_program /* program */,
void * /* user_data */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0;
clCompileProgram(cl_program /* program */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* options */,
cl_uint /* num_input_headers */,
const cl_program * /* input_headers */,
const char ** /* header_include_names */,
void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_program CL_API_CALL
clLinkProgram(cl_context /* context */,
cl_uint /* num_devices */,
const cl_device_id * /* device_list */,
const char * /* options */,
cl_uint /* num_input_programs */,
const cl_program * /* input_programs */,
void (CL_CALLBACK * /* pfn_notify */)(cl_program /* program */, void * /* user_data */),
void * /* user_data */,
cl_int * /* errcode_ret */ ) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clUnloadPlatformCompiler(cl_platform_id /* platform */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetProgramInfo(cl_program /* program */,
@@ -710,6 +843,14 @@ clGetKernelInfo(cl_kernel /* kernel */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelArgInfo(cl_kernel /* kernel */,
cl_uint /* arg_indx */,
cl_kernel_arg_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
cl_device_id /* device */,
@@ -718,7 +859,7 @@ clGetKernelWorkGroupInfo(cl_kernel /* kernel */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
/* Event Object APIs */
/* Event Object APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clWaitForEvents(cl_uint /* num_events */,
const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
@@ -750,7 +891,7 @@ clSetEventCallback( cl_event /* event */,
void (CL_CALLBACK * /* pfn_notify */)(cl_event, cl_int, void *),
void * /* user_data */) CL_API_SUFFIX__VERSION_1_1;
/* Profiling APIs */
/* Profiling APIs */
extern CL_API_ENTRY cl_int CL_API_CALL
clGetEventProfilingInfo(cl_event /* event */,
cl_profiling_info /* param_name */,
@@ -771,7 +912,7 @@ clEnqueueReadBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_read */,
size_t /* offset */,
size_t /* cb */,
size_t /* size */,
void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
@@ -781,8 +922,8 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReadBufferRect(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_read */,
const size_t * /* buffer_origin */,
const size_t * /* host_origin */,
const size_t * /* buffer_offset */,
const size_t * /* host_offset */,
const size_t * /* region */,
size_t /* buffer_row_pitch */,
size_t /* buffer_slice_pitch */,
@@ -798,7 +939,7 @@ clEnqueueWriteBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_write */,
size_t /* offset */,
size_t /* cb */,
size_t /* size */,
const void * /* ptr */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
@@ -808,8 +949,8 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
cl_bool /* blocking_write */,
const size_t * /* buffer_origin */,
const size_t * /* host_origin */,
const size_t * /* buffer_offset */,
const size_t * /* host_offset */,
const size_t * /* region */,
size_t /* buffer_row_pitch */,
size_t /* buffer_slice_pitch */,
@@ -820,13 +961,24 @@ clEnqueueWriteBufferRect(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueFillBuffer(cl_command_queue /* command_queue */,
cl_mem /* buffer */,
const void * /* pattern */,
size_t /* pattern_size */,
size_t /* offset */,
size_t /* size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyBuffer(cl_command_queue /* command_queue */,
cl_mem /* src_buffer */,
cl_mem /* dst_buffer */,
size_t /* src_offset */,
size_t /* dst_offset */,
size_t /* cb */,
size_t /* size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
@@ -872,6 +1024,16 @@ clEnqueueWriteImage(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueFillImage(cl_command_queue /* command_queue */,
cl_mem /* image */,
const void * /* fill_color */,
const size_t * /* origin[3] */,
const size_t * /* region[3] */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueCopyImage(cl_command_queue /* command_queue */,
cl_mem /* src_image */,
@@ -911,7 +1073,7 @@ clEnqueueMapBuffer(cl_command_queue /* command_queue */,
cl_bool /* blocking_map */,
cl_map_flags /* map_flags */,
size_t /* offset */,
size_t /* cb */,
size_t /* size */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */,
@@ -939,6 +1101,15 @@ clEnqueueUnmapMemObject(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueMigrateMemObjects(cl_command_queue /* command_queue */,
cl_uint /* num_mem_objects */,
const cl_mem * /* mem_objects */,
cl_mem_migration_flags /* flags */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueNDRangeKernel(cl_command_queue /* command_queue */,
cl_kernel /* kernel */,
@@ -959,7 +1130,7 @@ clEnqueueTask(cl_command_queue /* command_queue */,
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueNativeKernel(cl_command_queue /* command_queue */,
void (*user_func)(void *),
void (CL_CALLBACK * /*user_func*/)(void *),
void * /* args */,
size_t /* cb_args */,
cl_uint /* num_mem_objects */,
@@ -970,16 +1141,17 @@ clEnqueueNativeKernel(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueMarker(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
clEnqueueMarkerWithWaitList(cl_command_queue /* command_queue */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
cl_uint /* num_events */,
const cl_event * /* event_list */) CL_API_SUFFIX__VERSION_1_0;
clEnqueueBarrierWithWaitList(cl_command_queue /* command_queue */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_0;
/* Extension function access
*
@@ -988,7 +1160,51 @@ clEnqueueBarrier(cl_command_queue /* command_queue */) CL_API_SUFFIX__VERSION_1_
* check to make sure the address is not NULL, before using or
* calling the returned function address.
*/
extern CL_API_ENTRY void * CL_API_CALL clGetExtensionFunctionAddress(const char * /* func_name */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY void * CL_API_CALL
clGetExtensionFunctionAddressForPlatform(cl_platform_id /* platform */,
const char * /* func_name */) CL_API_SUFFIX__VERSION_1_2;
/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage2D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_row_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateImage3D(cl_context /* context */,
cl_mem_flags /* flags */,
const cl_image_format * /* image_format */,
size_t /* image_width */,
size_t /* image_height */,
size_t /* image_depth */,
size_t /* image_row_pitch */,
size_t /* image_slice_pitch */,
void * /* host_ptr */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueMarker(cl_command_queue /* command_queue */,
cl_event * /* event */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueWaitForEvents(cl_command_queue /* command_queue */,
cl_uint /* num_events */,
const cl_event * /* event_list */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clEnqueueBarrier(cl_command_queue /* command_queue */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
clGetExtensionFunctionAddress(const char * /* func_name */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
#ifdef __cplusplus
}

126
include/CL/cl_d3d10.h Normal file
View File

@@ -0,0 +1,126 @@
/**********************************************************************************
* Copyright (c) 2008-2012 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
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_D3D10_H
#define __OPENCL_CL_D3D10_H
#include <d3d10.h>
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d10_sharing */
#define cl_khr_d3d10_sharing 1
typedef cl_uint cl_d3d10_device_source_khr;
typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_D3D10_DEVICE_KHR -1002
#define CL_INVALID_D3D10_RESOURCE_KHR -1003
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
/* cl_d3d10_device_source_nv */
#define CL_D3D10_DEVICE_KHR 0x4010
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
/* cl_d3d10_device_set_nv */
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
/* cl_context_info */
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
/* cl_mem_info */
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
/* cl_image_info */
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d10_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_D3D10_H */

126
include/CL/cl_d3d11.h Normal file
View File

@@ -0,0 +1,126 @@
/**********************************************************************************
* Copyright (c) 2008-2012 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
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_D3D11_H
#define __OPENCL_CL_D3D11_H
#include <d3d11.h>
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d11_sharing */
#define cl_khr_d3d11_sharing 1
typedef cl_uint cl_d3d11_device_source_khr;
typedef cl_uint cl_d3d11_device_set_khr;
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_D3D11_DEVICE_KHR -1006
#define CL_INVALID_D3D11_RESOURCE_KHR -1007
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
/* cl_d3d11_device_source */
#define CL_D3D11_DEVICE_KHR 0x4019
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
/* cl_d3d11_device_set */
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
/* cl_context_info */
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
/* cl_mem_info */
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E
/* cl_image_info */
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
cl_platform_id platform,
cl_d3d11_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d11_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_D3D11_H */

View File

@@ -0,0 +1,127 @@
/**********************************************************************************
* Copyright (c) 2008-2012 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
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H
#define __OPENCL_CL_DX9_MEDIA_SHARING_H
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
/* cl_khr_dx9_media_sharing */
#define cl_khr_dx9_media_sharing 1
typedef cl_uint cl_dx9_media_adapter_type_khr;
typedef cl_uint cl_dx9_media_adapter_set_khr;
#if defined(_WIN32)
#include <d3d9.h>
typedef struct _cl_dx9_surface_info_khr
{
IDirect3DSurface9 *resource;
HANDLE shared_handle;
} cl_dx9_surface_info_khr;
#endif
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010
#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011
#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012
#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013
/* cl_media_adapter_type_khr */
#define CL_ADAPTER_D3D9_KHR 0x2020
#define CL_ADAPTER_D3D9EX_KHR 0x2021
#define CL_ADAPTER_DXVA_KHR 0x2022
/* cl_media_adapter_set_khr */
#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023
#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024
/* cl_context_info */
#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025
#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026
#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027
/* cl_mem_info */
#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028
#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029
/* cl_image_info */
#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B
#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(
cl_platform_id platform,
cl_uint num_media_adapters,
cl_dx9_media_adapter_type_khr * media_adapter_type,
void * media_adapters,
cl_dx9_media_adapter_set_khr media_adapter_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_context context,
cl_mem_flags flags,
cl_dx9_media_adapter_type_khr adapter_type,
void * surface_info,
cl_uint plane,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */

133
include/CL/cl_egl.h Normal file
View File

@@ -0,0 +1,133 @@
/*******************************************************************************
* Copyright (c) 2008-2010 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
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
******************************************************************************/
#ifndef __OPENCL_CL_EGL_H
#define __OPENCL_CL_EGL_H
#ifdef __APPLE__
#else
#include <CL/cl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
/* Error type for clCreateFromEGLImageKHR */
#define CL_INVALID_EGL_OBJECT_KHR -1093
#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
/* CLeglImageKHR is an opaque handle to an EGLImage */
typedef void* CLeglImageKHR;
/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
typedef void* CLeglDisplayKHR;
/* CLeglSyncKHR is an opaque handle to an EGLSync object */
typedef void* CLeglSyncKHR;
/* properties passed to clCreateFromEGLImageKHR */
typedef intptr_t cl_egl_image_properties_khr;
#define cl_khr_egl_image 1
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromEGLImageKHR(cl_context /* context */,
CLeglDisplayKHR /* egldisplay */,
CLeglImageKHR /* eglimage */,
cl_mem_flags /* flags */,
const cl_egl_image_properties_khr * /* properties */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
cl_mem_flags flags,
const cl_egl_image_properties_khr * properties,
cl_int * errcode_ret);
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */,
cl_uint /* num_objects */,
const cl_mem * /* mem_objects */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event);
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */,
cl_uint /* num_objects */,
const cl_mem * /* mem_objects */,
cl_uint /* num_events_in_wait_list */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event);
#define cl_khr_egl_event 1
extern CL_API_ENTRY cl_event CL_API_CALL
clCreateEventFromEGLSyncKHR(cl_context /* context */,
CLeglSyncKHR /* sync */,
CLeglDisplayKHR /* display */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
cl_context context,
CLeglSyncKHR sync,
CLeglDisplayKHR display,
cl_int * errcode_ret);
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_EGL_H */

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-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
@@ -34,15 +34,12 @@ extern "C" {
#endif
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <OpenCL/cl.h>
#include <AvailabilityMacros.h>
#else
#include <CL/cl.h>
#include <CL/cl.h>
#endif
/* cl_khr_fp64 extension - no extension #define since it has no functions */
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032
/* cl_khr_fp16 extension - no extension #define since it has no functions */
#define CL_DEVICE_HALF_FP_CONFIG 0x1033
@@ -64,7 +61,7 @@ extern "C" {
* before using.
*/
#define cl_APPLE_SetMemObjectDestructor 1
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */,
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */,
void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
@@ -118,6 +115,52 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
cl_uint * /* num_platforms */);
/* Extension: cl_khr_image2D_buffer
*
* This extension allows a 2D image to be created from a cl_mem buffer without a copy.
* The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t.
* Both the sampler and sampler-less read_image built-in functions are supported for 2D images
* and 2D images created from a buffer. Similarly, the write_image built-ins are also supported
* for 2D images created from a buffer.
*
* When the 2D image from buffer is created, the client must specify the width,
* height, image format (i.e. channel order and channel data type) and optionally the row pitch
*
* The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels.
* The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels.
*/
/*************************************
* cl_khr_initalize_memory extension *
*************************************/
#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x200E
/**************************************
* cl_khr_terminate_context extension *
**************************************/
#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x200F
#define CL_CONTEXT_TERMINATE_KHR 0x2010
#define cl_khr_terminate_context 1
extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2;
/*
* Extension: cl_khr_spir
*
* This extension adds support to create an OpenCL program object from a
* Standard Portable Intermediate Representation (SPIR) instance
*/
#define CL_DEVICE_SPIR_VERSIONS 0x40E0
#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1
/******************************************
* cl_nv_device_attribute_query extension *
******************************************/
@@ -130,12 +173,16 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
/*********************************
* cl_amd_device_attribute_query *
*********************************/
#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
/*********************************
* cl_arm_printf extension
*********************************/
#define CL_PRINTF_CALLBACK_ARM 0x40B0
#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
#ifdef CL_VERSION_1_1
/***********************************
@@ -201,7 +248,63 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(
#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0)
#define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1)
/*********************************
* cl_qcom_ext_host_ptr extension
*********************************/
#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29)
#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0
#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1
#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2
#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3
#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4
#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5
#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6
#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7
typedef cl_uint cl_image_pitch_info_qcom;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceImageInfoQCOM(cl_device_id device,
size_t image_width,
size_t image_height,
const cl_image_format *image_format,
cl_image_pitch_info_qcom param_name,
size_t param_value_size,
void *param_value,
size_t *param_value_size_ret);
typedef struct _cl_mem_ext_host_ptr
{
/* Type of external memory allocation. */
/* Legal values will be defined in layered extensions. */
cl_uint allocation_type;
/* Host cache policy for this external memory allocation. */
cl_uint host_cache_policy;
} cl_mem_ext_host_ptr;
/*********************************
* cl_qcom_ion_host_ptr extension
*********************************/
#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8
typedef struct _cl_mem_ion_host_ptr
{
/* Type of external memory allocation. */
/* Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations. */
cl_mem_ext_host_ptr ext_host_ptr;
/* ION file descriptor */
int ion_filedesc;
/* Host pointer to the ION allocated memory */
void* ion_hostptr;
} cl_mem_ion_host_ptr;
#endif /* CL_VERSION_1_1 */

View File

@@ -1,5 +1,5 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008 - 2012 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
@@ -21,20 +21,11 @@
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
**********************************************************************************/
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
/*
* cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have
* OpenGL dependencies. The application is responsible for #including
* OpenGL or OpenGL ES headers before #including cl_gl.h.
*/
#ifndef __OPENCL_CL_GL_H
#define __OPENCL_CL_GL_H
#ifdef __APPLE__
#include <OpenCL/cl.h>
#include <OpenGL/CGLDevice.h>
#else
#include <CL/cl.h>
#endif
@@ -48,15 +39,21 @@ typedef cl_uint cl_gl_texture_info;
typedef cl_uint cl_gl_platform_info;
typedef struct __GLsync *cl_GLsync;
/* cl_gl_object_type */
#define CL_GL_OBJECT_BUFFER 0x2000
#define CL_GL_OBJECT_TEXTURE2D 0x2001
#define CL_GL_OBJECT_TEXTURE3D 0x2002
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */
#define CL_GL_OBJECT_BUFFER 0x2000
#define CL_GL_OBJECT_TEXTURE2D 0x2001
#define CL_GL_OBJECT_TEXTURE3D 0x2002
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
#define CL_GL_OBJECT_TEXTURE1D 0x200F
#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_GL_MIPMAP_LEVEL 0x2005
#define CL_GL_NUM_SAMPLES 0x2012
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_GL_MIPMAP_LEVEL 0x2005
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLBuffer(cl_context /* context */,
@@ -65,21 +62,13 @@ clCreateFromGLBuffer(cl_context /* context */,
int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture3D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
clCreateFromGLTexture(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLRenderbuffer(cl_context /* context */,
cl_mem_flags /* flags */,
@@ -89,7 +78,7 @@ clCreateFromGLRenderbuffer(cl_context /* context */,
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLObjectInfo(cl_mem /* memobj */,
cl_gl_object_type * /* gl_object_type */,
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLTextureInfo(cl_mem /* memobj */,
@@ -114,33 +103,51 @@ clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
const cl_event * /* event_wait_list */,
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture3D(cl_context /* context */,
cl_mem_flags /* flags */,
cl_GLenum /* target */,
cl_GLint /* miplevel */,
cl_GLuint /* texture */,
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
/* cl_khr_gl_sharing extension */
#define cl_khr_gl_sharing 1
typedef cl_uint cl_gl_context_info;
/* Additional Error Codes */
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
/* cl_gl_context_info */
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
/* Additional cl_context_properties */
#define CL_GL_CONTEXT_KHR 0x2008
#define CL_EGL_DISPLAY_KHR 0x2009
#define CL_GLX_DISPLAY_KHR 0x200A
#define CL_WGL_HDC_KHR 0x200B
#define CL_CGL_SHAREGROUP_KHR 0x200C
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
cl_gl_context_info /* param_name */,
size_t /* param_value_size */,
void * /* param_value */,
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
const cl_context_properties * properties,
cl_gl_context_info param_name,
@@ -152,4 +159,4 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
}
#endif
#endif /* __OPENCL_CL_GL_H */
#endif /* __OPENCL_CL_GL_H */

View File

@@ -1,5 +1,5 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2012 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
@@ -41,7 +41,7 @@ extern "C" {
/*
* For each extension, follow this template
* /* cl_VEN_extname extension */
* cl_VEN_extname extension */
/* #define cl_VEN_extname 1
* ... define new types, if any
* ... define new tokens, if any

View File

@@ -1,5 +1,5 @@
/**********************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2012 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
@@ -46,19 +46,75 @@ extern "C" {
#endif
#ifdef __APPLE__
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_API_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXTENSION_WEAK_LINK __attribute__((weak_import))
#define CL_API_SUFFIX__VERSION_1_0 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_0 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
#define CL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define GCL_API_SUFFIX__VERSION_1_1 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_1 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_8
#else
#warning This path should never happen outside of internal operating system development. AvailabilityMacros do not function correctly here!
#define CL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define GCL_API_SUFFIX__VERSION_1_2 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_2 CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED CL_EXTENSION_WEAK_LINK AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#endif
#else
#define CL_EXTENSION_WEAK_LINK
#define CL_EXTENSION_WEAK_LINK
#define CL_API_SUFFIX__VERSION_1_0
#define CL_EXT_SUFFIX__VERSION_1_0
#define CL_API_SUFFIX__VERSION_1_1
#define CL_EXT_SUFFIX__VERSION_1_1
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_API_SUFFIX__VERSION_1_2
#define CL_EXT_SUFFIX__VERSION_1_2
#ifdef __GNUC__
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#endif
#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED __attribute__((deprecated))
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
#elif _WIN32
#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated)
#endif
#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#else
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated)
#endif
#else
#define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED
#define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED
#define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
#endif
#endif
#if (defined (_WIN32) && defined(_MSC_VER))
@@ -252,7 +308,7 @@ typedef double cl_double __attribute__((aligned(8)));
#include <stddef.h>
/* Mirror types to GL types. Mirror types allow us to avoid deciding which headers to load based on whether we are using GL or GLES here. */
/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */
typedef unsigned int cl_GLuint;
typedef int cl_GLint;
typedef unsigned int cl_GLenum;
@@ -395,6 +451,24 @@ typedef unsigned int cl_GLenum;
#define __CL_DOUBLE4__ 1
#endif
/* Define capabilities for anonymous struct members. */
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
#define __CL_HAS_ANON_STRUCT__ 1
#define __CL_ANON_STRUCT__ __extension__
#elif defined( _WIN32) && (_MSC_VER >= 1500)
/* Microsoft Developer Studio 2008 supports anonymous structs, but
* complains by default. */
#define __CL_HAS_ANON_STRUCT__ 1
#define __CL_ANON_STRUCT__
/* Disable warning C4201: nonstandard extension used : nameless
* struct/union */
#pragma warning( push )
#pragma warning( disable : 4201 )
#else
#define __CL_HAS_ANON_STRUCT__ 0
#define __CL_ANON_STRUCT__
#endif
/* Define alignment keys */
#if defined( __GNUC__ )
#define CL_ALIGNED(_x) __attribute__ ((aligned(_x)))
@@ -410,7 +484,7 @@ typedef unsigned int cl_GLenum;
#endif
/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
#if __CL_HAS_ANON_STRUCT__
/* .xyzw and .s0123...{f|F} are supported */
#define CL_HAS_NAMED_VECTOR_FIELDS 1
/* .hi and .lo are supported */
@@ -423,10 +497,10 @@ typedef unsigned int cl_GLenum;
typedef union
{
cl_char CL_ALIGNED(2) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y; };
__extension__ struct{ cl_char s0, s1; };
__extension__ struct{ cl_char lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_char lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2;
@@ -436,10 +510,10 @@ typedef union
typedef union
{
cl_char CL_ALIGNED(4) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y, z, w; };
__extension__ struct{ cl_char s0, s1, s2, s3; };
__extension__ struct{ cl_char2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[2];
@@ -455,10 +529,10 @@ typedef cl_char4 cl_char3;
typedef union
{
cl_char CL_ALIGNED(8) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y, z, w; };
__extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_char4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[4];
@@ -474,10 +548,10 @@ typedef union
typedef union
{
cl_char CL_ALIGNED(16) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_char8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; };
#endif
#if defined( __CL_CHAR2__)
__cl_char2 v2[8];
@@ -498,10 +572,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(2) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y; };
__extension__ struct{ cl_uchar s0, s1; };
__extension__ struct{ cl_uchar lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_uchar lo, hi; };
#endif
#if defined( __cl_uchar2__)
__cl_uchar2 v2;
@@ -511,10 +585,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(4) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y, z, w; };
__extension__ struct{ cl_uchar s0, s1, s2, s3; };
__extension__ struct{ cl_uchar2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[2];
@@ -530,10 +604,10 @@ typedef cl_uchar4 cl_uchar3;
typedef union
{
cl_uchar CL_ALIGNED(8) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y, z, w; };
__extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_uchar4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[4];
@@ -549,10 +623,10 @@ typedef union
typedef union
{
cl_uchar CL_ALIGNED(16) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_uchar8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; };
#endif
#if defined( __CL_UCHAR2__)
__cl_uchar2 v2[8];
@@ -573,10 +647,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(4) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y; };
__extension__ struct{ cl_short s0, s1; };
__extension__ struct{ cl_short lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_short lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2;
@@ -586,10 +660,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(8) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y, z, w; };
__extension__ struct{ cl_short s0, s1, s2, s3; };
__extension__ struct{ cl_short2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[2];
@@ -605,10 +679,10 @@ typedef cl_short4 cl_short3;
typedef union
{
cl_short CL_ALIGNED(16) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y, z, w; };
__extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_short4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[4];
@@ -624,10 +698,10 @@ typedef union
typedef union
{
cl_short CL_ALIGNED(32) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_short8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; };
#endif
#if defined( __CL_SHORT2__)
__cl_short2 v2[8];
@@ -648,10 +722,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(4) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y; };
__extension__ struct{ cl_ushort s0, s1; };
__extension__ struct{ cl_ushort lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_ushort lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2;
@@ -661,10 +735,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(8) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y, z, w; };
__extension__ struct{ cl_ushort s0, s1, s2, s3; };
__extension__ struct{ cl_ushort2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[2];
@@ -680,10 +754,10 @@ typedef cl_ushort4 cl_ushort3;
typedef union
{
cl_ushort CL_ALIGNED(16) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y, z, w; };
__extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_ushort4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[4];
@@ -699,10 +773,10 @@ typedef union
typedef union
{
cl_ushort CL_ALIGNED(32) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_ushort8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; };
#endif
#if defined( __CL_USHORT2__)
__cl_ushort2 v2[8];
@@ -722,10 +796,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(8) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y; };
__extension__ struct{ cl_int s0, s1; };
__extension__ struct{ cl_int lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_int lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2;
@@ -735,10 +809,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(16) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y, z, w; };
__extension__ struct{ cl_int s0, s1, s2, s3; };
__extension__ struct{ cl_int2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[2];
@@ -754,10 +828,10 @@ typedef cl_int4 cl_int3;
typedef union
{
cl_int CL_ALIGNED(32) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y, z, w; };
__extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_int4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[4];
@@ -773,10 +847,10 @@ typedef union
typedef union
{
cl_int CL_ALIGNED(64) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_int8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; };
#endif
#if defined( __CL_INT2__)
__cl_int2 v2[8];
@@ -797,10 +871,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(8) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y; };
__extension__ struct{ cl_uint s0, s1; };
__extension__ struct{ cl_uint lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_uint lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2;
@@ -810,10 +884,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(16) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y, z, w; };
__extension__ struct{ cl_uint s0, s1, s2, s3; };
__extension__ struct{ cl_uint2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[2];
@@ -829,10 +903,10 @@ typedef cl_uint4 cl_uint3;
typedef union
{
cl_uint CL_ALIGNED(32) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y, z, w; };
__extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_uint4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[4];
@@ -848,10 +922,10 @@ typedef union
typedef union
{
cl_uint CL_ALIGNED(64) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_uint8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; };
#endif
#if defined( __CL_UINT2__)
__cl_uint2 v2[8];
@@ -871,10 +945,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(16) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y; };
__extension__ struct{ cl_long s0, s1; };
__extension__ struct{ cl_long lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_long lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2;
@@ -884,10 +958,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(32) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y, z, w; };
__extension__ struct{ cl_long s0, s1, s2, s3; };
__extension__ struct{ cl_long2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[2];
@@ -903,10 +977,10 @@ typedef cl_long4 cl_long3;
typedef union
{
cl_long CL_ALIGNED(64) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y, z, w; };
__extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_long4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[4];
@@ -922,10 +996,10 @@ typedef union
typedef union
{
cl_long CL_ALIGNED(128) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_long8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; };
#endif
#if defined( __CL_LONG2__)
__cl_long2 v2[8];
@@ -946,10 +1020,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(16) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y; };
__extension__ struct{ cl_ulong s0, s1; };
__extension__ struct{ cl_ulong lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_ulong lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2;
@@ -959,10 +1033,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(32) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y, z, w; };
__extension__ struct{ cl_ulong s0, s1, s2, s3; };
__extension__ struct{ cl_ulong2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[2];
@@ -978,10 +1052,10 @@ typedef cl_ulong4 cl_ulong3;
typedef union
{
cl_ulong CL_ALIGNED(64) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y, z, w; };
__extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_ulong4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[4];
@@ -997,10 +1071,10 @@ typedef union
typedef union
{
cl_ulong CL_ALIGNED(128) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_ulong8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; };
#endif
#if defined( __CL_ULONG2__)
__cl_ulong2 v2[8];
@@ -1022,10 +1096,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(8) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y; };
__extension__ struct{ cl_float s0, s1; };
__extension__ struct{ cl_float lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_float lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2;
@@ -1035,10 +1109,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(16) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y, z, w; };
__extension__ struct{ cl_float s0, s1, s2, s3; };
__extension__ struct{ cl_float2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_float2 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[2];
@@ -1054,10 +1128,10 @@ typedef cl_float4 cl_float3;
typedef union
{
cl_float CL_ALIGNED(32) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y, z, w; };
__extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_float4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_float4 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[4];
@@ -1073,10 +1147,10 @@ typedef union
typedef union
{
cl_float CL_ALIGNED(64) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_float8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; };
#endif
#if defined( __CL_FLOAT2__)
__cl_float2 v2[8];
@@ -1097,10 +1171,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(16) s[2];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y; };
__extension__ struct{ cl_double s0, s1; };
__extension__ struct{ cl_double lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1; };
__CL_ANON_STRUCT__ struct{ cl_double lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2;
@@ -1110,10 +1184,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(32) s[4];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y, z, w; };
__extension__ struct{ cl_double s0, s1, s2, s3; };
__extension__ struct{ cl_double2 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3; };
__CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[2];
@@ -1129,10 +1203,10 @@ typedef cl_double4 cl_double3;
typedef union
{
cl_double CL_ALIGNED(64) s[8];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y, z, w; };
__extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
__extension__ struct{ cl_double4 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; };
__CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[4];
@@ -1148,10 +1222,10 @@ typedef union
typedef union
{
cl_double CL_ALIGNED(128) s[16];
#if defined( __GNUC__) && ! defined( __STRICT_ANSI__ )
__extension__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__extension__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__extension__ struct{ cl_double8 lo, hi; };
#if __CL_HAS_ANON_STRUCT__
__CL_ANON_STRUCT__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; };
__CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; };
__CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; };
#endif
#if defined( __CL_DOUBLE2__)
__cl_double2 v2[8];
@@ -1170,13 +1244,13 @@ typedef union
/* Macro to facilitate debugging
* Usage:
* Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source.
* The first line ends with: CL_PROGRAM_STRING_BEGIN \"
* The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \"
* Each line thereafter of OpenCL C source must end with: \n\
* The last line ends in ";
*
* Example:
*
* const char *my_program = CL_PROGRAM_STRING_BEGIN "\
* const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\
* kernel void foo( int a, float * b ) \n\
* { \n\
* // my comment \n\
@@ -1195,4 +1269,10 @@ typedef union
}
#endif
#undef __CL_HAS_ANON_STRUCT__
#undef __CL_ANON_STRUCT__
#if defined( _WIN32) && (_MSC_VER >= 1500)
#pragma warning( pop )
#endif
#endif /* __CL_PLATFORM_H */

View File

@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008-2010 The Khronos Group Inc.
* Copyright (c) 2008-2012 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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file contains Chromium-specific EGL extensions declarations.
#ifndef GPU_EGL_EGLEXTCHROMIUM_H_
#define GPU_EGL_EGLEXTCHROMIUM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <EGL/eglplatform.h>
/* EGLSyncControlCHROMIUM requires 64-bit uint support */
#if KHRONOS_SUPPORT_INT64
#ifndef EGL_CHROMIUM_sync_control
#define EGL_CHROMIUM_sync_control 1
typedef khronos_uint64_t EGLuint64CHROMIUM;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(
EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC)
(EGLDisplay dpy, EGLSurface surface, EGLuint64CHROMIUM *ust,
EGLuint64CHROMIUM *msc, EGLuint64CHROMIUM *sbc);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif // GPU_EGL_EGLEXTCHROMIUM_H_

View File

@@ -165,6 +165,11 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EG
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
#ifndef EGL_MESA_configless_context
#define EGL_MESA_configless_context 1
#define EGL_NO_CONFIG_MESA ((EGLConfig)0)
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -97,10 +97,6 @@
#define GLAPIENTRYP GLAPIENTRY *
#endif
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export on
#endif
/*
* End system-specific stuff.
**********************************************************************/
@@ -694,7 +690,7 @@ typedef double GLclampd; /* double precision float in [0,1] */
#define GL_LIST_BIT 0x00020000
#define GL_TEXTURE_BIT 0x00040000
#define GL_SCISSOR_BIT 0x00080000
#define GL_ALL_ATTRIB_BITS 0x000FFFFF
#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
/* OpenGL 1.1 */
@@ -2112,19 +2108,6 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
**/
/**********************************************************************
* Begin system-specific stuff
*/
#if defined(PRAGMA_EXPORT_SUPPORTED)
#pragma export off
#endif
/*
* End system-specific stuff
**********************************************************************/
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

3589
include/GL/glcorearb.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -518,7 +518,7 @@ typedef struct {
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
GLXDrawable drawable; /* drawable on which event was requested in event mask */
Drawable drawable; /* drawable on which event was requested in event mask */
int event_type;
int64_t ust;
int64_t msc;

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013 The Khronos Group Inc.
** Copyright (c) 2013-2014 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
@@ -33,10 +33,10 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 24777 $ on $Date: 2014-01-14 14:02:32 -0800 (Tue, 14 Jan 2014) $
** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $
*/
#define GLX_GLXEXT_VERSION 20140114
#define GLX_GLXEXT_VERSION 20140810
/* Generated C header for:
* API: glx
@@ -158,6 +158,13 @@ __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
#endif
#endif /* GLX_VERSION_1_4 */
#ifndef GLX_ARB_context_flush_control
#define GLX_ARB_context_flush_control 1
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
#endif /* GLX_ARB_context_flush_control */
#ifndef GLX_ARB_create_context
#define GLX_ARB_create_context 1
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
@@ -290,6 +297,23 @@ void glXFreeContextEXT (Display *dpy, GLXContext context);
#endif
#endif /* GLX_EXT_import_context */
#ifndef GLX_EXT_stereo_tree
#define GLX_EXT_stereo_tree 1
typedef struct {
int type;
unsigned long serial;
Bool send_event;
Display *display;
int extension;
int evtype;
GLXDrawable window;
Bool stereo_tree;
} GLXStereoNotifyEventEXT;
#define GLX_STEREO_TREE_EXT 0x20F5
#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001
#define GLX_STEREO_NOTIFY_EXT 0x00000000
#endif /* GLX_EXT_stereo_tree */
#ifndef GLX_EXT_swap_control
#define GLX_EXT_swap_control 1
#define GLX_SWAP_INTERVAL_EXT 0x20F1
@@ -407,6 +431,32 @@ GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixm
#endif
#endif /* GLX_MESA_pixmap_colormap */
#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
typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value);
typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute);
typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
typedef const char *( *PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute);
#ifdef GLX_GLXEXT_PROTOTYPES
Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int *value);
const char *glXQueryCurrentRendererStringMESA (int attribute);
Bool glXQueryRendererIntegerMESA (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
const char *glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute);
#endif
#endif /* GLX_MESA_query_renderer */
#ifndef GLX_MESA_release_buffers
#define GLX_MESA_release_buffers 1
typedef Bool ( *PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
@@ -425,6 +475,16 @@ Bool glXSet3DfxModeMESA (int mode);
#endif
#endif /* GLX_MESA_set_3dfx_mode */
#ifndef GLX_NV_copy_buffer
#define GLX_NV_copy_buffer 1
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
#ifdef GLX_GLXEXT_PROTOTYPES
void glXCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
void glXNamedCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
#endif
#endif /* GLX_NV_copy_buffer */
#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
@@ -501,8 +561,8 @@ void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV devic
#endif
#endif /* GLX_NV_video_capture */
#ifndef GLX_NV_video_output
#define GLX_NV_video_output 1
#ifndef GLX_NV_video_out
#define GLX_NV_video_out 1
typedef unsigned int GLXVideoDeviceNV;
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
@@ -528,7 +588,7 @@ int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#endif /* GLX_NV_video_output */
#endif /* GLX_NV_video_out */
#ifndef GLX_OML_swap_method
#define GLX_OML_swap_method 1

View File

@@ -231,7 +231,7 @@ struct __DRItexOffsetExtensionRec {
#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
#define __DRI_TEX_BUFFER "DRI_TexBuffer"
#define __DRI_TEX_BUFFER_VERSION 2
#define __DRI_TEX_BUFFER_VERSION 3
struct __DRItexBufferExtensionRec {
__DRIextension base;
@@ -251,6 +251,8 @@ struct __DRItexBufferExtensionRec {
* __DRIdrawable, including the required texture format attribute.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*
* \since 2
*/
void (*setTexBuffer2)(__DRIcontext *pDRICtx,
GLint target,
@@ -261,6 +263,8 @@ struct __DRItexBufferExtensionRec {
* need this.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*
* \since 3
*/
void (*releaseTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
@@ -464,6 +468,8 @@ struct __DRIswrastLoaderExtensionRec {
/**
* Put image to drawable
*
* \since 2
*/
void (*putImage2)(__DRIdrawable *drawable, int op,
int x, int y, int width, int height, int stride,
@@ -848,6 +854,8 @@ struct __DRIdri2LoaderExtensionRec {
* \param driDrawable Drawable whose front-buffer is to be flushed
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable
*
* \since 2
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
@@ -870,6 +878,8 @@ struct __DRIdri2LoaderExtensionRec {
* \c attachments.
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable.
*
* \since 3
*/
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
int *width, int *height,
@@ -995,7 +1005,7 @@ struct __DRIdri2ExtensionRec {
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 8
#define __DRI_IMAGE_VERSION 10
/**
* These formats correspond to the similarly named MESA_FORMAT_*
@@ -1123,6 +1133,20 @@ enum __DRIChromaSiting {
#define __DRI_IMAGE_ERROR_BAD_PARAMETER 3
/*@}*/
/**
* \name Capabilities that might be returned by __DRIimageExtensionRec::getCapabilities
*/
/*@{*/
#define __DRI_IMAGE_CAP_GLOBAL_NAMES 1
/*@}*/
/**
* blitImage flags
*/
#define __BLIT_FLAG_FLUSH 0x0001
#define __BLIT_FLAG_FINISH 0x0002
typedef struct __DRIimageRec __DRIimage;
typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
@@ -1229,6 +1253,29 @@ struct __DRIimageExtensionRec {
enum __DRIChromaSiting vert_siting,
unsigned *error,
void *loaderPrivate);
/**
* Blit a part of a __DRIimage to another and flushes
*
* flush_flag:
* 0: no flush
* __BLIT_FLAG_FLUSH: flush after the blit operation
* __BLIT_FLAG_FINISH: flush and wait the blit finished
*
* \since 9
*/
void (*blitImage)(__DRIcontext *context, __DRIimage *dst, __DRIimage *src,
int dstx0, int dsty0, int dstwidth, int dstheight,
int srcx0, int srcy0, int srcwidth, int srcheight,
int flush_flag);
/**
* Query for general capabilities of the driver that concern
* buffer sharing and image importing.
*
* \since 10
*/
int (*getCapabilities)(__DRIscreen *screen);
};
@@ -1262,9 +1309,9 @@ typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
struct __DRI2configQueryExtensionRec {
__DRIextension base;
int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
int (*configQueryb)(__DRIscreen *screen, const char *var, unsigned char *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, int *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, float *val);
};
/**

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013 The Khronos Group Inc.
** Copyright (c) 2013-2014 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
@@ -33,14 +33,14 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 24614 $ on $Date: 2013-12-30 04:44:46 -0800 (Mon, 30 Dec 2013) $
** Khronos $Revision: 25922 $ on $Date: 2014-03-17 03:54:32 -0700 (Mon, 17 Mar 2014) $
*/
#ifndef GL_APIENTRYP
#define GL_APIENTRYP GL_APIENTRY*
#endif
/* Generated on date 20131230 */
/* Generated on date 20140317 */
/* Generated C header for:
* API: gles2
@@ -52,6 +52,30 @@ extern "C" {
* Extensions removed: _nomatch_^
*/
#ifndef GL_KHR_blend_equation_advanced
#define GL_KHR_blend_equation_advanced 1
#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285
#define GL_MULTIPLY_KHR 0x9294
#define GL_SCREEN_KHR 0x9295
#define GL_OVERLAY_KHR 0x9296
#define GL_DARKEN_KHR 0x9297
#define GL_LIGHTEN_KHR 0x9298
#define GL_COLORDODGE_KHR 0x9299
#define GL_COLORBURN_KHR 0x929A
#define GL_HARDLIGHT_KHR 0x929B
#define GL_SOFTLIGHT_KHR 0x929C
#define GL_DIFFERENCE_KHR 0x929E
#define GL_EXCLUSION_KHR 0x92A0
#define GL_HSL_HUE_KHR 0x92AD
#define GL_HSL_SATURATION_KHR 0x92AE
#define GL_HSL_COLOR_KHR 0x92AF
#define GL_HSL_LUMINOSITY_KHR 0x92B0
typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void);
#endif
#endif /* GL_KHR_blend_equation_advanced */
#ifndef GL_KHR_debug
#define GL_KHR_debug 1
typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
@@ -277,6 +301,31 @@ GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname,
#define GL_OES_rgb8_rgba8 1
#endif /* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_sample_shading
#define GL_OES_sample_shading 1
#define GL_SAMPLE_SHADING_OES 0x8C36
#define GL_MIN_SAMPLE_SHADING_VALUE_OES 0x8C37
typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value);
#endif
#endif /* GL_OES_sample_shading */
#ifndef GL_OES_sample_variables
#define GL_OES_sample_variables 1
#endif /* GL_OES_sample_variables */
#ifndef GL_OES_shader_image_atomic
#define GL_OES_shader_image_atomic 1
#endif /* GL_OES_shader_image_atomic */
#ifndef GL_OES_shader_multisample_interpolation
#define GL_OES_shader_multisample_interpolation 1
#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B
#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C
#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D
#endif /* GL_OES_shader_multisample_interpolation */
#ifndef GL_OES_standard_derivatives
#define GL_OES_standard_derivatives 1
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
@@ -366,6 +415,25 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum att
#define GL_OES_texture_npot 1
#endif /* GL_OES_texture_npot */
#ifndef GL_OES_texture_stencil8
#define GL_OES_texture_stencil8 1
#define GL_STENCIL_INDEX_OES 0x1901
#define GL_STENCIL_INDEX8_OES 0x8D48
#endif /* GL_OES_texture_stencil8 */
#ifndef GL_OES_texture_storage_multisample_2d_array
#define GL_OES_texture_storage_multisample_2d_array 1
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102
#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105
#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B
#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C
#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
#endif
#endif /* GL_OES_texture_storage_multisample_2d_array */
#ifndef GL_OES_vertex_array_object
#define GL_OES_vertex_array_object 1
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
@@ -613,6 +681,16 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_ARM_rgba8 1
#endif /* GL_ARM_rgba8 */
#ifndef GL_ARM_shader_framebuffer_fetch
#define GL_ARM_shader_framebuffer_fetch 1
#define GL_FETCH_PER_SAMPLE_ARM 0x8F65
#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66
#endif /* GL_ARM_shader_framebuffer_fetch */
#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil
#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
#ifndef GL_DMP_shader_binary
#define GL_DMP_shader_binary 1
#define GL_SHADER_BINARY_DMP 0x9250
@@ -990,6 +1068,13 @@ GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLin
#define GL_EXT_shader_integer_mix 1
#endif /* GL_EXT_shader_integer_mix */
#ifndef GL_EXT_shader_pixel_local_storage
#define GL_EXT_shader_pixel_local_storage 1
#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63
#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67
#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64
#endif /* GL_EXT_shader_pixel_local_storage */
#ifndef GL_EXT_shader_texture_lod
#define GL_EXT_shader_texture_lod 1
#endif /* GL_EXT_shader_texture_lod */

1184
include/GLES3/gl31.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#ifndef __gl3platform_h_
#define __gl3platform_h_
/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */
/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version

View File

@@ -27,7 +27,9 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#ifndef assert
#include <assert.h>
#endif
#include <limits.h>
#include <errno.h>
#include <unistd.h>

View File

@@ -26,7 +26,9 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef assert
#include <assert.h>
#endif
#include <limits.h>
#include <errno.h>
#include <process.h> // MSVCRT
@@ -146,7 +148,7 @@ static unsigned __stdcall impl_thrd_routine(void *p)
static DWORD impl_xtime2msec(const xtime *xt)
{
return (DWORD)((xt->sec * 1000u) + (xt->nsec / 1000));
return (DWORD)((xt->sec * 1000U) + (xt->nsec / 1000000L));
}
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
@@ -294,7 +296,7 @@ static void impl_tss_dtor_invoke()
static inline void
call_once(once_flag *flag, void (*func)(void))
{
assert(!flag && !func);
assert(flag && func);
#ifdef EMULATED_THREADS_USE_NATIVE_CALL_ONCE
{
struct impl_call_once_param param;
@@ -492,12 +494,42 @@ thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
return thrd_success;
}
#if 0
// 7.25.5.2
static inline thrd_t
thrd_current(void)
{
return GetCurrentThread();
HANDLE hCurrentThread;
BOOL bRet;
/* GetCurrentThread() returns a pseudo-handle, which is useless. We need
* to call DuplicateHandle to get a real handle. However the handle value
* will not match the one returned by thread_create.
*
* Other potential solutions would be:
* - define thrd_t as a thread Ids, but this would mean we'd need to OpenThread for many operations
* - use malloc'ed memory for thrd_t. This would imply using TLS for current thread.
*
* Neither is particularly nice.
*
* Life would be much easier if C11 threads had different abstractions for
* threads and thread IDs, just like C++11 threads does...
*/
bRet = DuplicateHandle(GetCurrentProcess(), // source process (pseudo) handle
GetCurrentThread(), // source (pseudo) handle
GetCurrentProcess(), // target process
&hCurrentThread, // target handle
0,
FALSE,
DUPLICATE_SAME_ACCESS);
assert(bRet);
if (!bRet) {
hCurrentThread = GetCurrentThread();
}
return hCurrentThread;
}
#endif
// 7.25.5.3
static inline int
@@ -511,7 +543,7 @@ thrd_detach(thrd_t thr)
static inline int
thrd_equal(thrd_t thr0, thrd_t thr1)
{
return (thr0 == thr1);
return GetThreadId(thr0) == GetThreadId(thr1);
}
// 7.25.5.5

View File

@@ -91,23 +91,25 @@ 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")
#ifdef INTEL_PRELIMINARY_HW_SUPPORT
CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell")
CHIPSET(0x1612, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x1616, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x161E, bdw_gt2, "Intel(R) Broadwell")
CHIPSET(0x1622, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x1626, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162A, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162B, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell")
CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell")
#endif
CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x1612, bdw_gt2, "Intel(R) HD Graphics 5600 (Broadwell GT2)")
CHIPSET(0x1616, bdw_gt2, "Intel(R) HD Graphics 5500 (Broadwell GT2)")
CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161E, bdw_gt2, "Intel(R) HD Graphics 5300 (Broadwell GT2)")
CHIPSET(0x1622, bdw_gt3, "Intel(R) Iris Pro 6200 (Broadwell GT3e)")
CHIPSET(0x1626, bdw_gt3, "Intel(R) HD Graphics 6000 (Broadwell GT3)")
CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)")
CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)")
CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3")
CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3")
CHIPSET(0x22B0, chv, "Intel(R) Cherryview")
CHIPSET(0x22B1, chv, "Intel(R) Cherryview")
CHIPSET(0x22B2, chv, "Intel(R) Cherryview")
CHIPSET(0x22B3, chv, "Intel(R) Cherryview")

View File

@@ -38,6 +38,7 @@ CHIPSET(0x6828, VERDE_6828, VERDE)
CHIPSET(0x6829, VERDE_6829, VERDE)
CHIPSET(0x682A, VERDE_682A, VERDE)
CHIPSET(0x682B, VERDE_682B, VERDE)
CHIPSET(0x682C, VERDE_682C, VERDE)
CHIPSET(0x682D, VERDE_682D, VERDE)
CHIPSET(0x682F, VERDE_682F, VERDE)
CHIPSET(0x6830, VERDE_6830, VERDE)
@@ -54,8 +55,11 @@ CHIPSET(0x6600, OLAND_6600, OLAND)
CHIPSET(0x6601, OLAND_6601, OLAND)
CHIPSET(0x6602, OLAND_6602, OLAND)
CHIPSET(0x6603, OLAND_6603, OLAND)
CHIPSET(0x6604, OLAND_6604, OLAND)
CHIPSET(0x6605, OLAND_6605, OLAND)
CHIPSET(0x6606, OLAND_6606, OLAND)
CHIPSET(0x6607, OLAND_6607, OLAND)
CHIPSET(0x6608, OLAND_6608, OLAND)
CHIPSET(0x6610, OLAND_6610, OLAND)
CHIPSET(0x6611, OLAND_6611, OLAND)
CHIPSET(0x6613, OLAND_6613, OLAND)
@@ -73,6 +77,8 @@ CHIPSET(0x666F, HAINAN_666F, HAINAN)
CHIPSET(0x6640, BONAIRE_6640, BONAIRE)
CHIPSET(0x6641, BONAIRE_6641, BONAIRE)
CHIPSET(0x6646, BONAIRE_6646, BONAIRE)
CHIPSET(0x6647, BONAIRE_6647, BONAIRE)
CHIPSET(0x6649, BONAIRE_6649, BONAIRE)
CHIPSET(0x6650, BONAIRE_6650, BONAIRE)
CHIPSET(0x6651, BONAIRE_6651, BONAIRE)
@@ -97,6 +103,23 @@ CHIPSET(0x983D, KABINI_983D, KABINI)
CHIPSET(0x983E, KABINI_983E, KABINI)
CHIPSET(0x983F, KABINI_983F, KABINI)
CHIPSET(0x9850, MULLINS_9850, MULLINS)
CHIPSET(0x9851, MULLINS_9851, MULLINS)
CHIPSET(0x9852, MULLINS_9852, MULLINS)
CHIPSET(0x9853, MULLINS_9853, MULLINS)
CHIPSET(0x9854, MULLINS_9854, MULLINS)
CHIPSET(0x9855, MULLINS_9855, MULLINS)
CHIPSET(0x9856, MULLINS_9856, MULLINS)
CHIPSET(0x9857, MULLINS_9857, MULLINS)
CHIPSET(0x9858, MULLINS_9858, MULLINS)
CHIPSET(0x9859, MULLINS_9859, MULLINS)
CHIPSET(0x985A, MULLINS_985A, MULLINS)
CHIPSET(0x985B, MULLINS_985B, MULLINS)
CHIPSET(0x985C, MULLINS_985C, MULLINS)
CHIPSET(0x985D, MULLINS_985D, MULLINS)
CHIPSET(0x985E, MULLINS_985E, MULLINS)
CHIPSET(0x985F, MULLINS_985F, MULLINS)
CHIPSET(0x1304, KAVERI_1304, KAVERI)
CHIPSET(0x1305, KAVERI_1305, KAVERI)
CHIPSET(0x1306, KAVERI_1306, KAVERI)
@@ -115,6 +138,7 @@ CHIPSET(0x1313, KAVERI_1313, KAVERI)
CHIPSET(0x1315, KAVERI_1315, KAVERI)
CHIPSET(0x1316, KAVERI_1316, KAVERI)
CHIPSET(0x1317, KAVERI_1317, KAVERI)
CHIPSET(0x1318, KAVERI_1318, KAVERI)
CHIPSET(0x131B, KAVERI_131B, KAVERI)
CHIPSET(0x131C, KAVERI_131C, KAVERI)
CHIPSET(0x131D, KAVERI_131D, KAVERI)

26
install-gallium-links.mk Normal file
View File

@@ -0,0 +1,26 @@
# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the driver into /lib of the build tree.
if BUILD_SHARED
if HAVE_COMPAT_SYMLINKS
all-local : .libs/install-gallium-links
.libs/install-gallium-links : $(dri_LTLIBRARIES) $(egl_LTLIBRARIES) $(lib_LTLIBRARIES)
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \
if test x$(egl_LTLIBRARIES) != x; then \
link_dir=$(top_builddir)/$(LIB_DIR)/egl; \
fi; \
$(MKDIR_P) $$link_dir; \
file_list=$(dri_LTLIBRARIES:%.la=.libs/%.so); \
file_list+=$(egl_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
file_list+=$(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*); \
for f in $$file_list; do \
if test -h .libs/$$f; then \
cp -d $$f $$link_dir; \
else \
ln -f $$f $$link_dir; \
fi; \
done && touch $@
endif
endif

View File

@@ -1,14 +1,18 @@
# Provide compatibility with scripts for the old Mesa build system for
# a while by putting a link to the driver into /lib of the build tree.
if BUILD_SHARED
if HAVE_COMPAT_SYMLINKS
all-local : .libs/install-mesa-links
.libs/install-mesa-links : $(lib_LTLIBRARIES)
$(MKDIR_P) $(top_builddir)/$(LIB_DIR)
for f in $(lib_LTLIBRARIES:%.la=.libs/%.so*); do \
$(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \
for f in $(join $(addsuffix .libs/,$(dir $(lib_LTLIBRARIES))),$(notdir $(lib_LTLIBRARIES:%.la=%.$(LIB_EXT)*))); do \
if test -h .libs/$$f; then \
cp -d $$f $(top_builddir)/$(LIB_DIR); \
else \
ln -f $$f $(top_builddir)/$(LIB_DIR); \
fi; \
done && touch $@
endif
endif

168
m4/ax_gcc_builtin.m4 Normal file
View File

@@ -0,0 +1,168 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_GCC_BUILTIN(BUILTIN)
#
# DESCRIPTION
#
# This macro checks if the compiler supports one of GCC's built-in
# functions; many other compilers also provide those same built-ins.
#
# The BUILTIN parameter is the name of the built-in function.
#
# If BUILTIN is supported define HAVE_<BUILTIN>. Keep in mind that since
# builtins usually start with two underscores they will be copied over
# into the HAVE_<BUILTIN> definition (e.g. HAVE___BUILTIN_EXPECT for
# __builtin_expect()).
#
# The macro caches its result in the ax_cv_have_<BUILTIN> variable (e.g.
# ax_cv_have___builtin_expect).
#
# The macro currently supports the following built-in functions:
#
# __builtin_assume_aligned
# __builtin_bswap32
# __builtin_bswap64
# __builtin_choose_expr
# __builtin___clear_cache
# __builtin_clrsb
# __builtin_clrsbl
# __builtin_clrsbll
# __builtin_clz
# __builtin_clzl
# __builtin_clzll
# __builtin_complex
# __builtin_constant_p
# __builtin_ctz
# __builtin_ctzl
# __builtin_ctzll
# __builtin_expect
# __builtin_ffs
# __builtin_ffsl
# __builtin_ffsll
# __builtin_fpclassify
# __builtin_huge_val
# __builtin_huge_valf
# __builtin_huge_vall
# __builtin_inf
# __builtin_infd128
# __builtin_infd32
# __builtin_infd64
# __builtin_inff
# __builtin_infl
# __builtin_isinf_sign
# __builtin_nan
# __builtin_nand128
# __builtin_nand32
# __builtin_nand64
# __builtin_nanf
# __builtin_nanl
# __builtin_nans
# __builtin_nansf
# __builtin_nansl
# __builtin_object_size
# __builtin_parity
# __builtin_parityl
# __builtin_parityll
# __builtin_popcount
# __builtin_popcountl
# __builtin_popcountll
# __builtin_powi
# __builtin_powif
# __builtin_powil
# __builtin_prefetch
# __builtin_trap
# __builtin_types_compatible_p
# __builtin_unreachable
#
# Unsuppored built-ins will be tested with an empty parameter set and the
# result of the check might be wrong or meaningless so use with care.
#
# LICENSE
#
# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
#
# 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 2
AC_DEFUN([AX_GCC_BUILTIN], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1])
AC_CACHE_CHECK([for $1], [ac_var], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [
m4_case([$1],
[__builtin_assume_aligned], [$1("", 0)],
[__builtin_bswap32], [$1(0)],
[__builtin_bswap64], [$1(0)],
[__builtin_choose_expr], [$1(0, 0, 0)],
[__builtin___clear_cache], [$1("", "")],
[__builtin_clrsb], [$1(0)],
[__builtin_clrsbl], [$1(0)],
[__builtin_clrsbll], [$1(0)],
[__builtin_clz], [$1(0)],
[__builtin_clzl], [$1(0)],
[__builtin_clzll], [$1(0)],
[__builtin_complex], [$1(0.0, 0.0)],
[__builtin_constant_p], [$1(0)],
[__builtin_ctz], [$1(0)],
[__builtin_ctzl], [$1(0)],
[__builtin_ctzll], [$1(0)],
[__builtin_expect], [$1(0, 0)],
[__builtin_ffs], [$1(0)],
[__builtin_ffsl], [$1(0)],
[__builtin_ffsll], [$1(0)],
[__builtin_fpclassify], [$1(0, 1, 2, 3, 4, 0.0)],
[__builtin_huge_val], [$1()],
[__builtin_huge_valf], [$1()],
[__builtin_huge_vall], [$1()],
[__builtin_inf], [$1()],
[__builtin_infd128], [$1()],
[__builtin_infd32], [$1()],
[__builtin_infd64], [$1()],
[__builtin_inff], [$1()],
[__builtin_infl], [$1()],
[__builtin_isinf_sign], [$1(0.0)],
[__builtin_nan], [$1("")],
[__builtin_nand128], [$1("")],
[__builtin_nand32], [$1("")],
[__builtin_nand64], [$1("")],
[__builtin_nanf], [$1("")],
[__builtin_nanl], [$1("")],
[__builtin_nans], [$1("")],
[__builtin_nansf], [$1("")],
[__builtin_nansl], [$1("")],
[__builtin_object_size], [$1("", 0)],
[__builtin_parity], [$1(0)],
[__builtin_parityl], [$1(0)],
[__builtin_parityll], [$1(0)],
[__builtin_popcount], [$1(0)],
[__builtin_popcountl], [$1(0)],
[__builtin_popcountll], [$1(0)],
[__builtin_powi], [$1(0, 0)],
[__builtin_powif], [$1(0, 0)],
[__builtin_powil], [$1(0, 0)],
[__builtin_prefetch], [$1("")],
[__builtin_trap], [$1()],
[__builtin_types_compatible_p], [$1(int, int)],
[__builtin_unreachable], [$1()],
[m4_warn([syntax], [Unsupported built-in $1, the test may fail])
$1()]
)
])],
[AS_VAR_SET([ac_var], [yes])],
[AS_VAR_SET([ac_var], [no])])
])
AS_IF([test yes = AS_VAR_GET([ac_var])],
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1,
[Define to 1 if the system has the `$1' built-in function])], [])
AS_VAR_POPDEF([ac_var])
])

View File

@@ -1,49 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PYTHON_MODULE(modname[, fatal])
#
# DESCRIPTION
#
# Checks for Python module.
#
# If fatal is non-empty then absence of a module will trigger an error.
#
# LICENSE
#
# Copyright (c) 2008 Andrew Collier
#
# 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 6
AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
AC_DEFUN([AX_PYTHON_MODULE],[
if test -z $PYTHON2;
then
PYTHON2="python"
fi
PYTHON_NAME=`basename $PYTHON2`
AC_MSG_CHECKING($PYTHON_NAME module: $1)
$PYTHON2 -c "import $1" 2>/dev/null
if test $? -eq 0;
then
AC_MSG_RESULT(yes)
eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
else
AC_MSG_RESULT(no)
eval AS_TR_CPP(HAVE_PYMOD_$1)=no
#
if test -n "$2"
then
AC_MSG_ERROR(failed to find required module $1)
exit 1
fi
fi
])

View File

@@ -41,26 +41,13 @@ import SCons.Builder
import SCons.Tool
import SCons.Util
# This is what we search for to find mingw:
# These are the mingw toolchain prefixes we search for:
# (We only search for the mingw-w64 toolchain, and not the mingw.org one.)
prefixes32 = SCons.Util.Split("""
mingw32-
mingw32msvc-
i386-mingw32-
i486-mingw32-
i586-mingw32-
i686-mingw32-
i386-mingw32msvc-
i486-mingw32msvc-
i586-mingw32msvc-
i686-mingw32msvc-
i686-pc-mingw32-
i686-w64-mingw32-
""")
prefixes64 = SCons.Util.Split("""
x86_64-w64-mingw32-
amd64-mingw32-
amd64-mingw32msvc-
amd64-pc-mingw32-
""")
def find(env):

View File

@@ -276,6 +276,9 @@ def parse_source_list(env, filename, names=None):
# Prefer relative source paths, as absolute files tend to
# cause duplicate actions.
f = f[len(cur_srcdir + '/'):]
# do not include any headers
if f.endswith('.h'):
continue
srcs.append(f)
src_lists[sym] = srcs

View File

@@ -36,6 +36,8 @@ import os.path
import re
import subprocess
import platform as _platform
import sys
import tempfile
import SCons.Action
import SCons.Builder
@@ -104,6 +106,28 @@ def num_jobs():
return 1
def check_cc(env, cc, expr, cpp_opt = '-E'):
# Invoke C-preprocessor to determine whether the specified expression is
# true or not.
sys.stdout.write('Checking for %s ... ' % cc)
source = tempfile.NamedTemporaryFile(suffix='.c', delete=False)
source.write('#if !(%s)\n#error\n#endif\n' % expr)
source.close()
pipe = SCons.Action._subproc(env, [env['CC'], cpp_opt, source.name],
stdin = 'devnull',
stderr = 'devnull',
stdout = 'devnull')
result = pipe.wait() == 0
os.unlink(source.name)
sys.stdout.write(' %s\n' % ['no', 'yes'][int(bool(result))])
return result
def generate(env):
"""Common environment generation code"""
@@ -137,10 +161,18 @@ def generate(env):
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-')
env['msvc'] = env['CC'] == 'cl'
# Detect gcc/clang not by executable name, but through pre-defined macros
# as autoconf does, to avoid drawing wrong conclusions when using tools
# that overrice CC/CXX like scan-build.
env['gcc'] = 0
env['clang'] = 0
env['msvc'] = 0
if _platform.system() == 'Windows':
env['msvc'] = check_cc(env, 'MSVC', 'defined(_MSC_VER)', '/E')
if not env['msvc']:
env['gcc'] = check_cc(env, 'GCC', 'defined(__GNUC__) && !defined(__clang__)')
env['clang'] = check_cc(env, 'Clang', '__clang__')
env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc'
env['clang'] = env['CC'] == 'clang'
env['icc'] = 'icc' == os.path.basename(env['CC'])
if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64':
@@ -269,6 +301,11 @@ def generate(env):
cppdefines += ['HAVE_ALIAS']
else:
cppdefines += ['GLX_ALIAS_UNSUPPORTED']
if env['platform'] == 'haiku':
cppdefines += [
'HAVE_PTHREAD',
'HAVE_POSIX_MEMALIGN'
]
if platform == 'windows':
cppdefines += [
'WIN32',
@@ -396,6 +433,12 @@ def generate(env):
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# - cl /?
if 'MSVC_VERSION' not in env or distutils.version.LooseVersion(env['MSVC_VERSION']) < distutils.version.LooseVersion('12.0'):
# Use bundled stdbool.h and stdint.h headers for older MSVC
# versions. stdint.h was introduced in MSVC 2010, but stdbool.h
# was only introduced in MSVC 2013.
top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
env.Append(CPPPATH = [os.path.join(top_dir, 'include/c99')])
if env['build'] == 'debug':
ccflags += [
'/Od', # disable optimizations
@@ -418,7 +461,9 @@ def generate(env):
]
ccflags += [
'/W3', # warning level
#'/Wp64', # enable 64 bit porting warnings
'/wd4244', # conversion from 'type1' to 'type2', possible loss of data
'/wd4305', # truncation from 'type1' to 'type2'
'/wd4800', # forcing value to bool 'true' or 'false' (performance warning)
'/wd4996', # disable deprecated POSIX name warnings
]
if env['machine'] == 'x86':
@@ -447,6 +492,18 @@ def generate(env):
env.Append(CCFLAGS = ['/MT'])
env.Append(SHCCFLAGS = ['/LD'])
# Static code analysis
if env['analyze']:
if env['msvc']:
# http://msdn.microsoft.com/en-us/library/ms173498.aspx
env.Append(CCFLAGS = [
'/analyze',
#'/analyze:log', '${TARGET.base}.xml',
])
if env['clang']:
# scan-build will produce more comprehensive output
env.Append(CCFLAGS = ['--analyze'])
# Assembler options
if gcc_compat:
if env['machine'] == 'x86':
@@ -531,13 +588,10 @@ def generate(env):
createInstallMethods(env)
env.PkgCheckModules('X11', ['x11', 'xext', 'xdamage', 'xfixes'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1'])
env.PkgCheckModules('XCB', ['x11-xcb', 'xcb-glx >= 1.8.1', 'xcb-dri2 >= 1.8'])
env.PkgCheckModules('XF86VIDMODE', ['xxf86vm'])
env.PkgCheckModules('DRM', ['libdrm >= 2.4.24'])
env.PkgCheckModules('DRM_INTEL', ['libdrm_intel >= 2.4.30'])
env.PkgCheckModules('XORG', ['xorg-server >= 1.6.0'])
env.PkgCheckModules('KMS', ['libkms >= 2.4.24'])
env.PkgCheckModules('UDEV', ['libudev > 150'])
env.PkgCheckModules('DRM', ['libdrm >= 2.4.38'])
env.PkgCheckModules('UDEV', ['libudev >= 151'])
env['dri'] = env['x11'] and env['drm']

View File

@@ -37,6 +37,9 @@ import SCons.Errors
import SCons.Util
required_llvm_version = '3.1'
def generate(env):
env['llvm'] = False
@@ -84,6 +87,9 @@ def generate(env):
if llvm_version is None:
print 'scons: could not determine the LLVM version from %s' % llvm_config
return
if llvm_version < distutils.version.LooseVersion(required_llvm_version):
print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version)
return
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
env.AppendUnique(CPPDEFINES = [
@@ -98,64 +104,24 @@ def generate(env):
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMJIT',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMMCJIT', 'LLVMJIT',
'LLVMExecutionEngine', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport', 'LLVMRuntimeDyld', 'LLVMObject'
])
elif llvm_version >= distutils.version.LooseVersion('3.0'):
# 3.0
else:
# 3.1
env.Prepend(LIBS = [
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMJIT',
'LLVMX86Utils', 'LLVMX86Info', 'LLVMMCJIT', 'LLVMJIT',
'LLVMExecutionEngine', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMInstCombine', 'LLVMTransformUtils', 'LLVMipa',
'LLVMAnalysis', 'LLVMTarget', 'LLVMMC', 'LLVMCore',
'LLVMSupport'
])
elif llvm_version >= distutils.version.LooseVersion('2.9'):
# 2.9
env.Prepend(LIBS = [
'LLVMObject', 'LLVMMCJIT', 'LLVMMCDisassembler',
'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
'LLVMSelectionDAG', 'LLVMX86Utils', 'LLVMX86Info', 'LLVMAsmPrinter',
'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
'LLVMCore', 'LLVMMC', 'LLVMSupport',
])
elif llvm_version >= distutils.version.LooseVersion('2.7'):
# 2.7
env.Prepend(LIBS = [
'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMMCParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
'LLVMSelectionDAG', 'LLVMX86Info', 'LLVMAsmPrinter',
'LLVMCodeGen', 'LLVMScalarOpts', 'LLVMInstCombine',
'LLVMTransformUtils', 'LLVMipa', 'LLVMAsmParser',
'LLVMArchive', 'LLVMBitReader', 'LLVMAnalysis', 'LLVMTarget',
'LLVMMC', 'LLVMCore', 'LLVMSupport', 'LLVMSystem',
])
else:
# 2.6
env.Prepend(LIBS = [
'LLVMX86AsmParser', 'LLVMX86AsmPrinter', 'LLVMX86CodeGen',
'LLVMX86Info', 'LLVMLinker', 'LLVMipo', 'LLVMInterpreter',
'LLVMInstrumentation', 'LLVMJIT', 'LLVMExecutionEngine',
'LLVMDebugger', 'LLVMBitWriter', 'LLVMAsmParser',
'LLVMArchive', 'LLVMBitReader', 'LLVMSelectionDAG',
'LLVMAsmPrinter', 'LLVMCodeGen', 'LLVMScalarOpts',
'LLVMTransformUtils', 'LLVMipa', 'LLVMAnalysis',
'LLVMTarget', 'LLVMMC', 'LLVMCore', 'LLVMSupport',
'LLVMSystem',
])
env.Append(LIBS = [
'imagehlp',
'psapi',
@@ -180,6 +146,10 @@ def generate(env):
llvm_version = env.backtick('llvm-config --version').rstrip()
llvm_version = distutils.version.LooseVersion(llvm_version)
if llvm_version < distutils.version.LooseVersion(required_llvm_version):
print 'scons: LLVM version %s found, but %s is required' % (llvm_version, required_llvm_version)
return
try:
# Treat --cppflags specially to prevent NDEBUG from disabling
# assertion failures in debug builds.
@@ -195,15 +165,13 @@ def generate(env):
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')
components = ['engine', 'mcjit', 'bitwriter', 'x86asmprinter']
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
env.ParseConfig('llvm-config --ldflags')
if llvm_version >= distutils.version.LooseVersion('3.5'):
env.ParseConfig('llvm-config --system-libs')
env.Append(CXXFLAGS = ['-std=c++11'])
except OSError:
print 'scons: llvm-config version %s failed' % llvm_version
return

View File

@@ -19,12 +19,14 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = gtest loader mapi
SUBDIRS = gtest util mapi
if NEED_OPENGL_COMMON
SUBDIRS += glsl mesa
endif
SUBDIRS += loader
if HAVE_DRI_GLX
SUBDIRS += glx
endif
@@ -33,25 +35,20 @@ if HAVE_EGL_PLATFORM_WAYLAND
SUBDIRS += egl/wayland
endif
if HAVE_EGL_DRIVER_DRI2
SUBDIRS += egl/drivers/dri2
endif
if HAVE_GBM
SUBDIRS += gbm
endif
if HAVE_EGL
SUBDIRS += egl
SUBDIRS += egl/main
endif
if HAVE_GALLIUM
SUBDIRS += \
gallium/auxiliary \
gallium/drivers \
gallium/state_trackers \
gallium/winsys \
gallium/targets
SUBDIRS += gallium
endif
if HAVE_GALLIUM_TESTS
SUBDIRS += \
gallium/tests/trivial \
gallium/tests/unit
endif
endif
EXTRA_DIST = getopt

View File

@@ -4,6 +4,7 @@ Import('*')
if env['platform'] == 'windows':
SConscript('getopt/SConscript')
SConscript('util/SConscript')
SConscript('glsl/SConscript')
if env['hostonly']:

View File

@@ -40,8 +40,12 @@ LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/egl/main \
$(MESA_TOP)/src/loader \
$(TARGET_OUT_HEADERS)/libdrm \
$(DRM_GRALLOC_TOP)
LOCAL_STATIC_LIBRARIES := \
libmesa_loader
LOCAL_MODULE := libmesa_egl_dri2
include $(MESA_COMMON_MK)

View File

@@ -31,13 +31,12 @@ AM_CFLAGS = \
$(DEFINES) \
$(VISIBILITY_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(LIBUDEV_CFLAGS) \
$(LIBKMS_CFLAGS) \
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"
noinst_LTLIBRARIES = libegl_dri2.la
libegl_dri2_la_SOURCES = \
egl_dri2.h \
egl_dri2.c
libegl_dri2_la_LIBADD = \

View File

@@ -25,6 +25,8 @@
* Kristian Høgsberg <krh@bitplanet.net>
*/
#define WL_HIDE_DEPRECATED
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -33,7 +35,7 @@
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#ifdef HAVE_DRM_PLATFORM
#ifdef HAVE_LIBDRM
#include <xf86drm.h>
#include <drm_fourcc.h>
#endif
@@ -42,14 +44,15 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "egl_dri2.h"
#ifdef HAVE_WAYLAND_PLATFORM
#include "wayland-drm.h"
#include "wayland-drm-client-protocol.h"
#endif
#include "egl_dri2.h"
const __DRIuseInvalidateExtension use_invalidate = {
{ __DRI_USE_INVALIDATE, 1 }
.base = { __DRI_USE_INVALIDATE, 1 }
};
EGLint dri2_to_egl_attribute_map[] = {
@@ -296,11 +299,10 @@ dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
}
const __DRIimageLookupExtension image_lookup_extension = {
{ __DRI_IMAGE_LOOKUP, 1 },
dri2_lookup_egl_image
};
.base = { __DRI_IMAGE_LOOKUP, 1 },
static const char dri_driver_path[] = DEFAULT_DRIVER_DIR;
.lookupEGLImage = dri2_lookup_egl_image
};
struct dri2_extension_match {
const char *name;
@@ -356,7 +358,7 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
for (j = 0; matches[j].name; j++) {
field = ((char *) dri2_dpy + matches[j].offset);
if (*(const __DRIextension **) field == NULL) {
_eglLog(_EGL_FATAL, "DRI2: did not find extension %s version %d",
_eglLog(_EGL_WARNING, "DRI2: did not find extension %s version %d",
matches[j].name, matches[j].version);
ret = EGL_FALSE;
}
@@ -465,9 +467,7 @@ dri2_load_driver_swrast(_EGLDisplay *disp)
struct dri2_egl_display *dri2_dpy = disp->DriverData;
const __DRIextension **extensions;
dri2_dpy->driver_name = "swrast";
extensions = dri2_open_driver(disp);
if (!extensions)
return EGL_FALSE;
@@ -508,6 +508,7 @@ dri2_setup_screen(_EGLDisplay *disp)
assert(dri2_dpy->dri2 || dri2_dpy->swrast);
disp->Extensions.KHR_surfaceless_context = EGL_TRUE;
disp->Extensions.MESA_configless_context = EGL_TRUE;
if (dri2_dpy->dri2 && dri2_dpy->dri2->base.version >= 3) {
disp->Extensions.KHR_create_context = EGL_TRUE;
@@ -517,7 +518,15 @@ dri2_setup_screen(_EGLDisplay *disp)
}
if (dri2_dpy->image) {
disp->Extensions.MESA_drm_image = EGL_TRUE;
if (dri2_dpy->image->base.version >= 10 &&
dri2_dpy->image->getCapabilities != NULL) {
int capabilities;
capabilities = dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
disp->Extensions.MESA_drm_image = (capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
} else
disp->Extensions.MESA_drm_image = EGL_TRUE;
disp->Extensions.KHR_image_base = EGL_TRUE;
disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE;
if (dri2_dpy->image->base.version >= 5 &&
@@ -626,7 +635,6 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return dri2_initialize_x11(drv, disp);
#endif
#ifdef HAVE_LIBUDEV
#ifdef HAVE_DRM_PLATFORM
case _EGL_PLATFORM_DRM:
if (disp->Options.TestOnly)
@@ -639,7 +647,6 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
return EGL_TRUE;
return dri2_initialize_wayland(drv, disp);
#endif
#endif
#ifdef HAVE_ANDROID_PLATFORM
case _EGL_PLATFORM_ANDROID:
if (disp->Options.TestOnly)
@@ -670,24 +677,33 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
if (dri2_dpy->driver)
dlclose(dri2_dpy->driver);
free(dri2_dpy->device_name);
free(dri2_dpy->driver_name);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {
switch (disp->Platform) {
#ifdef HAVE_X11_PLATFORM
case _EGL_PLATFORM_X11:
case _EGL_PLATFORM_X11:
if (dri2_dpy->own_device) {
xcb_disconnect(dri2_dpy->conn);
break;
}
break;
#endif
#ifdef HAVE_DRM_PLATFORM
case _EGL_PLATFORM_DRM:
if (dri2_dpy->own_device) {
gbm_device_destroy(&dri2_dpy->gbm_dri->base.base);
}
break;
#endif
default:
break;
case _EGL_PLATFORM_DRM:
if (dri2_dpy->own_device) {
gbm_device_destroy(&dri2_dpy->gbm_dri->base.base);
}
break;
#endif
#ifdef HAVE_WAYLAND_PLATFORM
case _EGL_PLATFORM_WAYLAND:
wl_drm_destroy(dri2_dpy->wl_drm);
if (dri2_dpy->own_device) {
wl_display_disconnect(dri2_dpy->wl_dpy);
}
break;
#endif
default:
break;
}
free(dri2_dpy);
@@ -800,8 +816,9 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
api = __DRI_API_GLES3;
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
return NULL;
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
free(dri2_ctx);
return NULL;
}
break;
case EGL_OPENGL_API:
@@ -1012,6 +1029,97 @@ dri2_get_proc_address(_EGLDriver *drv, const char *procname)
return dri2_drv->get_proc_address(procname);
}
static _EGLSurface*
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->create_window_surface(drv, dpy, conf, native_window,
attrib_list);
}
static _EGLSurface*
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *conf, void *native_pixmap,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->create_pixmap_surface(drv, dpy, conf, native_pixmap,
attrib_list);
}
static _EGLSurface*
dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *conf, const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->create_pbuffer_surface(drv, dpy, conf, attrib_list);
}
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf);
}
static EGLBoolean
dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLint interval)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->swap_interval(drv, dpy, surf, interval);
}
static EGLBoolean
dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->swap_buffers(drv, dpy, surf);
}
static EGLBoolean
dri2_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
const EGLint *rects, EGLint n_rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->swap_buffers_with_damage(drv, dpy, surf,
rects, n_rects);
}
static EGLBoolean
dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLint numRects, const EGLint *rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->swap_buffers_region(drv, dpy, surf, numRects, rects);
}
static EGLBoolean
dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
EGLint x, EGLint y, EGLint width, EGLint height)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->post_sub_buffer(drv, dpy, surf, x, y, width, height);
}
static EGLBoolean
dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
void *native_pixmap_target)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->copy_buffers(drv, dpy, surf, native_pixmap_target);
}
static EGLint
dri2_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->query_buffer_age(drv, dpy, surf);
}
static EGLBoolean
dri2_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
{
@@ -1088,7 +1196,6 @@ static EGLBoolean
dri2_release_tex_image(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
{
#if __DRI_TEX_BUFFER_VERSION >= 3
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
struct dri2_egl_context *dri2_ctx;
@@ -1108,17 +1215,29 @@ dri2_release_tex_image(_EGLDriver *drv,
default:
assert(0);
}
if (dri2_dpy->tex_buffer->releaseTexBuffer!=NULL)
(*dri2_dpy->tex_buffer->releaseTexBuffer)(dri2_ctx->dri_context,
target,
dri2_surf->dri_drawable);
#endif
if (dri2_dpy->tex_buffer->base.version >= 3 &&
dri2_dpy->tex_buffer->releaseTexBuffer != NULL) {
(*dri2_dpy->tex_buffer->releaseTexBuffer)(dri2_ctx->dri_context,
target,
dri2_surf->dri_drawable);
}
return EGL_TRUE;
}
static _EGLImage*
dri2_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
EGLenum target, EGLClientBuffer buffer,
const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->create_image(drv, dpy, ctx, target, buffer,
attr_list);
}
static _EGLImage *
dri2_create_image(_EGLDisplay *disp, __DRIimage *dri_image)
dri2_create_image_from_dri(_EGLDisplay *disp, __DRIimage *dri_image)
{
struct dri2_egl_image *dri2_img;
@@ -1162,7 +1281,7 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context,
renderbuffer, NULL);
return dri2_create_image(disp, dri_image);
return dri2_create_image_from_dri(disp, dri_image);
}
#ifdef HAVE_DRM_PLATFORM
@@ -1208,7 +1327,7 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
pitch,
NULL);
return dri2_create_image(disp, dri_image);
return dri2_create_image_from_dri(disp, dri_image);
}
#endif
@@ -1271,10 +1390,19 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
return NULL;
}
return dri2_create_image(disp, dri_image);
return dri2_create_image_from_dri(disp, dri_image);
}
#endif
static EGLBoolean
dri2_get_sync_values_chromium(_EGLDisplay *dpy, _EGLSurface *surf,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->get_sync_values(dpy, surf, ust, msc, sbc);
}
/**
* Set the error code after a call to
* dri2_egl_image::dri_image::createImageFromTexture.
@@ -1384,6 +1512,14 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, _EGLContext *ctx,
return &dri2_img->base;
}
static struct wl_buffer*
dri2_create_wayland_buffer_from_image(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLImage *img)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->create_wayland_buffer_from_image(drv, dpy, img);
}
#ifdef HAVE_DRM_PLATFORM
static EGLBoolean
dri2_check_dma_buf_attribs(const _EGLImageAttribs *attrs)
@@ -1542,36 +1678,13 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
/**
* 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."
* "If eglCreateImageKHR is successful for a EGL_LINUX_DMA_BUF_EXT target, the
* EGL will take a reference to the dma_buf(s) which it will release at any
* time while the EGLDisplay is initialized. It is the responsibility of the
* application to close the dma_buf file descriptors."
*
* Therefore we must never close or otherwise modify the file descriptors.
*/
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)
@@ -1633,9 +1746,7 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
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);
res = dri2_create_image_from_dri(disp, dri_image);
return res;
}
@@ -1870,7 +1981,7 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_display *wl_dpy)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret, flags = 0;
int flags = 0;
uint64_t cap;
(void) drv;
@@ -1879,13 +1990,15 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
return EGL_FALSE;
wl_drm_callbacks.authenticate =
(int(*)(void *, uint32_t)) dri2_dpy->authenticate;
(int(*)(void *, uint32_t)) dri2_dpy->vtbl->authenticate;
ret = drmGetCap(dri2_dpy->fd, DRM_CAP_PRIME, &cap);
if (ret == 0 && cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT) &&
#ifdef HAVE_LIBDRM
if (drmGetCap(dri2_dpy->fd, DRM_CAP_PRIME, &cap) == 0 &&
cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT) &&
dri2_dpy->image->base.version >= 7 &&
dri2_dpy->image->createImageFromFds != NULL)
flags |= WAYLAND_DRM_PRIME;
#endif
dri2_dpy->wl_server_drm =
wayland_drm_init(wl_dpy, dri2_dpy->device_name,
@@ -1894,10 +2007,12 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (!dri2_dpy->wl_server_drm)
return EGL_FALSE;
#ifdef HAVE_DRM_PLATFORM
/* 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;
#endif
return EGL_TRUE;
}
@@ -2030,13 +2145,25 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.CreateContext = dri2_create_context;
dri2_drv->base.API.DestroyContext = dri2_destroy_context;
dri2_drv->base.API.MakeCurrent = dri2_make_current;
dri2_drv->base.API.CreateWindowSurface = dri2_create_window_surface;
dri2_drv->base.API.CreatePixmapSurface = dri2_create_pixmap_surface;
dri2_drv->base.API.CreatePbufferSurface = dri2_create_pbuffer_surface;
dri2_drv->base.API.DestroySurface = dri2_destroy_surface;
dri2_drv->base.API.GetProcAddress = dri2_get_proc_address;
dri2_drv->base.API.WaitClient = dri2_wait_client;
dri2_drv->base.API.WaitNative = dri2_wait_native;
dri2_drv->base.API.BindTexImage = dri2_bind_tex_image;
dri2_drv->base.API.ReleaseTexImage = dri2_release_tex_image;
dri2_drv->base.API.CreateImageKHR = dri2_create_image_khr;
dri2_drv->base.API.SwapInterval = dri2_swap_interval;
dri2_drv->base.API.SwapBuffers = dri2_swap_buffers;
dri2_drv->base.API.SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage;
dri2_drv->base.API.SwapBuffersRegionNOK = dri2_swap_buffers_region;
dri2_drv->base.API.PostSubBufferNV = dri2_post_sub_buffer;
dri2_drv->base.API.CopyBuffers = dri2_copy_buffers,
dri2_drv->base.API.QueryBufferAge = dri2_query_buffer_age;
dri2_drv->base.API.CreateImageKHR = dri2_create_image;
dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr;
dri2_drv->base.API.CreateWaylandBufferFromImageWL = dri2_create_wayland_buffer_from_image;
#ifdef HAVE_DRM_PLATFORM
dri2_drv->base.API.CreateDRMImageMESA = dri2_create_drm_image_mesa;
dri2_drv->base.API.ExportDRMImageMESA = dri2_export_drm_image_mesa;
@@ -2046,6 +2173,7 @@ _eglBuiltInDriverDRI2(const char *args)
dri2_drv->base.API.UnbindWaylandDisplayWL = dri2_unbind_wayland_display_wl;
dri2_drv->base.API.QueryWaylandBufferWL = dri2_query_wayland_buffer_wl;
#endif
dri2_drv->base.API.GetSyncValuesCHROMIUM = dri2_get_sync_values_chromium;
dri2_drv->base.Name = "DRI2";
dri2_drv->base.Unload = dri2_unload;

View File

@@ -75,6 +75,8 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
struct wl_buffer;
struct dri2_egl_driver
{
_EGLDriver base;
@@ -84,22 +86,82 @@ struct dri2_egl_driver
void (*glFlush)(void);
};
struct dri2_egl_display_vtbl {
int (*authenticate)(_EGLDisplay *disp, uint32_t id);
_EGLSurface* (*create_window_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
void *native_window,
const EGLint *attrib_list);
_EGLSurface* (*create_pixmap_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
void *native_pixmap,
const EGLint *attrib_list);
_EGLSurface* (*create_pbuffer_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLConfig *config,
const EGLint *attrib_list);
EGLBoolean (*destroy_surface)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surface);
EGLBoolean (*swap_interval)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf, EGLint interval);
_EGLImage* (*create_image)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer,
const EGLint *attr_list);
EGLBoolean (*swap_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf);
EGLBoolean (*swap_buffers_with_damage)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surface,
const EGLint *rects, EGLint n_rects);
EGLBoolean (*swap_buffers_region)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf, EGLint numRects,
const EGLint *rects);
EGLBoolean (*post_sub_buffer)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
EGLint x, EGLint y,
EGLint width, EGLint height);
EGLBoolean (*copy_buffers)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf, void *native_pixmap_target);
EGLint (*query_buffer_age)(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf);
struct wl_buffer* (*create_wayland_buffer_from_image)(
_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img);
EGLBoolean (*get_sync_values)(_EGLDisplay *display, _EGLSurface *surface,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc);
};
struct dri2_egl_display
{
const struct dri2_egl_display_vtbl *vtbl;
int dri2_major;
int dri2_minor;
__DRIscreen *dri_screen;
int own_dri_screen;
const __DRIconfig **driver_configs;
void *driver;
__DRIcoreExtension *core;
__DRIdri2Extension *dri2;
__DRIswrastExtension *swrast;
__DRI2flushExtension *flush;
__DRItexBufferExtension *tex_buffer;
__DRIimageExtension *image;
__DRIrobustnessExtension *robustness;
__DRI2configQueryExtension *config;
const __DRIcoreExtension *core;
const __DRIdri2Extension *dri2;
const __DRIswrastExtension *swrast;
const __DRI2flushExtension *flush;
const __DRItexBufferExtension *tex_buffer;
const __DRIimageExtension *image;
const __DRIrobustnessExtension *robustness;
const __DRI2configQueryExtension *config;
int fd;
int own_device;
@@ -134,8 +196,6 @@ struct dri2_egl_display
int formats;
uint32_t capabilities;
#endif
int (*authenticate) (_EGLDisplay *disp, uint32_t id);
};
struct dri2_egl_context

View File

@@ -0,0 +1,108 @@
/*
* Copyright 2014 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "egltypedefs.h"
struct wl_buffer;
static inline _EGLSurface *
dri2_fallback_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf,
void *native_pixmap,
const EGLint *attrib_list)
{
return NULL;
}
static inline _EGLSurface *
dri2_fallback_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf,
const EGLint *attrib_list)
{
return NULL;
}
static inline EGLBoolean
dri2_fallback_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf, EGLint interval)
{
return EGL_FALSE;
}
static inline EGLBoolean
dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
const EGLint *rects, EGLint n_rects)
{
return EGL_FALSE;
}
static inline EGLBoolean
dri2_fallback_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
EGLint numRects, const EGLint *rects)
{
return EGL_FALSE;
}
static inline EGLBoolean
dri2_fallback_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *draw,
EGLint x, EGLint y, EGLint width, EGLint height)
{
return EGL_FALSE;
}
static inline EGLBoolean
dri2_fallback_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
void *native_pixmap_target)
{
return EGL_FALSE;
}
static inline EGLint
dri2_fallback_query_buffer_age(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf)
{
return 0;
}
static inline struct wl_buffer*
dri2_fallback_create_wayland_buffer_from_image(_EGLDriver *drv,
_EGLDisplay *dpy,
_EGLImage *img)
{
return NULL;
}
static inline EGLBoolean
dri2_fallback_get_sync_values(_EGLDisplay *dpy, _EGLSurface *surf,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
return EGL_FALSE;
}

View File

@@ -36,6 +36,7 @@
#include "loader.h"
#include "egl_dri2.h"
#include "egl_dri2_fallbacks.h"
#include "gralloc_drm.h"
static int
@@ -53,8 +54,6 @@ get_format_bpp(int native)
bpp = 3;
break;
case HAL_PIXEL_FORMAT_RGB_565:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
bpp = 2;
break;
default:
@@ -193,12 +192,14 @@ droid_free_local_buffers(struct dri2_egl_surface *dri2_surf)
static _EGLSurface *
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
struct ANativeWindow *window = native_window;
dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "droid_create_surface");
@@ -253,19 +254,11 @@ cleanup_surface:
static _EGLSurface *
droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
return droid_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
}
static _EGLSurface *
droid_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
{
return NULL;
native_window, attrib_list);
}
static _EGLSurface *
@@ -376,8 +369,6 @@ dri2_create_image_android_native_buffer(_EGLDisplay *disp, _EGLContext *ctx,
format = __DRI_IMAGE_FORMAT_XBGR8888;
break;
case HAL_PIXEL_FORMAT_RGB_888:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
/* unsupported */
default:
_eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", buf->format);
@@ -427,18 +418,6 @@ droid_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
}
}
static void
droid_init_driver_functions(_EGLDriver *drv)
{
drv->API.CreateWindowSurface = droid_create_window_surface;
drv->API.CreatePixmapSurface = droid_create_pixmap_surface;
drv->API.CreatePbufferSurface = droid_create_pbuffer_surface;
drv->API.DestroySurface = droid_destroy_surface;
drv->API.SwapBuffers = droid_swap_buffers;
drv->API.CreateImageKHR = droid_create_image_khr;
}
static void
droid_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
@@ -652,6 +631,24 @@ droid_log(EGLint level, const char *msg)
}
}
static struct dri2_egl_display_vtbl droid_display_vtbl = {
.authenticate = NULL,
.create_window_surface = droid_create_window_surface,
.create_pixmap_surface = dri2_fallback_create_pixmap_surface,
.create_pbuffer_surface = droid_create_pbuffer_surface,
.destroy_surface = droid_destroy_surface,
.create_image = droid_create_image_khr,
.swap_interval = dri2_fallback_swap_interval,
.swap_buffers = droid_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
EGLBoolean
dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
{
@@ -682,7 +679,7 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
if (!dri2_load_driver(dpy)) {
err = "DRI2: failed to load driver";
goto cleanup_device;
goto cleanup_driver_name;
}
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
@@ -714,7 +711,10 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
dpy->VersionMajor = 1;
dpy->VersionMinor = 4;
droid_init_driver_functions(drv);
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.
*/
dri2_dpy->vtbl = &droid_display_vtbl;
return EGL_TRUE;
@@ -722,6 +722,8 @@ cleanup_screen:
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_driver_name:
free(dri2_dpy->driver_name);
cleanup_device:
close(dri2_dpy->fd);
cleanup_display:

View File

@@ -36,6 +36,7 @@
#include <unistd.h>
#include "egl_dri2.h"
#include "egl_dri2_fallbacks.h"
#include "loader.h"
static struct gbm_bo *
@@ -43,6 +44,7 @@ lock_front_buffer(struct gbm_surface *_surf)
{
struct gbm_dri_surface *surf = (struct gbm_dri_surface *) _surf;
struct dri2_egl_surface *dri2_surf = surf->dri_private;
struct gbm_dri_device *device = (struct gbm_dri_device *) _surf->gbm;
struct gbm_bo *bo;
if (dri2_surf->current == NULL) {
@@ -51,8 +53,11 @@ lock_front_buffer(struct gbm_surface *_surf)
}
bo = dri2_surf->current->bo;
dri2_surf->current->locked = 1;
dri2_surf->current = NULL;
if (device->dri2) {
dri2_surf->current->locked = 1;
dri2_surf->current = NULL;
}
return bo;
}
@@ -86,13 +91,14 @@ has_free_buffers(struct gbm_surface *_surf)
}
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct dri2_egl_surface *dri2_surf;
struct gbm_surface *window = native_window;
struct gbm_dri_surface *surf;
(void) drv;
@@ -110,7 +116,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
case EGL_WINDOW_BIT:
if (!window)
return NULL;
surf = gbm_dri_surface((struct gbm_surface *) window);
surf = gbm_dri_surface(window);
dri2_surf->gbm_surf = surf;
dri2_surf->base.Width = surf->base.width;
dri2_surf->base.Height = surf->base.height;
@@ -120,13 +126,22 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
goto cleanup_surf;
}
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
if (dri2_dpy->dri2) {
dri2_surf->dri_drawable =
(*dri2_dpy->dri2->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
} else {
assert(dri2_dpy->swrast != NULL);
dri2_surf->dri_drawable =
(*dri2_dpy->swrast->createNewDrawable) (dri2_dpy->dri_screen,
dri2_conf->dri_double_config,
dri2_surf->gbm_surf);
}
if (dri2_surf->dri_drawable == NULL) {
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
_eglError(EGL_BAD_ALLOC, "createNewDrawable()");
goto cleanup_surf;
}
@@ -139,16 +154,31 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
}
static _EGLSurface *
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
dri2_drm_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
return dri2_drm_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
native_window, attrib_list);
}
static _EGLSurface *
dri2_drm_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
/* From the EGL_MESA_platform_gbm spec, version 5:
*
* It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
* that belongs to the GBM platform. Any such call fails and generates
* EGL_BAD_PARAMETER.
*/
_eglError(EGL_BAD_PARAMETER, "cannot create EGL pixmap surfaces on GBM");
return NULL;
}
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_drm_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
@@ -204,6 +234,28 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
return 0;
}
static int
get_swrast_front_bo(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
struct gbm_dri_surface *surf = dri2_surf->gbm_surf;
if (dri2_surf->current == NULL) {
assert(!dri2_surf->color_buffers[0].locked);
dri2_surf->current = &dri2_surf->color_buffers[0];
}
if (dri2_surf->current->bo == NULL)
dri2_surf->current->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base.base,
surf->base.width, surf->base.height,
surf->base.format, surf->base.flags);
if (dri2_surf->current->bo == NULL)
return -1;
return 0;
}
static void
back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
{
@@ -248,7 +300,7 @@ get_aux_bo(struct dri2_egl_surface *dri2_surf,
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
dri2_drm_get_buffers_with_format(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
@@ -290,10 +342,10 @@ dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
}
static __DRIbuffer *
dri2_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
dri2_drm_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
@@ -312,10 +364,10 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
}
buffer =
dri2_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
dri2_drm_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
free(attachments_with_format);
@@ -323,12 +375,12 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
}
static int
dri_image_get_buffers(__DRIdrawable *driDrawable,
unsigned int format,
uint32_t *stamp,
void *loaderPrivate,
uint32_t buffer_mask,
struct __DRIimageList *buffers)
dri2_drm_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;
@@ -344,39 +396,43 @@ dri_image_get_buffers(__DRIdrawable *driDrawable,
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
dri2_drm_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
(void) loaderPrivate;
}
static EGLBoolean
dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
int i;
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
if (dri2_surf->current)
_eglError(EGL_BAD_SURFACE, "dri2_swap_buffers");
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
dri2_surf->current = dri2_surf->back;
dri2_surf->current->age = 1;
dri2_surf->back = NULL;
}
if (dri2_dpy->swrast) {
(*dri2_dpy->core->swapBuffers)(dri2_surf->dri_drawable);
} else {
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
if (dri2_surf->current)
_eglError(EGL_BAD_SURFACE, "dri2_swap_buffers");
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++)
if (dri2_surf->color_buffers[i].age > 0)
dri2_surf->color_buffers[i].age++;
dri2_surf->current = dri2_surf->back;
dri2_surf->current->age = 1;
dri2_surf->back = NULL;
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
}
return EGL_TRUE;
}
static EGLint
dri2_query_buffer_age(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
dri2_drm_query_buffer_age(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
@@ -389,8 +445,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
}
static _EGLImage *
dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
dri2_drm_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
EGLClientBuffer buffer, const EGLint *attr_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct gbm_dri_bo *dri_bo = gbm_dri_bo((struct gbm_bo *) buffer);
@@ -426,7 +482,7 @@ dri2_drm_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
switch (target) {
case EGL_NATIVE_PIXMAP_KHR:
return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
return dri2_drm_create_image_khr_pixmap(disp, ctx, buffer, attr_list);
default:
return dri2_create_image_khr(drv, disp, ctx, target, buffer, attr_list);
}
@@ -440,6 +496,91 @@ dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
return drmAuthMagic(dri2_dpy->fd, id);
}
static void
swrast_put_image2(__DRIdrawable *driDrawable,
int op,
int x,
int y,
int width,
int height,
int stride,
char *data,
void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int internal_stride, i;
struct gbm_dri_bo *bo;
if (op != __DRI_SWRAST_IMAGE_OP_DRAW &&
op != __DRI_SWRAST_IMAGE_OP_SWAP)
return;
if (get_swrast_front_bo(dri2_surf) < 0)
return;
bo = gbm_dri_bo(dri2_surf->current->bo);
if (gbm_dri_bo_map(bo) == NULL)
return;
internal_stride = bo->base.base.stride;
for (i = 0; i < height; i++) {
memcpy(bo->map + (x + i) * internal_stride + y,
data + i * stride, stride);
}
gbm_dri_bo_unmap(bo);
}
static void
swrast_get_image(__DRIdrawable *driDrawable,
int x,
int y,
int width,
int height,
char *data,
void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
int internal_stride, stride, i;
struct gbm_dri_bo *bo;
if (get_swrast_front_bo(dri2_surf) < 0)
return;
bo = gbm_dri_bo(dri2_surf->current->bo);
if (gbm_dri_bo_map(bo) == NULL)
return;
internal_stride = bo->base.base.stride;
stride = width * 4;
for (i = 0; i < height; i++) {
memcpy(data + i * stride,
bo->map + (x + i) * internal_stride + y, stride);
}
gbm_dri_bo_unmap(bo);
}
static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
.authenticate = dri2_drm_authenticate,
.create_window_surface = dri2_drm_create_window_surface,
.create_pixmap_surface = dri2_drm_create_pixmap_surface,
.create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
.destroy_surface = dri2_drm_destroy_surface,
.create_image = dri2_drm_create_image_khr,
.swap_interval = dri2_fallback_swap_interval,
.swap_buffers = dri2_drm_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_drm_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
EGLBoolean
dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
{
@@ -458,7 +599,12 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
gbm = disp->PlatformDisplay;
if (gbm == NULL) {
fd = open("/dev/dri/card0", O_RDWR);
char buf[64];
int n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, 0);
if (n != -1 && n < sizeof(buf))
fd = open(buf, O_RDWR);
if (fd < 0)
fd = open("/dev/dri/card0", O_RDWR);
dri2_dpy->own_device = 1;
gbm = gbm_create_device(fd);
if (gbm == NULL)
@@ -486,22 +632,25 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->fd = fd;
dri2_dpy->device_name = loader_get_device_name_for_fd(dri2_dpy->fd);
dri2_dpy->driver_name = dri2_dpy->gbm_dri->base.driver_name;
dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->base.driver_name);
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;
dri2_dpy->dri2 = dri2_dpy->gbm_dri->dri2;
dri2_dpy->image = dri2_dpy->gbm_dri->image;
dri2_dpy->flush = dri2_dpy->gbm_dri->flush;
dri2_dpy->swrast = dri2_dpy->gbm_dri->swrast;
dri2_dpy->driver_configs = dri2_dpy->gbm_dri->driver_configs;
dri2_dpy->gbm_dri->lookup_image = dri2_lookup_egl_image;
dri2_dpy->gbm_dri->lookup_user_data = 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->get_buffers = dri2_drm_get_buffers;
dri2_dpy->gbm_dri->flush_front_buffer = dri2_drm_flush_front_buffer;
dri2_dpy->gbm_dri->get_buffers_with_format = dri2_drm_get_buffers_with_format;
dri2_dpy->gbm_dri->image_get_buffers = dri2_drm_image_get_buffers;
dri2_dpy->gbm_dri->swrast_put_image2 = swrast_put_image2;
dri2_dpy->gbm_dri->swrast_get_image = swrast_get_image;
dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
@@ -532,22 +681,33 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
i + 1, EGL_WINDOW_BIT, attr_list, NULL);
}
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
drv->API.QueryBufferAge = dri2_query_buffer_age;
disp->Extensions.EXT_buffer_age = EGL_TRUE;
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
if (dri2_dpy->dri2)
disp->Extensions.EXT_buffer_age = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
if (dri2_dpy->image) {
if (dri2_dpy->image->base.version >= 10 &&
dri2_dpy->image->getCapabilities != NULL) {
int capabilities;
capabilities =
dri2_dpy->image->getCapabilities(dri2_dpy->dri_screen);
disp->Extensions.WL_bind_wayland_display =
(capabilities & __DRI_IMAGE_CAP_GLOBAL_NAMES) != 0;
} else
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
}
#endif
dri2_dpy->authenticate = dri2_drm_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.
*/
dri2_dpy->vtbl = &dri2_drm_display_vtbl;
return EGL_TRUE;
}

View File

@@ -36,6 +36,7 @@
#include <xf86drm.h>
#include "egl_dri2.h"
#include "egl_dri2_fallbacks.h"
#include "loader.h"
#include <wayland-client.h>
@@ -47,6 +48,10 @@ enum wl_drm_format_flags {
HAS_RGB565 = 4,
};
static EGLBoolean
dri2_wl_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval);
static void
sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
{
@@ -114,12 +119,13 @@ resize_callback(struct wl_egl_window *wl_win, void *data)
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
struct wl_egl_window *window = native_window;
struct dri2_egl_surface *dri2_surf;
(void) drv;
@@ -143,7 +149,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
switch (type) {
case EGL_WINDOW_BIT:
dri2_surf->wl_win = (struct wl_egl_window *) window;
dri2_surf->wl_win = window;
dri2_surf->wl_win->private = dri2_surf;
dri2_surf->wl_win->resize_callback = resize_callback;
@@ -180,27 +186,43 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
surf = dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
surf = dri2_wl_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
native_window, attrib_list);
if (surf != NULL)
drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
dri2_wl_swap_interval(drv, disp, surf, dri2_dpy->default_swap_interval);
return surf;
}
static _EGLSurface *
dri2_wl_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
/* From the EGL_EXT_platform_wayland spec, version 3:
*
* It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
* that belongs to Wayland. Any such call fails and generates
* EGL_BAD_PARAMETER.
*/
_eglError(EGL_BAD_PARAMETER, "cannot create EGL pixmap surfaces on "
"Wayland");
return NULL;
}
/**
* Called via eglDestroySurface(), drv->API.DestroySurface().
*/
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
@@ -240,7 +262,7 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
}
static void
dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
dri2_wl_release_buffers(struct dri2_egl_surface *dri2_surf)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
@@ -369,7 +391,7 @@ update_buffers(struct dri2_egl_surface *dri2_surf)
(dri2_surf->base.Width != dri2_surf->wl_win->width ||
dri2_surf->base.Height != dri2_surf->wl_win->height)) {
dri2_release_buffers(dri2_surf);
dri2_wl_release_buffers(dri2_surf);
dri2_surf->base.Width = dri2_surf->wl_win->width;
dri2_surf->base.Height = dri2_surf->wl_win->height;
@@ -399,10 +421,10 @@ update_buffers(struct dri2_egl_surface *dri2_surf)
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
dri2_wl_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;
@@ -436,10 +458,10 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
}
static __DRIbuffer *
dri2_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
dri2_wl_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
unsigned int *attachments_with_format;
__DRIbuffer *buffer;
@@ -458,10 +480,10 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
}
buffer =
dri2_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
dri2_wl_get_buffers_with_format(driDrawable,
width, height,
attachments_with_format, count,
out_count, loaderPrivate);
free(attachments_with_format);
@@ -488,16 +510,17 @@ image_get_buffers(__DRIdrawable *driDrawable,
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
dri2_wl_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
(void) loaderPrivate;
}
static const __DRIimageLoaderExtension image_loader_extension = {
{ __DRI_IMAGE_LOADER, 1 },
image_get_buffers,
dri2_flush_front_buffer
.base = { __DRI_IMAGE_LOADER, 1 },
.getBuffers = image_get_buffers,
.flushFrontBuffer = dri2_wl_flush_front_buffer,
};
static void
@@ -566,11 +589,11 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
* Called via eglSwapBuffers(), drv->API.SwapBuffers().
*/
static EGLBoolean
dri2_swap_buffers_with_damage(_EGLDriver *drv,
_EGLDisplay *disp,
_EGLSurface *draw,
const EGLint *rects,
EGLint n_rects)
dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
_EGLDisplay *disp,
_EGLSurface *draw,
const EGLint *rects,
EGLint n_rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
@@ -660,8 +683,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
}
static EGLint
dri2_query_buffer_age(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
dri2_wl_query_buffer_age(_EGLDriver *drv,
_EGLDisplay *disp, _EGLSurface *surface)
{
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
@@ -674,15 +697,15 @@ dri2_query_buffer_age(_EGLDriver *drv,
}
static EGLBoolean
dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
dri2_wl_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
return dri2_swap_buffers_with_damage (drv, disp, draw, NULL, 0);
return dri2_wl_swap_buffers_with_damage (drv, disp, draw, NULL, 0);
}
static struct wl_buffer *
dri2_create_wayland_buffer_from_image_wl(_EGLDriver *drv,
_EGLDisplay *disp,
_EGLImage *img)
dri2_wl_create_wayland_buffer_from_image(_EGLDriver *drv,
_EGLDisplay *disp,
_EGLImage *img)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_image *dri2_img = dri2_egl_image(img);
@@ -755,7 +778,7 @@ bad_format:
}
static int
dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
dri2_wl_authenticate(_EGLDisplay *disp, uint32_t id)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
int ret = 0;
@@ -775,31 +798,6 @@ dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
return ret;
}
/**
* Called via eglTerminate(), drv->API.Terminate().
*/
static EGLBoolean
dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
close(dri2_dpy->fd);
dlclose(dri2_dpy->driver);
free(dri2_dpy->driver_name);
free(dri2_dpy->device_name);
wl_drm_destroy(dri2_dpy->wl_drm);
if (dri2_dpy->own_device)
wl_display_disconnect(dri2_dpy->wl_dpy);
free(dri2_dpy);
disp->DriverData = NULL;
return EGL_TRUE;
}
static void
drm_handle_device(void *data, struct wl_drm *drm, const char *device)
{
@@ -898,7 +896,7 @@ static const struct wl_registry_listener registry_listener = {
};
static EGLBoolean
dri2_swap_interval(_EGLDriver *drv,
dri2_wl_swap_interval(_EGLDriver *drv,
_EGLDisplay *disp,
_EGLSurface *surf,
EGLint interval)
@@ -914,7 +912,7 @@ dri2_swap_interval(_EGLDriver *drv,
}
static void
dri2_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
dri2_wl_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
{
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
@@ -951,6 +949,24 @@ dri2_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
}
}
static struct dri2_egl_display_vtbl dri2_wl_display_vtbl = {
.authenticate = dri2_wl_authenticate,
.create_window_surface = dri2_wl_create_window_surface,
.create_pixmap_surface = dri2_wl_create_pixmap_surface,
.create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
.destroy_surface = dri2_wl_destroy_surface,
.create_image = dri2_create_image_khr,
.swap_interval = dri2_wl_swap_interval,
.swap_buffers = dri2_wl_swap_buffers,
.swap_buffers_with_damage = dri2_wl_swap_buffers_with_damage,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_fallback_copy_buffers,
.query_buffer_age = dri2_wl_query_buffer_age,
.create_wayland_buffer_from_image = dri2_wl_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
EGLBoolean
dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
{
@@ -965,17 +981,6 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
loader_set_logger(_eglLog);
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage;
drv->API.SwapInterval = dri2_swap_interval;
drv->API.Terminate = dri2_terminate;
drv->API.QueryBufferAge = dri2_query_buffer_age;
drv->API.CreateWaylandBufferFromImageWL =
dri2_create_wayland_buffer_from_image_wl;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
@@ -1020,10 +1025,10 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_wl_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_wl_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
dri2_get_buffers_with_format;
dri2_wl_get_buffers_with_format;
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
dri2_dpy->extensions[1] = &image_loader_extension.base;
@@ -1036,7 +1041,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup_driver;
dri2_setup_swap_interval(dri2_dpy);
dri2_wl_setup_swap_interval(dri2_dpy);
/* The server shouldn't advertise WL_DRM_CAPABILITY_PRIME if the driver
* doesn't have createImageFromFds, since we're using the same driver on
@@ -1045,7 +1050,7 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
if (dri2_dpy->image->base.version < 7 ||
dri2_dpy->image->createImageFromFds == NULL)
dri2_dpy->capabilities &= WL_DRM_CAPABILITY_PRIME;
dri2_dpy->capabilities &= ~WL_DRM_CAPABILITY_PRIME;
types = EGL_WINDOW_BIT;
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
@@ -1061,7 +1066,6 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
disp->Extensions.WL_create_wayland_buffer_from_image = EGL_TRUE;
disp->Extensions.EXT_buffer_age = EGL_TRUE;
dri2_dpy->authenticate = dri2_wayland_authenticate;
disp->Extensions.EXT_swap_buffers_with_damage = EGL_TRUE;
@@ -1069,6 +1073,11 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp)
disp->VersionMajor = 1;
disp->VersionMinor = 4;
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.
*/
dri2_dpy->vtbl = &dri2_wl_display_vtbl;
return EGL_TRUE;
cleanup_driver:

View File

@@ -25,6 +25,7 @@
* Kristian Høgsberg <krh@bitplanet.net>
*/
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -40,6 +41,11 @@
#include <sys/stat.h>
#include "egl_dri2.h"
#include "egl_dri2_fallbacks.h"
static EGLBoolean
dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval);
static void
swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
@@ -176,9 +182,9 @@ swrastGetImage(__DRIdrawable * read,
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, EGLNativeWindowType native_window,
const EGLint *attrib_list)
dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
_EGLConfig *conf, void *native_surface,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_config *dri2_conf = dri2_egl_config(conf);
@@ -187,7 +193,10 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
xcb_get_geometry_reply_t *reply;
xcb_screen_iterator_t s;
xcb_generic_error_t *error;
xcb_drawable_t window = (uintptr_t )native_window;
xcb_drawable_t drawable;
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_surface));
drawable = (uintptr_t) native_surface;
(void) drv;
@@ -208,7 +217,7 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
dri2_surf->drawable, s.data->root,
dri2_surf->base.Width, dri2_surf->base.Height);
} else {
dri2_surf->drawable = window;
dri2_surf->drawable = drawable;
}
if (dri2_dpy->dri2) {
@@ -271,15 +280,15 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
static _EGLSurface *
dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativeWindowType window,
const EGLint *attrib_list)
dri2_x11_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_window,
const EGLint *attrib_list)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
_EGLSurface *surf;
surf = dri2_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
window, attrib_list);
surf = dri2_x11_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
native_window, attrib_list);
if (surf != NULL) {
/* When we first create the DRI2 drawable, its swap interval on the
* server side is 1.
@@ -287,31 +296,31 @@ dri2_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
surf->SwapInterval = 1;
/* Override that with a driconf-set value. */
drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
dri2_x11_swap_interval(drv, disp, surf, dri2_dpy->default_swap_interval);
}
return surf;
}
static _EGLSurface *
dri2_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, EGLNativePixmapType pixmap,
const EGLint *attrib_list)
dri2_x11_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, void *native_pixmap,
const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
pixmap, attrib_list);
return dri2_x11_create_surface(drv, disp, EGL_PIXMAP_BIT, conf,
native_pixmap, attrib_list);
}
static _EGLSurface *
dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
dri2_x11_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
_EGLConfig *conf, const EGLint *attrib_list)
{
return dri2_create_surface(drv, disp, EGL_PBUFFER_BIT, conf,
XCB_WINDOW_NONE, attrib_list);
return dri2_x11_create_surface(drv, disp, EGL_PBUFFER_BIT, conf,
XCB_WINDOW_NONE, attrib_list);
}
static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
dri2_x11_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
@@ -345,8 +354,8 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
* \c DRI2GetBuffers or \c DRI2GetBuffersWithFormat.
*/
static void
dri2_process_buffers(struct dri2_egl_surface *dri2_surf,
xcb_dri2_dri2_buffer_t *buffers, unsigned count)
dri2_x11_process_buffers(struct dri2_egl_surface *dri2_surf,
xcb_dri2_dri2_buffer_t *buffers, unsigned count)
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
@@ -386,10 +395,10 @@ dri2_process_buffers(struct dri2_egl_surface *dri2_surf,
}
static __DRIbuffer *
dri2_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
dri2_x11_get_buffers(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
{
struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
@@ -411,7 +420,7 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
*out_count = reply->count;
dri2_surf->base.Width = *width = reply->width;
dri2_surf->base.Height = *height = reply->height;
dri2_process_buffers(dri2_surf, buffers, *out_count);
dri2_x11_process_buffers(dri2_surf, buffers, *out_count);
free(reply);
@@ -419,10 +428,10 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
}
static __DRIbuffer *
dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate)
dri2_x11_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;
struct dri2_egl_display *dri2_dpy =
@@ -449,7 +458,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
dri2_surf->base.Width = *width = reply->width;
dri2_surf->base.Height = *height = reply->height;
*out_count = reply->count;
dri2_process_buffers(dri2_surf, buffers, *out_count);
dri2_x11_process_buffers(dri2_surf, buffers, *out_count);
free(reply);
@@ -457,7 +466,7 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
}
static void
dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
dri2_x11_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
{
(void) driDrawable;
@@ -472,23 +481,8 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
#endif
}
static char *
dri2_strndup(const char *s, int length)
{
char *d;
d = malloc(length + 1);
if (d == NULL)
return NULL;
memcpy(d, s, length);
d[length] = '\0';
return d;
}
static EGLBoolean
dri2_connect(struct dri2_egl_display *dri2_dpy)
dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
{
xcb_xfixes_query_version_reply_t *xfixes_query;
xcb_xfixes_query_version_cookie_t xfixes_query_cookie;
@@ -556,14 +550,14 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
driver_name = xcb_dri2_connect_driver_name (connect);
dri2_dpy->driver_name =
dri2_strndup(driver_name,
xcb_dri2_connect_driver_name_length (connect));
strndup(driver_name,
xcb_dri2_connect_driver_name_length(connect));
device_name = xcb_dri2_connect_device_name (connect);
dri2_dpy->device_name =
dri2_strndup(device_name,
xcb_dri2_connect_device_name_length (connect));
strndup(device_name,
xcb_dri2_connect_device_name_length(connect));
if (dri2_dpy->device_name == NULL || dri2_dpy->driver_name == NULL) {
free(dri2_dpy->device_name);
@@ -600,7 +594,7 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
}
static EGLBoolean
dri2_authenticate(_EGLDisplay *disp)
dri2_x11_local_authenticate(_EGLDisplay *disp)
{
#ifdef HAVE_LIBDRM
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
@@ -620,8 +614,8 @@ dri2_authenticate(_EGLDisplay *disp)
}
static EGLBoolean
dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
_EGLDisplay *disp)
dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
_EGLDisplay *disp)
{
xcb_screen_iterator_t s;
xcb_depth_iterator_t d;
@@ -724,8 +718,8 @@ dri2_copy_region(_EGLDriver *drv, _EGLDisplay *disp,
}
static int64_t
dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
int64_t msc, int64_t divisor, int64_t remainder)
dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
int64_t msc, int64_t divisor, int64_t remainder)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
@@ -777,13 +771,13 @@ dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
}
static EGLBoolean
dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
dri2_x11_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
if (dri2_dpy->dri2) {
return dri2_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1;
return dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1;
} else {
assert(dri2_dpy->swrast);
@@ -793,8 +787,9 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
}
static EGLBoolean
dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
EGLint numRects, const EGLint *rects)
dri2_x11_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp,
_EGLSurface *draw,
EGLint numRects, const EGLint *rects)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
@@ -822,7 +817,7 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
}
static EGLBoolean
dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
dri2_x11_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
EGLint x, EGLint y, EGLint width, EGLint height)
{
const EGLint rect[4] = { x, y, width, height };
@@ -830,11 +825,12 @@ dri2_post_sub_buffer(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
if (x < 0 || y < 0 || width < 0 || height < 0)
_eglError(EGL_BAD_PARAMETER, "eglPostSubBufferNV");
return dri2_swap_buffers_region(drv, disp, draw, 1, rect);
return dri2_x11_swap_buffers_region(drv, disp, draw, 1, rect);
}
static EGLBoolean
dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint interval)
dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
@@ -853,13 +849,16 @@ dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint
}
static EGLBoolean
dri2_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLNativePixmapType native_target)
dri2_x11_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
void *native_pixmap_target)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
xcb_gcontext_t gc;
xcb_pixmap_t target = (uintptr_t )native_target;
xcb_pixmap_t target;
STATIC_ASSERT(sizeof(uintptr_t) == sizeof(native_pixmap_target));
target = (uintptr_t) native_pixmap_target;
(void) drv;
@@ -985,24 +984,81 @@ dri2_x11_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
}
}
static _EGLImage*
dri2_x11_swrast_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
_EGLContext *ctx, EGLenum target,
EGLClientBuffer buffer,
const EGLint *attr_list)
{
return NULL;
}
static EGLBoolean
dri2_x11_get_sync_values(_EGLDisplay *display, _EGLSurface *surface,
EGLuint64KHR *ust, EGLuint64KHR *msc,
EGLuint64KHR *sbc)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(display);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
xcb_dri2_get_msc_cookie_t cookie;
xcb_dri2_get_msc_reply_t *reply;
cookie = xcb_dri2_get_msc(dri2_dpy->conn, dri2_surf->drawable);
reply = xcb_dri2_get_msc_reply(dri2_dpy->conn, cookie, NULL);
if (!reply) {
_eglError(EGL_BAD_ACCESS, __func__);
return EGL_FALSE;
}
*ust = ((EGLuint64KHR) reply->ust_hi << 32) | reply->ust_lo;
*msc = ((EGLuint64KHR) reply->msc_hi << 32) | reply->msc_lo;
*sbc = ((EGLuint64KHR) reply->sbc_hi << 32) | reply->sbc_lo;
free(reply);
return EGL_TRUE;
}
static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
.authenticate = NULL,
.create_window_surface = dri2_x11_create_window_surface,
.create_pixmap_surface = dri2_x11_create_pixmap_surface,
.create_pbuffer_surface = dri2_x11_create_pbuffer_surface,
.destroy_surface = dri2_x11_destroy_surface,
.create_image = dri2_x11_swrast_create_image_khr,
.swap_interval = dri2_fallback_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
.swap_buffers_region = dri2_fallback_swap_buffers_region,
.post_sub_buffer = dri2_fallback_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_fallback_get_sync_values,
};
static struct dri2_egl_display_vtbl dri2_x11_display_vtbl = {
.authenticate = dri2_x11_authenticate,
.create_window_surface = dri2_x11_create_window_surface,
.create_pixmap_surface = dri2_x11_create_pixmap_surface,
.create_pbuffer_surface = dri2_x11_create_pbuffer_surface,
.destroy_surface = dri2_x11_destroy_surface,
.create_image = dri2_x11_create_image_khr,
.swap_interval = dri2_x11_swap_interval,
.swap_buffers = dri2_x11_swap_buffers,
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
.swap_buffers_region = dri2_x11_swap_buffers_region,
.post_sub_buffer = dri2_x11_post_sub_buffer,
.copy_buffers = dri2_x11_copy_buffers,
.query_buffer_age = dri2_fallback_query_buffer_age,
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
.get_sync_values = dri2_x11_get_sync_values,
};
static EGLBoolean
dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
drv->API.CreatePbufferSurface = dri2_create_pbuffer_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.CopyBuffers = dri2_copy_buffers;
drv->API.SwapBuffersRegionNOK = NULL;
drv->API.CreateImageKHR = NULL;
drv->API.DestroyImageKHR = NULL;
drv->API.CreateDRMImageMESA = NULL;
drv->API.ExportDRMImageMESA = NULL;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
@@ -1010,6 +1066,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->conn = xcb_connect(0, 0);
dri2_dpy->own_device = true;
} else {
dri2_dpy->conn = XGetXCBConnection((Display *) disp->PlatformDisplay);
}
@@ -1019,6 +1076,11 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_dpy;
}
/*
* Every hardware driver_name is set using strdup. Doing the same in
* here will allow is to simply free the memory at dri2_terminate().
*/
dri2_dpy->driver_name = strdup("swrast");
if (!dri2_load_driver_swrast(disp))
goto cleanup_conn;
@@ -1036,7 +1098,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
goto cleanup_driver;
if (dri2_dpy->conn) {
if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
}
@@ -1044,6 +1106,11 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
disp->VersionMajor = 1;
disp->VersionMinor = 4;
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.
*/
dri2_dpy->vtbl = &dri2_x11_swrast_display_vtbl;
return EGL_TRUE;
cleanup_configs:
@@ -1052,6 +1119,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_conn:
free(dri2_dpy->driver_name);
if (disp->PlatformDisplay == NULL)
xcb_disconnect(dri2_dpy->conn);
cleanup_dpy:
@@ -1061,7 +1129,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
}
static void
dri2_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
dri2_x11_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
{
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
int arbitrary_max_interval = 1000;
@@ -1111,17 +1179,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy;
drv->API.CreateWindowSurface = dri2_create_window_surface;
drv->API.CreatePixmapSurface = dri2_create_pixmap_surface;
drv->API.CreatePbufferSurface = dri2_create_pbuffer_surface;
drv->API.DestroySurface = dri2_destroy_surface;
drv->API.SwapBuffers = dri2_swap_buffers;
drv->API.CopyBuffers = dri2_copy_buffers;
drv->API.CreateImageKHR = dri2_x11_create_image_khr;
drv->API.SwapBuffersRegionNOK = dri2_swap_buffers_region;
drv->API.PostSubBufferNV = dri2_post_sub_buffer;
drv->API.SwapInterval = dri2_swap_interval;
dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
@@ -1129,6 +1186,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->conn = xcb_connect(0, 0);
dri2_dpy->own_device = true;
} else {
dri2_dpy->conn = XGetXCBConnection((Display *) disp->PlatformDisplay);
}
@@ -1139,7 +1197,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
}
if (dri2_dpy->conn) {
if (!dri2_connect(dri2_dpy))
if (!dri2_x11_connect(dri2_dpy))
goto cleanup_conn;
}
@@ -1164,22 +1222,22 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
}
if (dri2_dpy->conn) {
if (!dri2_authenticate(disp))
if (!dri2_x11_local_authenticate(disp))
goto cleanup_fd;
}
if (dri2_dpy->dri2_minor >= 1) {
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 3;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_x11_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_x11_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
dri2_get_buffers_with_format;
dri2_x11_get_buffers_with_format;
} else {
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
dri2_dpy->dri2_loader_extension.base.version = 2;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffers = dri2_x11_get_buffers;
dri2_dpy->dri2_loader_extension.flushFrontBuffer = dri2_x11_flush_front_buffer;
dri2_dpy->dri2_loader_extension.getBuffersWithFormat = NULL;
}
@@ -1193,28 +1251,37 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup_fd;
dri2_setup_swap_interval(dri2_dpy);
dri2_x11_setup_swap_interval(dri2_dpy);
if (dri2_dpy->conn) {
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
}
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
disp->Extensions.NOK_swap_region = EGL_TRUE;
disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;
disp->Extensions.NV_post_sub_buffer = EGL_TRUE;
disp->Extensions.CHROMIUM_sync_control = EGL_TRUE;
#ifdef HAVE_WAYLAND_PLATFORM
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
#endif
if (dri2_dpy->conn) {
if (!dri2_add_configs_for_visuals(dri2_dpy, disp))
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
goto cleanup_configs;
}
dri2_dpy->authenticate = dri2_x11_authenticate;
/* we're supporting EGL 1.4 */
disp->VersionMajor = 1;
disp->VersionMinor = 4;
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.
*/
dri2_dpy->vtbl = &dri2_x11_display_vtbl;
return EGL_TRUE;
cleanup_configs:

File diff suppressed because it is too large Load Diff

View File

@@ -25,25 +25,10 @@
LOCAL_PATH := $(call my-dir)
# from Makefile
SOURCES = \
eglapi.c \
eglarray.c \
eglconfig.c \
eglcontext.c \
eglcurrent.c \
egldisplay.c \
egldriver.c \
eglfallbacks.c \
eglglobals.c \
eglimage.c \
egllog.c \
eglmisc.c \
eglmode.c \
eglscreen.c \
eglstring.c \
eglsurface.c \
eglsync.c
include $(LOCAL_PATH)/Makefile.sources
SOURCES := \
${LIBEGL_C_FILES}
# ---------------------------------------
# Build libGLES_mesa
@@ -95,6 +80,12 @@ gallium_DRIVERS :=
# swrast
gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_android
# freedreno
ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno
LOCAL_SHARED_LIBRARIES += libdrm_freedreno
endif
# i915g
ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915
@@ -109,28 +100,29 @@ endif
# nouveau
ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += \
libmesa_winsys_nouveau \
libmesa_pipe_nvfx \
libmesa_pipe_nv50 \
libmesa_pipe_nvc0 \
libmesa_pipe_nouveau
gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau
LOCAL_SHARED_LIBRARIES += libdrm_nouveau
LOCAL_SHARED_LIBRARIES += libstlport
endif
# r300g/r600g/radeonsi
ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_winsys_radeon
LOCAL_SHARED_LIBRARIES += libdrm_radeon
ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_r300
endif
endif # r300g
ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),)
ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_r600
endif
LOCAL_SHARED_LIBRARIES += libstlport
endif # r600g
ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),)
gallium_DRIVERS += libmesa_pipe_radeonsi
endif
endif
endif # radeonsi
gallium_DRIVERS += libmesa_pipe_radeon
endif # r600g || radeonsi
endif # r300g || r600g || radeonsi
# vmwgfx
ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
@@ -151,14 +143,18 @@ LOCAL_STATIC_LIBRARIES := \
libmesa_st_egl \
$(gallium_DRIVERS) \
libmesa_st_mesa \
libmesa_util \
libmesa_glsl \
libmesa_glsl_utils \
libmesa_gallium \
libloader \
$(LOCAL_STATIC_LIBRARIES)
endif # MESA_BUILD_GALLIUM
LOCAL_STATIC_LIBRARIES := \
$(LOCAL_STATIC_LIBRARIES) \
libmesa_loader
LOCAL_MODULE := libGLES_mesa
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl

View File

@@ -19,9 +19,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
if HAVE_XF86VIDMODE
EXTRA_DEFINES_XF86VIDMODE = -DXF86VIDMODE
endif
include Makefile.sources
AM_CFLAGS = \
-I$(top_srcdir)/include \
@@ -36,44 +34,16 @@ AM_CFLAGS = \
lib_LTLIBRARIES = libEGL.la
libEGL_la_SOURCES = \
eglapi.c \
eglarray.c \
eglconfig.c \
eglcontext.c \
eglcurrent.c \
egldisplay.c \
egldriver.c \
eglfallbacks.c \
eglglobals.c \
eglimage.c \
egllog.c \
eglmisc.c \
eglmode.c \
eglscreen.c \
eglstring.c \
eglsurface.c \
eglsync.c \
eglcompiler.h \
eglconfig.h \
eglcontext.h \
eglcurrent.h \
egldefines.h \
egldisplay.h \
egldriver.h \
eglglobals.h \
eglimage.h \
egllog.h \
eglmisc.h \
eglmode.h \
eglmutex.h \
eglscreen.h \
eglstring.h \
eglsurface.h \
eglsync.h
${LIBEGL_C_FILES}
libEGL_la_LIBADD = \
$(EGL_LIB_DEPS)
libEGL_la_LDFLAGS = -Wl,-Bsymbolic -version-number 1:0 -no-undefined
libEGL_la_LDFLAGS = \
-no-undefined \
-version-number 1:0 \
$(BSYMBOLIC) \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
if HAVE_EGL_PLATFORM_X11
AM_CFLAGS += -DHAVE_X11_PLATFORM
@@ -102,12 +72,6 @@ if HAVE_EGL_PLATFORM_NULL
AM_CFLAGS += -DHAVE_NULL_PLATFORM
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 += $(DLOPEN_LIBS)
endif
if HAVE_EGL_DRIVER_DRI2
AM_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
AM_CFLAGS += -DHAVE_XCB_DRI2
@@ -128,5 +92,6 @@ egldir = $(includedir)/EGL
egl_HEADERS = \
$(top_srcdir)/include/EGL/eglext.h \
$(top_srcdir)/include/EGL/egl.h \
$(top_srcdir)/include/EGL/eglextchromium.h \
$(top_srcdir)/include/EGL/eglmesaext.h \
$(top_srcdir)/include/EGL/eglplatform.h

View File

@@ -0,0 +1,38 @@
LIBEGL_C_FILES := \
eglapi.c \
eglapi.h \
eglarray.c \
eglarray.h \
eglcompiler.h \
eglconfig.c \
eglconfig.h \
eglcontext.c \
eglcontext.h \
eglcurrent.c \
eglcurrent.h \
egldefines.h \
egldisplay.c \
egldisplay.h \
egldriver.c \
egldriver.h \
eglfallbacks.c \
eglglobals.c \
eglglobals.h \
eglimage.c \
eglimage.h \
egllog.c \
egllog.h \
eglmisc.c \
eglmisc.h \
eglmode.c \
eglmode.h \
eglmutex.h \
eglscreen.c \
eglscreen.h \
eglstring.c \
eglstring.h \
eglsurface.c \
eglsurface.h \
eglsync.c \
eglsync.h \
egltypedefs.h

View File

@@ -28,25 +28,8 @@ env.Append(CPPPATH = [
'#/include',
])
egl_sources = [
'eglapi.c',
'eglarray.c',
'eglconfig.c',
'eglcontext.c',
'eglcurrent.c',
'egldisplay.c',
'egldriver.c',
'eglfallbacks.c',
'eglglobals.c',
'eglimage.c',
'egllog.c',
'eglmisc.c',
'eglmode.c',
'eglscreen.c',
'eglstring.c',
'eglsurface.c',
'eglsync.c',
]
# parse Makefile.sources
egl_sources = env.ParseSourceList('Makefile.sources', 'LIBEGL_C_FILES')
egl = env.ConvenienceLibrary(
target = 'egl',

Some files were not shown because too many files have changed in this diff Show More