Compare commits

..

3781 Commits

Author SHA1 Message Date
Jerome Glisse
a0528269a3 winsys/radeon: improve debuging printing
Make sure one can identify virtual address failure from allocation
failure.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 9a47684564)
2013-02-08 20:33:22 -05:00
Jerome Glisse
18ef6b1265 xorg: fix exa finish access
The exa core will already set the pointer to NULL prior calling
the callback function. So don't bail out in the callback if it's
already NULL.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
(cherry picked from commit 3310acdf47)
2013-02-08 19:01:51 -05:00
Paul Berry
0419b7a3a1 glsl: Support transform feedback of varying structs.
Since transform feedback needs to be able to access individual fields
of varying structs, we can no longer match up the arguments to
glTransformFeedbackVaryings() with variables in the vertex shader.

Instead, we build up a hashtable which records information about each
possible name that is a candidate for transform feedback, and then
match up the arguments to glTransformFeedbackVaryings() with the
contents of that hashtable.

Populating the hashtable uses the program_resource_visitor
infrastructure, so the logic is shared with how we handle uniforms.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 99b78337e3)
2013-02-08 11:17:33 -08:00
Paul Berry
5be2e14393 glsl: Use parse_program_resource_name to parse transform feedback varyings.
Previously, transform feedback varyings were parsed in an ad-hoc
fashion that wasn't compatible with structs (or array of structs).
This patch makes it use parse_program_resource_name(), which correctly
handles both.

Note that parse_program_resource_name()'s technique for handling
mal-formed input strings is to simply let them through and rely on the
fact that a future name lookup will fail.  Because of this,
tfeedback_decl::init() no longer needs to return a boolean error
code--it always succeeds, and if the input was mal-formed the error
will be detected later.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 53febac02c)
2013-02-08 11:17:28 -08:00
Paul Berry
11e4347bff glsl: Rename uniform_field_visitor to program_resource_visitor.
There's actually nothing uniform-specific in uniform_field_visitor.
It is potentially useful for all kinds of program resources (in
particular, future patches will use it for transform feedback
varyings).

This patch renames it to program_resource_visitor, and clarifies
several comments, to reflect the fact that it is useful for more than
just uniforms.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b4db34cc4c)
2013-02-08 11:17:23 -08:00
Paul Berry
49a5f829f7 mesa/glsl: Separate parsing logic from _mesa_get_uniform_location.
The parsing logic is moved to a new function in the GLSL module,
parse_program_resource_name().  This name was chosen because it should
eventually be useful for handling everything that OpenGL 4.3 calls
"program resources" (e.g. uniforms, vertex inputs, fragment outputs,
and transform feedback varyings).

Future patches will make use of this function for linking transform
feedback varyings.

NOTE: This is a candidate for the 9.1 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b92900d26a)
2013-02-08 11:17:17 -08:00
Kenneth Graunke
5265c42e52 i965/blorp: Support blits between ARGB and XRGB formats.
Now that we have support for overriding alpha to 1.0, we can handle
blitting between these formats in either direction.

For now, we only support two XRGB formats: MESA_FORMAT_XRGB8888 and
MESA_FORMAT_RGBX8888_REV.  Most places only appear to worry about the
former, so ignore the latter for now.  We can always add it later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
(cherry picked from commit 7d467f3c15)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
3114f5acd3 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.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
(cherry picked from commit c0554141a9)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
332c50b666 i965: Implement CopyTexSubImage2D via BLORP (and use it by default).
The BLT engine has many limitations.  Currently, it can only blit
X-tiled buffers (since we don't have a kernel API to whack the BLT
tiling mode register), which means all depth/stencil operations get
punted to meta code, which can be very CPU-intensive.

Even if we used the BLT engine, it can't blit between buffers with
different tiling modes, such as an X-tiled non-MSAA ARGB8888 texture
and a Y-tiled CMS ARGB8888 renderbuffer.  This is a fundamental
limitation, and the only way around that is to use BLORP.

Previously, BLORP only handled BlitFramebuffer.  This patch adds an
additional frontend for doing CopyTexSubImage.  It also makes it the
default.  This is partly to increase testing and avoid hiding bugs,
and partly because the BLORP path can already handle more cases.  With
trivial extensions, it should be able to handle everything the BLT can.

This helps PlaneShift massively, which tries to CopyTexSubImage2D
between depth buffers whenever a player casts a spell.  Since these
are Y-tiled, we hit meta and software ReadPixels paths, eating 99% CPU
while delivering ~1 FPS.  This is particularly bad in an MMO setting
because people cast spells all the time.

It also helps Xonotic in 4X MSAA mode.  At default power management
settings, I measured a 6.35138% +/- 0.672548% performance boost (n=5).
(This data is from v1 of the patch.)

No Piglit regressions on Ivybridge (v3) or Sandybridge (v2).

v2: Create a fake intel_renderbuffer to wrap the destination texture
    image and then reuse do_blorp_blit rather than reimplementing most
    of it.  Remove unnecessary clipping code and conditional rendering
    check.

v3: Reuse formats_match() to centralize checks; delete temporary
    renderbuffers.  Reorganize the code.

v4: Actually copy stencil when dealing with separate stencil buffers but
    packed depth/stencil formats.  Tested by a new Piglit test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v4]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v3]
Reviewed-and-tested-by: Carl Worth <cworth@cworth.org> [v2]
Tested-by: Martin Steigerwald <martin@lichtvoll.de> [v3]
(cherry picked from commit 0b3bebbaac)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
55e3f79d55 mesa: Put extern "C" guards in renderbuffer.h.
I need to use this from C++ code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 29aef6cce8)
2013-02-07 22:31:29 -08:00
Kenneth Graunke
1d2ef43032 i965: Fix the SF Vertex URB Read Length calculation for Gen7 platforms.
Ivybridge doesn't appear to have the same errata as Sandybridge; no
corruption was observed by setting it to more than the minimal correct
value.  It's possible that we were simply lucky, since the URB entries
are 1024-bit on Ivybridge vs. 512-bit Sandybridge.  Or perhaps the
underlying hardware issue is fixed.

Either way, we may as well program the minimum value since it's now
readily available, likely to be more efficient, and possibly more
correct.

v2: Use GEN7_SBE_* defines rather than GEN6_SF_*.  (A copy and paste
    mistake.)  They're the same, but using the right names is better.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 44aa2e15f6)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
3acd5ed75b i965: Fix the SF Vertex URB Read Length calculation for Sandybridge.
(This commit message was primarily written by Paul Berry, who explained
 what's going on far better than I would have.)

Previous to this patch, we thought that the only restrictions on
3DSTATE_SF's URB read length were (a) it needs to be large enough to
read all the VUE data that the SF needs, and (b) it can't be so large
that it tries to read VUE data that doesn't exist.  Since the VUE map
already tells us how much VUE data exists, we didn't bother worrying
about restriction (a); we just did the easy thing and programmed the
read length to satisfy restriction (b).

However, we didn't notice this erratum in the hardware docs: "[errata]
Corruption/Hang possible if length programmed larger than recommended".
Judging by the context surrounding this erratum, it's pretty clear that
it means "URB read length must be exactly the size necessary to read all
the VUE data that the SF needs, and no larger".  Which means that we
can't program the read length based on restriction (b)--we have to
program it based on restriction (a).

The URB read size needs to precisely match the amount of data that the
SF consumes; it doesn't work to simply base it on the size of the VUE.

Thankfully, the PRM contains the precise formula the hardware expects.

Fixes random UI corruption in Steam's "Big Picture Mode", random terrain
corruption in PlaneShift, and Piglit's fbo-5-varyings test.

NOTE: This is a candidate for all stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56920
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60172
Tested-by: Jordan Justen <jordan.l.justen@intel.com> (v1/Piglit)
Tested-by: Martin Steigerwald <martin@lichtvoll.de> (PlaneShift)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 09fbc29828)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
697f8e56dc i965: Compute the maximum SF source attribute.
The maximum SF source attribute is necessary to compute the Vertex URB
read length properly, which will be done in the next commit.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5e9bc7bd12)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
45ae093e5c i965: Refactor Gen6+ SF attribute override code.
The next patch will benefit from easy access to the source attribute
number and whether or not we're swizzling.  It doesn't want the final
attr_override DWord form, however.

NOTE: This is a candidate for all stable branches.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b3efc5bea8)
2013-02-07 22:31:28 -08:00
Kenneth Graunke
535e95299a i965: Add chipset limits for Haswell GT1/GT2.
The maximum number of URB entries come from the 3DSTATE_URB_VS and
3DSTATE_URB_GS state packet documentation; the thread count information
comes from the 3DSTATE_VS and 3DSTATE_PS state packet documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit 9add4e8038)
2013-02-07 22:31:28 -08:00
Vinson Lee
a7e2c615f1 i965: Fix assignment instead of comparison in asserts.
Fixes side effect in assertion defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 1559994cba)
2013-02-07 22:31:28 -08:00
Paul Berry
5611a5a387 mesa: Don't check (offset + size <= bufObj->Size) in BindBufferRange.
In the documentation for BindBufferRange, OpenGL specs from 3.0
through 4.1 contain this language:

    "The error INVALID_VALUE is generated if size is less than or
    equal to zero or if offset + size is greater than the value of
    BUFFER_SIZE."

This text was dropped from OpenGL 4.2, and it does not appear in the
GLES 3.0 spec.

Presumably the reason for the change is because come clients change
the size of the buffer after calling BindBufferRange.  We don't want
to generate an error at the time of the BindBufferRange call just
because the old size of the buffer was too small, when the buffer is
about to be resized.

Since this is a deliberate relaxation of error conditions in order to
allow clients to work, it seems sensible to apply it to all versions
of GL, not just GL 4.2 and above.

(Note that there is no danger of this change allowing a client to
access data beyond the end of a buffer.  We already have code to
ensure that that doesn't happen in the case where the client shrinks
the buffer after calling BindBufferRange).

Eliminates a spurious error message in the gles3 conformance test
"transform_feedback_offset_size".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 04f0d6cc22)
2013-02-07 21:20:32 -08:00
Ian Romanick
a48e5526c2 i965: Set UniformBufferOffsetAlignment to sizeof(vec4)
This matches the behavior of the Windows driver, but a bspec reference
should would be nice.

NOTE: This is a candidate for the 9.0 and 9.1 branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f29ab4ece5)
2013-02-07 21:20:16 -08:00
Matt Turner
c59808c700 mesa: Allow glGet* queries of MAX_VARYING_COMPONENTS in ES 3
Should have been done in d9948e49 but I missed it because
MAX_VARYING_FLOATS doesn't appear in the ES 3 spec, but is the same
value as MAX_VARYING_COMPONENTS.

NOTE: Candidate for the 9.1 branch
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-07 17:54:16 -08:00
Michel Dänzer
ad62f424b3 radeonsi: Handle scaled and integer formats for samplers and vertex elements.
Also, add assertions to stress that render targets don't support scaled
formats.

20 more little piglits.
(cherry picked from commit 46dd16bca8b4526e46badc9cb1d7c058a8e6173e)
2013-02-07 19:11:30 +01:00
Michel Dänzer
fc04455533 radeonsi: Don't advertise PIPE_FORMAT_L8A8_SRGB support.
The hardware can't do it.
(cherry picked from commit f6e9430da2d3510f84baefa0fdf26ec5c457f146)
2013-02-07 19:11:19 +01:00
Michel Dänzer
6799bddf6b radeonsi: Remove incorrect (and dead) assignment in tex_fetch_args().
The proper return type is assigned at the end of the function.
(cherry picked from commit 180db2bcb28e94bb1ce18d76b2b3a5818d76262c)
2013-02-07 19:11:09 +01:00
Michel Dänzer
93f61addb5 radeonsi: Use unique names for referring to texture sampling intrinsics.
Append the overloaded vector type used for passing in the addressing
parameters.

Without this, LLVM uses the same function signature for all those types,
which cannot work.

Fixes problems e.g. with FlightGear and Red Eclipse.
(cherry picked from commit 1b3afea30de757815555d9eb1d6e72e2586d6a0c)
2013-02-07 19:10:17 +01:00
Jerome Glisse
d04b50b4de r600g: fix slice tile max for compressed texture and async dma
Was using the pixel size instead of the number of block for the slice
tile max computation which resulted in dma writing at wrong address.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-02-07 10:43:37 -05:00
Marek Olšák
f1c46c8418 r300g: fix blending with blend color and RGBA formats
NOTE: This is a candidate for the stable branches.
(cherry picked from commit f40a7fc34a)
2013-02-06 22:24:04 +01:00
Michel Dänzer
4bc85f9aac Require libdrm_radeon 2.4.42 for radeonsi.
It has new PCI IDs and an important tiled surface layout fix.
(cherry picked from commit 02a423b239)
2013-02-05 15:15:49 +01:00
Alex Deucher
e1d798a901 radeonsi: add Oland pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
(cherry picked from commit 4161d70bba)
2013-02-04 17:20:22 -05:00
Alex Deucher
6b0fa537a9 radeonsi: default PA_SC_RASTER_CONFIG to 0
That should work in all cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch.
(cherry picked from commit af0af75881)
2013-02-04 17:20:03 -05:00
Alex Deucher
0cc0097bb0 radeonsi: add support for Oland chips
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the 9.1 branch
(cherry picked from commit 83e4407f44)
2013-02-04 17:19:43 -05:00
Michel Dänzer
7f90de5414 radeonsi: Fix draws using user index buffer.
Was broken since commit bf469f4edc
('gallium: add void *user_buffer in pipe_index_buffer').

Fixes 11 piglit tests and lots of missing geometry e.g. in TORCS.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit a8a5055f2d)
2013-02-04 17:54:03 +01:00
Michel Dänzer
8cd237bcbe radeonsi: Remove spurious traces of R16G16B16 support.
The hardware can't do it, and these were causing warnings in some piglit tests.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 6455d40b7e)
2013-02-04 17:28:18 +01:00
Michel Dänzer
5ca77c27a6 radeonsi: Enable texture arrays.
28/30 piglit tests pass.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 6bcb823844)
2013-02-04 17:28:14 +01:00
Michel Dänzer
b104d151f1 radeonsi: Improve packing of texture address parameters.
In particular, the LOD bias and depth comparison values are packed before the
'normal' texture coordinates, and the array slice and LOD values are appended.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit 120efeef8b)
2013-02-04 17:27:43 +01:00
Michel Dänzer
5f9f3f381f radeonsi: Adapt to sample intrinsics changes.
Fix up intrinsic names, and bitcast texture address parameters to integers.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit e5fb7347a7)
2013-02-04 17:27:34 +01:00
Marek Olšák
b127ad3489 mesa: don't expose IBM_rasterpos_clip in a core context
glRasterPos doesn't exist in the core profile.

NOTE: This is a candidate for the stable branches (9.0 and 9.1).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit cc5fdaf2dc)
2013-02-01 16:35:24 +01:00
Marek Olšák
1003652a7f r300g: always put MSAA resources in VRAM
This along with the latest drm-fixes branch should help with bad performance
of MSAA. Remember: Nx MSAA can't be more than N times slower (where N=2,4,6).

Anyway, I recommend at least 512 MB of VRAM for Full HD 6x MSAA.

NOTE: This is a candidate for the 9.1 branch.
(cherry picked from commit a06f03d795)
2013-02-01 16:35:18 +01:00
Jerome Glisse
9d8a866db3 r600g: add cs memory usage accounting and limit it v3
We are now seing cs that can go over the vram+gtt size to avoid
failing flush early cs that goes over 70% (gtt+vram) usage. 70%
is use to allow some fragmentation.

The idea is to compute a gross estimate of memory requirement of
each draw call. After each draw call, memory will be precisely
accounted. So the uncertainty is only on the current draw call.
In practice this gave very good estimate (+/- 10% of the target
memory limit).

v2: Remove left over from testing version, remove useless NULL
    checking. Improve commit message.
v3: Add comment to code on memory accounting precision

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-31 14:25:30 -05:00
Marek Olšák
3b8d4f941f r600g: fix htile buffer leak
NOTE: This is a candidate for the 9.1 branch.
2013-01-31 14:25:10 -05:00
Matt Turner
ff515c4e7c build: Add missing comma in AS_IF
Reported-by: Lauri Kasanen<curaga@operamail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47248#c15
2013-01-29 15:06:47 -08:00
Marek Olšák
d7ca04a7c3 docs/relnotes-9.1: document new features in radeon drivers
(cherry picked from commit 845130951f)
2013-01-29 17:38:14 +01:00
Matt Turner
48af880f81 docs: List new extensions added in Mesa 9.1
I did not list the *_get_program_binary extensions since they're not
useful to anyone with their current implementation (that supports 0
binary formats).
2013-01-28 16:49:24 -08:00
Jerome Glisse
af2d8f8072 r600g: use uint64_t instead of unsigned long for proper 32bits cpu support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 19:10:29 -05:00
Jerome Glisse
d8d17441e2 r600g: real fix for non 3.8 kernel
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 17:44:49 -05:00
Jerome Glisse
72916698b0 r600g: fix segfault with old kernel
Old kernel do not have dma support, patch pushed were missing some
of the check needed to not use dma.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 14:51:40 -05:00
Zack Rusin
dbb2d192de glx: only advertise GLX_INTEL_swap_event if it's supported
Only drivers supporting DRI2 version >=4 support GLX_INTEL_swap_event.
So lets mark it as such otherwise applications which use this extension
(i.e. everything based on Clutter, e.g. gnome-shell) break horribly on
drivers supporting DRI2 versions only up to 3.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 19:13:05 -08:00
Vadim Girlin
c9343047cf r600g: improve inputs/interpolation handling with llvm backend
Get rid of special handling for reserved regs.
Use one intrinsic for all kinds of interpolation.

v2[Vincent Lejeune]: Rebased against current master

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-01-28 18:30:38 +00:00
Tom Stellard
33dc412b89 r600g: Add ar_chan member to struct r600_bytecode
r600_bytecode::ar_chan stores the register channel for the value that
will be loaded into the AR register.

At the moment, this field is only used by the LLVM backend.  The default
backend always sets ar_chan = 0.
2013-01-28 18:30:38 +00:00
Tom Stellard
0ba0926861 r600g: More robust checks for MOVA_INT instructions 2013-01-28 18:30:37 +00:00
Vincent Lejeune
a871e01174 r600g/llvm: Add dummy export for vs output
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59588

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-28 18:30:37 +00:00
Tom Stellard
91a160b19f r600g: Fix building with --enable-r600-llvm-compiler
https://bugs.freedesktop.org/show_bug.cgi?id=59877
2013-01-28 18:30:37 +00:00
Alex Deucher
e110c98cae r600g: don't emit WAIT_UNTIL on cayman/TN (v2)
It shouldn't be needed and older kernels don't support
it.

v2: Replace with PS partial flush as before.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-28 12:11:27 -05:00
Jerome Glisse
325422c494 r600g: add async for staging buffer upload v2
v2: Add virtual address to dma src/dst offset for cayman

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 11:30:35 -05:00
Jerome Glisse
bff07638a8 r600g: add multi ring support with dma as first second ring v4
We keep track of ring emission order in a stack, whenever we need to
flush we empty the stack in a fifo order. There is few helpers function
for bo mapping and other ring activities that will make sure that
the ring stack is properly flush and submitted.

v2: fix st flush path, and other flush path to properly flush all
    rings if necessary
v3: - improve name of ring helpers
    - make sure that each time a cs is gona be written it endup at
      top of the stack to avoid any issue such as :
      STACK[0] = dma (withbo A,B)
      STACK[1] = gfx (withbo C,D)
      Now if code try to emit a dma command relative to bo C or D
      it will start writting cmd stream into the cs and once it
      reach the point where it adds relocation it will flush.
      At that point the cs will have cmd that don't have proper
      relocation into the relocation buffer and kernel will just
      refuse to run.
v4: - Drop the stack idea as it turn out there is no way to use it
      or benefit from it. Any time the driver start command on other
      ring, it always need to flush the previous ring. So make code
      simpler by not using a stack.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 11:30:35 -05:00
Jerome Glisse
6c064fd749 radeon/winsys: add dma ring support to winsys v3
Add ring support, you can create a cs for each ring. DMA ring is
bit special regarding relocation as you must emit as much relocation
as there is use of the buffer.

v2: - Improved comment on relocation changes
    - Use a single thread to queue cs submittion this simplify driver
      code while not impacting performances. Rational for this is that
      you have to wait for all previous submission to have completed
      so there was never a case while we could have 2 different thread
      submitting a command stream at the same time. This code just
      consolidate submission into one single thread per winsys.
v3: - Do not use semaphore for empty queue signaling, instead use
      cond var. This is because it's tricky to maintain an even number
      of call to semaphore wait and semaphore signal (the number of
      cs in the stack would for instance make that number vary).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 11:30:35 -05:00
Roland Scheidegger
cbf0f66631 gallivm,draw,llvmpipe: mass rename of unit->texture_unit/sampler_unit
Make it obvious what "unit" this is (no change in functionality).
draw still uses "unit" in places where it changes the shader by adding
texture sampling itself - it seems like this can't work with shaders
using dx10-style sample opcodes (can't mix gl-style and dx10-style
sample instructions in a shader).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-28 06:58:06 -08:00
Roland Scheidegger
c789b981b2 gallivm: split sampler and texture state
Split the sampler interface to use separate sampler and texture (sampler_view)
state. This is needed to support dx10-style sampling instructions.
This is not quite complete since both draw/llvmpipe don't really track
textures/samplers independently yet, as well as the gallivm code not quite
using the right sampler or texture index respectively (but it should work
for the sampling codes used by opengl).
We are however losing some optimizations in the process, apply_max_lod will
no longer work, and we potentially could end up with more (unnecessary)
recompiles (if switching textures with/without mipmaps only so it shouldn't
be too bad).

v2: don't use different callback structs for sampler/sampler view functions
(which just complicates things), fix up sampling code to actually use the
right texture or sampler index, and similar for llvmpipe/draw actually
distinguish between samplers and sampler views.

v3: fix more of PIPE_MAX_SAMPLER / PIPE_MAX_SHADER_SAMPLER_VIEWS mismatches
(both in draw and llvmpipe), based on feedback from José get rid of unneeded
static sampler derived state.(which also fixes the only 2 piglit regressions
due to a forgotten assignment), fix comments based on Brian's feedback.

v4: remove some accidental unrelated whitespace changes

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-28 06:50:36 -08:00
Marek Olšák
87592cff57 gallium/u_upload_mgr: fix a serious memory leak
It can eat all memory and crash in a matter of minutes with r600g.
2013-01-28 02:51:52 +01:00
Christoph Bumiller
e058f2ac97 nouveau: don't try to use push_data if it's not implemented 2013-01-27 13:45:06 +01:00
Matt Turner
51b64ce47b gles3: Update gl3.h
Contains a fix for Khronos bug 9557.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-26 20:42:19 -08:00
Marek Olšák
8891b2f9c9 r600g: add more cases for copying unsupported formats to resource_copy_region
just in case a new format is added to gallium
2013-01-26 14:59:04 +01:00
Marek Olšák
26c872c2a2 r600g: don't use radeon_surface_level::npix_x/y/z
npix_x/y/z is wrong with NPOT textures, since it's always aligned to POT
if the level is non-zero, so we can't use that.

This fixes piglit/spec/EXT_texture_shared_exponent/fbo-generatemipmap-formats.
2013-01-26 14:58:52 +01:00
Marek Olšák
edc38330da r600g: fix compile warnings in r600_cp_dma_copy_buffer on 32-bit gcc 2013-01-26 14:50:36 +01:00
Alex Deucher
f951f2f52c r600g: fix up CP DMA for VM on cayman and TN
Need to add the virtual address.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-25 21:57:42 -05:00
Brian Paul
c1d35aece0 svga: use pipe_sampler_view_release() in svga_cleanup_tss_binding()
Fixes a crash when the Redway3D Turbine demo exits.  We've made this
change in other places in the past.  The root issue is texture objects
are being shared by multiple contexts and sampler views get shared too.
Sampler views have a context pointer and if that context gets deleted
we may try to reference that context when finally deleting the sampler
view.

pipe_sampler_view_release() avoids this problem because it takes
an explicit context.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-01-25 15:57:35 -07:00
Brian Paul
50c4c818aa st/mesa: handle new GLSL IR enumerants in switch statements
To silence warnings about unhandled cases.
2013-01-25 15:46:14 -07:00
Brian Paul
9227c53741 svga: add NULL pointer check in svga_create_sampler_state()
Note: This is a candidate for the 9.0 branch.
2013-01-25 15:41:41 -07:00
Brian Paul
7a89f08a22 vbo: add a null pointer check to handle OOM instead of crashing
Note: This is a candidate for the 9.0 branch.
2013-01-25 15:41:41 -07:00
Brian Paul
b13c534f14 util: add new error checking code in vbuf helper
Check the return value of calls to u_upload_alloc() and
u_upload_data() and return early if needed.

Since we don't have a way to propagate errors all the way up to
Mesa through pipe_context::draw_vbo(), call debug_warn_once() so
the user might have some clue about OOM errors.

Note: This is a candidate for the 9.0 branch.
2013-01-25 15:41:40 -07:00
Brian Paul
8c3f9ea073 st/mesa: do proper error checking for u_upload_alloc() calls
We weren't properly checking the return value of these calls (and
calls to u_upload_data()) to detect OOM errors.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:40 -07:00
Brian Paul
68a097596e util: add some defensive coding in u_upload_alloc()
Some callers of this function were checking the 'ptr' result to see if
the function failed.  But the correct way is to check the regular
return value for PIPE_ERROR_x.  Now we initialize all the returned
values at the top of the function in case we do hit an error (like OOM).

Callers are more likely to detect OOM conditions now.  But there
are some callers which don't do any error checking...

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:40 -07:00
Brian Paul
d6f8b7ef38 glsl: use glsl_strtof() instead of glsl_strtod()
Since the result of those calls is always assigned to a float.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 15:41:40 -07:00
Brian Paul
811b5b4b39 glsl: add new glsl_strtof() function
Note, we could alternately implement this in terms of glsl_strtod()
with a (float) cast.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 15:41:39 -07:00
Brian Paul
6102b9d441 softpipe: add casts to silence MSVC warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
257783b939 util: silence MSVC signed/unsigned comparison warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
539541f2e2 util: silence MSVC double->float conversion warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
869071dfb7 util: silence MSVC signed/unsigned warnings in debug_get_flags_option()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
1a15772b7c st/mesa: silence assorted MSVC warnings in DrawPixels code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
eee762258e swrast: silence a bunch of MSVC warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
ccbb479f40 mesa: use GLbitfield64 when copying program inputs
Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
701a0f6a76 mesa: add some casts to silence MSVC warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
ddb774ddf1 mesa: add casts in _mesa_GetTexParameterfv() to silence warnings
There are other similar int->float casts elsewhere in the function.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Matt Turner
9aadc3a6cc i965: Enable ARB_shading_language_packing
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:24 -08:00
Matt Turner
64dbc51b49 i965: Assert that the 4x8 pack/unpack operations have been lowered
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
96220111dd i965: Lower the 4x8 pack/unpack operations
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
321555fb41 glsl: Add support for lowering 4x8 pack/unpack operations
Lower them to arithmetic and bit manipulation expressions.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
1ef674f215 glsl: Evaluate constant pack/unpack 4x8 expressions
That is, evaluate constant expressions for the following functions:
  packSnorm4x8, unpackSnorm4x8
  packUnorm4x8, unpackUnorm4x8

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
b64b174b0a glsl: Extend ir_expression_operation for ARB_shading_language_packing
For each function {pack,unpack}{Snorm,Unorm}4x8, add a corresponding
opcode to enum ir_expression_operation. Validate the new opcodes in
ir_validate.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
b0239ce960 glsl: Add IR lisp for ARB_shading_language_packing
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
12aa2fec5b glsl: Add infrastructure for ARB_shading_language_packing
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Tom Stellard
7a850c5851 configure.ac: Don't set LLVM_LIBS when llvm is disabled 2013-01-25 22:05:00 +00:00
Tom Stellard
264e6dad28 r600g: Don't build llvm_wrapper.cpp when we aren't using LLVM
We were using the NEED_RADEON_GALLIUM conditional to decide whether or not
to build llvm_wrapper.cpp, which is required for using the LLVM backend.
llvm_wrapper.cpp needs to be linked against the LLVM IPO libary
and this library is only added to LLVM_LIBS if either opencl or the
r600-llvm-compiler is enabled.

The NEED_RADEON_GALLIUM conditional is set to true when enabling the
radeonsi driver, so if the radeonsi and r600 drivers are enabled without
also enabling opencl or r600-llvm-compiler, llvm_wrapper.cpp will be
built, but the IPO library won't be added to LLVM_LIBS.  This was
causing unresolved symbol errors when buiding with this configuration.

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

Tested-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-25 22:05:00 +00:00
Eric Anholt
1a316af034 i965: Pass in the glarray to get_surface_type.
Dereffing all the values in the two callers was just pointless, and
the function isn't inlined so there was actual code impact.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:41:04 -08:00
Eric Anholt
80aeda2784 i965: Remove nonsense comment.
vb.inputs_read has never been a thing, even in the initial import.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:59 -08:00
Eric Anholt
23e5503348 i965: Remove NDEBUG undef that was snuck in.
If you want debug, set --enable-debug in your config flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:54 -08:00
Eric Anholt
8fe43b6dc9 i965: reuse _mesa_sizeof_type for index buffer types.
The core Mesa code has just one more case than this (GL_BITMAP), so I
don't see any cause to special-case it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:49 -08:00
Eric Anholt
b859a12f21 i965: Reuse precalculated ib_type_size value.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:44 -08:00
Eric Anholt
9aa02a205d i965: Drop debug check for knowing the size of a type.
This was added in b93684f5f3, but there's
no need for it -- get_size has to succeed, and it has an assert for us
in debug builds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:39 -08:00
Eric Anholt
5ae3c20791 i965: Stop worrying about alignment of vertex data.
For our current types, the required alignment is actually just 1 byte.
When we get doubles, we have to worry (those have to be aligned to the
natural size), but we don't have doubles yet and they'll just be a
special case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:33 -08:00
Eric Anholt
2a7a5062c9 i965: Use the glarray _ElementSize that Mesa tracks for us.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:22 -08:00
Eric Anholt
f6191e09aa mesa: Print more informative debug for _mesa_do_init_remap_table().
This is the same logic from _mesa_map_function_array().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:36:43 -08:00
Ian Romanick
22233da1ee glsl: Remove ir_variable::uniform_block
v2: A previous patch contained a spurious hunk that removed an
assignment to ir_variable::uniform_block.  That hunk was moved to this
patch.  Suggested by Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:36 -05:00
Ian Romanick
f09d77b2af glsl: Allow dereferencing fields of an interface instance
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:36 -05:00
Ian Romanick
32f3229255 glsl: Allow elimination of uniform block members
glGetActiveUniform is not supposed to report block members that are not
active even if they are included in the layout of the block.  The block
layout is determined from the GLSL_TYPE_INTERFACE that defines the
block, so eliminating the ir_variables that correspond to the individual
fields is safe.

Fixes gles3conform test
uniform_buffer_object_getuniformindices_for_for_nonexistent_or_not_active_uniform_names.

This also fixes the assertion failures (added in the previous commit) in
gles3conform uniform_buffer_object_index_of_not_active_block,
uniform_buffer_object_inherit_and_override_layouts, and
uniform_buffer_object_repeat_global_scope_layouts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:36 -05:00
Ian Romanick
514f8c7ec7 glsl: Calculate UBO data at link-time
Use the function added in the previous commit.

This temporarily causes gles3conform
uniform_buffer_object_index_of_not_active_block,
uniform_buffer_object_inherit_and_override_layouts, and
uniform_buffer_object_repeat_global_scope_layouts to assertion fail.
This is fixed in the next commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:36 -05:00
Ian Romanick
0ab7399822 glsl: Add link_uniform_blocks to calculate all UBO data at link-time
Calculate all of the block member offsets, the IndexNames, and
everything else to do with every UBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
681df909e3 glsl: Add a visitor to determine whether a uniform block is ever used
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
d1b4960f9b glsl: Lower UBO references using link-time data instead of compile-time data
Pretty much all of the compile-time, per-compilation unit block data is
about to get the axe.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
90b1dd03e5 glsl: Add gl_uniform_buffer_variable::IndexName field
glGetUniformIndices requires that the block instance index not be
present in the name of queried uniforms.  However,
gl_uniform_buffer_variable::Name will include the instance index.  The
IndexName field is added to handle this difference.

Note that currently IndexName will always point to the same string as
Name.  This will change soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
11d42de681 glsl: Make the align function available elsewhere in the linker
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
e2c95cd674 glsl: Calculate link-time uniform block data without using compile-time block data
Pretty much all of the compile-time, per-compilation unit block data is
about to get the axe.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
bd963e12ef glsl: Assert that interfaces, like structures, are not seen as leaf types
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
99b8935ce2 glsl: Add new uniform_field_visitor::process variant
This flavor takes a type and a base name.  It will be used to handle
cases where the block name (instead of the instance name) is used for an
interface block.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
007de494d2 glsl: Recurse into uniform blocks just like uniform structures
v2: Inspite of the spell checker, spell recurse correctly.  Suggested by
Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
25e75b0a13 glsl: Handle instance array declarations
v2: Add a comment and an assertion about the array size in the
non-instance name case.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
5383661092 glsl: Track blocks in the symbol table using the glsl_type instead of the gl_uniform_block
Eventually the gl_uniform_block information won't be calculated until
linking.  Block names need to be checked for name clashes during
compiling, so we have to track it differently.

v2: Update the commit message.  Suggested by Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
9a204bb9f6 glsl: Add new uniform_field_visitor::visit_field variant
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
141e9d42f5 glsl: Modify uniform_field_visitor::visit_field to take a row_major parameter
Not used yet, but the UBO layout visitor will use this.

v2: Remove a spruious hunk.  This is moved to the patch "glsl: Remove
ir_variable::uniform_block".  Suggested by Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
6a0c1bc163 glsl: Modify uniform_field_visitor::recursion to take a row_major parameter
Not used yet, but the UBO layout visitor will use this.

v2: Add some commentary as to why row_major is always set to false in
process.  Suggesed by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
23b7ce3a82 glsl: Add a predicate to determine whether a variable is an interface block
For the first declaration below, there will be an ir_variable named
"instance" whose type and whose instance_type will be the same
glsl_type.  For the second declaration, there will be an ir_variable
named "f" whose type is float and whose instance_type is B2.

"instance" is an interface instance variable, but "f" is not.

uniform B1 {
    float f;
} instance;

uniform B2 {
    float f;
};

v2: Copy the comment message documentation into the code.  Suggested by
Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
3b09603dda glsl: Require that indices into uniform block arrays be constants
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
7a7b44b329 glsl: Add ir_variable::interface_type field
For variables that are in an interface block or are an instance of an
interface block, this is the GLSL_TYPE_INTERFACE type for that block.

Convert the ir_variable::is_in_uniform_block method added in the
previous commit to use this field instead of ir_variable::uniform_block.

v2: Fix the place-holder comment on ir_variable::interface_type.
Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
13be1f4a10 glsl: Add ir_variable::is_in_uniform_block predicate
The way a variable is tested for this property is about to change, and
this makes the code easier to modify.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
17e6f19044 glsl: Generate an interface type for uniform blocks
If the block has an instance name, add the instance name to the symbol
table instead of the individual fields.

Fixes the piglit test interface-name-access-without-interface-name.vert
for real.

v2: Update the comment before the assertion that interface block
definitions won't generate instructions.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 09:07:33 -05:00
Ian Romanick
491364e1f3 glsl: Add GLSL_TYPE_INTERFACE
Interfaces are structurally identical to structures from the compiler's
point of view.  They have some additional restrictions, and generally
GPUs use different instructions to access them.  Using a different base
type should make this a bit easier.

This commit also adds the glsl_type::interface_packing fields.  For
GLSL_TYPE_INTERFACE types, this will track the specified packing mode.
It is analogous to gl_uniform_buffer::_Packing.

v2: Add serveral missing GLSL_TYPE_INTERFACE cases in switch-statements.

v3: Add information about glsl_type::interface_packing.  Move row_major
checking in glsl_type::record_key_compare from this patch to the
previous patch.  Both suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
7f96a8471e glsl: Add row_major field to glsl_struct_field
For now, this will always be false.  In the near future, an "interface"
type will be added that shares a lot of infrastructure with structures.

v2: Move row_major checking in glsl_type::record_key_compare from the
next patch to this patch.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
51f740cd5a glsl: Refactor out processing of structure fields
This will soon also be used for processing interface block fields.

v2: Add a comment explaining the interface of
ast_process_structure_or_interface_block.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
a39a70c8d4 glsl: Parse interface array size
The size is parsed and stored in the AST, but it is not used yet.
Processing of the array size is added in the patch "glsl: Handle
instance array declarations"

v2: Update the commit message (suggested by Carl Worth).  Add a comment
to ast_uniform_block::array_size (suggested by Paul Berry).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Kenneth Graunke
34f966bdcb glsl: Parse non-array uniform block instance names in GLSL ES 3.00.
In GLSL ES 3.00 (and GLSL 1.50), uniform blocks can have an associated
"instance name", which essentially namespaces the variables inside.

This patch adds basic parsing for this new feature, but doesn't yet hook
it up to actually do anything yet.

It does not support for arrays of interface blocks; a later commit will
take care of that.

This change temporarily regresses the piglit test
interface-name-access-without-interface-name.vert.  This shader failed
to compile before (the expected result), but it failed to compile for
the wrong reason.  This is not a real regression.

v2: Add some comments to ast_uniform_block::instance_name.  Suggested by
Paul Berry.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Kenneth Graunke
0d2e6336a2 glsl: Refactor uniform block parser rules.
The existing code has a lot of duplication; the only difference between
the two cases is whether we merge in an additional layout qualifier.

Apparently creating a layout_qualifieropt rule that can be empty causes
a lot of conflicts and confusion.  However, refactoring out the guts of
the ast_uniform_block creation works fine.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
b226a058db linker: Refactor intra-stage block compatabililty testing
Also slightly change the compatibility test.  Instead of comparing the
offsets of the block variables, compare the packing mode of the blocks.
Ideally we don't want to assign the offsets until a later stage of
linking.

This is put in a new file called link_uniform_blocks.cpp.  Some new
functions related to uniform blocks are going to live in that file as
well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
9a971ab695 mesa: Track the packing mode of a UBO in gl_uniform_buffer
This allows the next patch to verify that two uniform blocks match
without first calculating the locations of the fields.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
ecfb404e8d glsl: Replace most default cases in switches on GLSL type
This makes it easier to find switch-statements that need to be updated
after a new GLSL_TYPE_* is added because the compiler will generate a
warning.

Switch-statements that only had a small number of cases (e.g.,
everything in ir_constant_expression.cpp) were not modified.  I may
regret that decision when we eventually add support for doubles.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:32 -05:00
Eric Anholt
416326e337 i965: Correct gen6+ guardband calculation.
Too much attention was paid to the first paragraphs, and not enough to
the last little note that "oh, by the way, the rendered things
themselves still have to be clipped to just 8192 wide/high".

Fixes GTF's clip.c test with 4096 or higher width on ivb, where one of
the triangles got the upper half of its pixels dropped.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 09:04:52 -05:00
Kenneth Graunke
9db2098d18 i965: Use GL_RED for DEPTH_TEXTURE_MODE in ES 3.0 for unsized formats.
Khronos has apparently decided that depth textures with sized formats
(allowed with ARB_internalformat_query or ES 3.0) should be treated as
GL_RED, while unsized formats (an existing feature) should be treated
as GL_INTENSITY for compatibility with ES 2.0.

Ian is proposing changes to ARB_internalformat_query which will make
this actually legal and consistent.

A similar problem exists with GL 4.2, but we're going to ignore that
for the time being.

Tested on Ivybridge: no Piglit regressions; fixes 4 es3conform tests:
- depth_texture_fbo
- depth_texture_fbo_clear
- depth_texture_teximage
- depth_texture_texsubimage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 09:04:25 -05:00
Chad Versace
7638ede4ce i965: Bump maximum supported ES2 context version to 3.0
Since patch "i965: Validate requested GLES context version in
brwCreateContext", we have been able to create ES 3.0 contexts due to the
max version check.  So...bump the max version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-25 08:30:40 -05:00
Paul Berry
e4f661afc8 i965/Gen6+: Enable ARB_ES3_compatibility extension
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 08:30:40 -05:00
Ian Romanick
1d0e8c109c mesa/es3: Enable ES 3.0 API and shading language version
v2: Add ARB_internalformat_query to the list of required extensions.

v3: Add OES_depth_texture_cube_map to the list of required extensions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 08:30:40 -05:00
Vinson Lee
07e215f4ec scons: Add imports.c to builtin_compiler build.
Fixes build regression introduced by commit
eac030e38e.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59835
2013-01-24 22:36:27 -08:00
Chad Versace
0974031f88 i965/fs/gen7: Fix fatal typo in unpackHalf2x16
s/src/src_w/

That little typo, which sneaked into v4 of the previous patch, generates
incorrect fs code.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:51:06 -08:00
Chad Versace
20dfa501b3 i965/fs/gen7: Emit code for GLSL 3.00 pack/unpack operations (v4)
v2: Remove lewd comment. [for idr]
v3: - Optimize away tmp register for packHalf2x16. [for anholt, paul]
    - Improve comments. [for anholt, paul]
    - Reduce near-duplicate code by removing vec4_visitor emit_pack/unpack
      methods. [for chadv]
v4: Factor our UD/W register conversion into helper function. [for anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:31:06 -08:00
Chad Versace
203c12b18f i965/vs/gen7: Emit code for GLSL ES 3.00 pack/unpack operations (v3)
FIXME: This patch emits VS code that violates documented hardware
restrictions and then relies on undocumented behavior that results from
that violation.  This patch passes all tests, but should be fixed ASAP to
conform to the hardware documentation.

v2: Explain undocumented hardware behavior. Improve comments.
v3: Use ALU1 helper methods F32TO16() and F16TO32(). [for anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:11 -08:00
Chad Versace
7093558b31 i965: Quote the PRM on a HorzStride subtlety
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:11 -08:00
Chad Versace
7e21910f23 i965: Add opcodes for F32TO16 and F16TO32
The GLSL ES 3.00 operations packHalf2x16 and unpackHalf2x16 will emit
these opcodes.

- Define the opcodes BRW_OPCODE_{F32TO16,F16TO32}.
- Add the opcodes to the brw_disasm table.
- Define convenience functions brw_{F32TO16,F16TO32}.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
ee0ed52d69 i965: Lower the GLSL ES 3.00 pack/unpack operations (v2)
On gen < 7, we fully lower all operations to arithmetic and bitwise
operations.

On gen >= 7, we fully lower the Snorm2x16 and Unorm2x16 operations, and
partially lower the Half2x16 operations.

v2:
  - Comment that scalarization is needed only for SOA code [for idr].
  - Replace switch-statement with if-statement [for idr].
  - Remove misplaced hunk from previous patch [found by idr].

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
b9f56ea923 glsl: Add lowering pass for GLSL ES 3.00 pack/unpack operations (v4)
Lower them to arithmetic and bit manipulation expressions.

v2: Rewrite using ir_builder [for idr].
v3: Comment typos. [for mattst88]
v4: Fix arithmetic error in comments.
    Factor out a shift instruction.
    Don't heap allocate factory.instructions.
    [for paul]

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Matt Tuner <mattst88@gmail.com> (v3)
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v4)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
9d7931ddf0 glsl: Fix type-deduction for and/or/xor expressions
In ir_expression's constructor, the cases for {bit,logic}_{and,or,xor}
failed to handle the case when both operands were vectors.

Note: This is a candidate for the stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
ccf87f2199 glsl: Reformat and/or/xor cases in ir_expression ctor
Replace tabs with spaces. According to docs/devinfo.html, Mesa's
indetation style is:
  indent -br -i3 -npcs --no-tabs infile.c -o outfile.c

This patch prevents whitespace weirdness in the next patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
f859e4fbd1 glsl/ir_builder: Add helpers for making if-statements
Add two overloaded variants of
    ir_if *if_tree()

The new functions allow one to chain together if-trees within a single C++
expression that resembles a real if-statement.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
a32bc53029 glsl/ir_builder: Add enum writemask
Using this enum improves the readibility of calls to assign(), whose third
argument is a writemask.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
a6479ef968 glsl/ir_factory: Add helper method for making an ir_constant
Add method ir_factory::constant.  This little method constructs an
ir_constant using the factory's mem_ctx.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
5790174e37 glsl/ir_builder: Add more helpers for constructing expressions
Add the following functions, each of which construct the similarly named
ir expression:
    div, round_even, clamp

    equal, less, greater, lequal, gequal

    logic_not, logic_and, logic_or

    bit_not, bit_or, bit_and, lshift, rshift

    f2i, i2f, f2u, u2f, i2u, u2i

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
fafcbf52b7 glsl/ir_factory: Initialize members to NULL in constructor
This eliminates unexpected behavior due to unitialized values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
542c7a3022 glsl: Evaluate constant GLSL ES 3.00 pack/unpack expressions (v3)
That is, evaluate constant expressions of the following functions:
  packSnorm2x16  unpackSnorm2x16
  packUnorm2x16  unpackUnorm2x16
  packHalf2x16   unpackHalf2x16

v2: Reuse _mesa_pack_float_to_half and its inverse to evaluate
    pack/unpackHalf2x16. [for idr]
v3: Whitespace fixes. [for mattst88]
    Don't cast neg floats directly to uint16; use an intermediate cast to
    int16. [for paul]

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
529b6d1f3d mesa: Remove rounding bias in _mesa_float_to_half()
Not all float32 values can be exactly represented as a float16.
_mesa_float_to_half() rounded such intermediate float32 values to zero by
truncating unrepresentable bits in the mantissa.

This patch improves _mesa_float_to_half() by rounding intermediate float32
values to the nearest float16; when the float32 is exactly between two
float16 values we round to the one with an even mantissa. This behavior is
preferred over the old behavior because:
  - It has reduced bias relative to the old behavior.

  - It reproduces the behavior of real hardware: opcode F32TO16 in
    Intel's GPU ISA.

  - By reproducing the behavior of the GPU (at least on Intel hardware),
    compile-time evaluation of constant packHalf2x16 GLSL expressions will
    result in the same value as if the expression were executed on the GPU.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
eac030e38e mesa,glsl: Move round_to_even() from glsl to mesa/main (v2)
Move round_to_even's definition to mesa/main so that _mesa_float_to_half()
can use it in order to eliminate rounding bias.

In additon to moving the fuction definition, prefix its name with "_mesa",
just as all other functions in mesa/main are prefixed.

v2: Fix Android build.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:07 -08:00
Chad Versace
1fafd00839 glsl/standalone_scaffolding: Add stub for _mesa_warning()
A subsequent patch will add mesa/main/imports.c as a dependency to the
compiler, which in turn requires that _mesa_warning() be defined.

The real definition of _mesa_warning() is in mesa/main/errors.c, but to
pull that file into the standalone scaffolding would require transitively
pulling in the dispatch tables.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
ee5921ad0d glsl: Extend ir_expression_operation for GLSL 3.00 pack/unpack functions (v2)
For each function {pack,unpack}{Snorm,Unorm,Half}2x16, add a corresponding
opcode to enum ir_expression_operation.  Validate the new opcodes in
ir_validate.cpp.

Also, add opcodes for scalarized variants of the Half2x16 functions.  (The
code generator for the i965 fragment shader requires that all vector
operations be scalarized.  A lowering pass, to be added later, will
scalarize the Half2x16 functions).

v2: Fix assertion message in ir_to_mesa [for idr].

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
3a88d71d35 glsl: Add IR lisp for GLSL ES 3.00 pack/unpack functions
For each of the following functions, add a declaration to
builtins/profiles/300es.glsl and create new file
builtins/ir/${funcname}.ir:

  packSnorm2x16  unpackSnorm2x16
  packUnorm2x16  unpackUnorm2x16
  packHalf2x16   unpackHalf2x16

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
6f8f919a53 glsl: Fix typo in comment
s/num_operands()/get_num_operands()/

Discovered because Eclipse failed to resolve the false reference.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
ca7d332253 i965/disasm: Fix horizontal stride of dest registers
The bug: The printed horizontal stride was the numerical value of the
  BRW_HORIZONTAL_$N enum.
The fix: Translate the enum before printing.

Note: This is a candidate for the stable releases.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:10:46 -08:00
Paul Berry
d1f2e9699f intel: Fix glCopyTexSubImage on buffers whose width >= 32kbytes
When possible, glCopyTexSubImage calls are performed using the
hardware blitter.  However, according to the Ivy Bridge PRM, Vol1
Part4, section 1.2.1.2 (Graphics Data Size Limitations):

    The BLT engine is capable of transferring very large quantities of
    graphics data. Any graphics data read from and written to the
    destination is permitted to represent a number of pixels that
    occupies up to 65,536 scan lines and up to 32,768 bytes per scan
    line at the destination. The maximum number of pixels that may be
    represented per scan line’s worth of graphics data depends on the
    color depth.

With an RGBA32F color buffer (which has 16 bytes per pixel) this
imposes a maximum width of 2048 pixels.  Other pixel formats have
accordingly larger limits.

To make matters worse, if the pitch of the buffer is 32k or greater,
intel_copy_texsubimage's call to intelEmitCopyBlit will overflow
intelEmitCopyBlit's src_pitch and dst_pitch parameters (which are
16-bit signed integers).

We can conveniently avoid both problems by avoiding use of the blitter
when the miptree's pitch is >= 32k.

Fixes gles3conform "framebuffer_blit_functionality_magnifying_blit"
tests when the buffer width is equal to 8192.

Note: this is very similar to the recent patch "intel: Fix ReadPixels
on buffers whose width >= 32kbytes" except that it applies to
glCopyTexSubImage instead of glReadPixels.  In a future patch it would
be nice to refactor the code so that (a) overflow is avoided, and (b)
intelEmitCopyBlit is responsible for checking whether the blitter can
handle the width, so that all callers of intelEmitCopyBlit work
properly, rather than just these two.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-24 18:35:08 -08:00
Paul Berry
c6a50ddfcb glsl: Allow varying structs in GLSL ES 3.00 and GLSL 1.50.
Previously I thought that varying structs had been added to GLSL ES
3.00 by mistake, because chapter 11 of the GLSL ES 3.00 spec
("Counting of Inputs and Outputs") failed to mention how structs
should be handled.  Khronos has clarified
(https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9828) that varying
structs are indeed required, and that chapter 11 will be modified to
indicate that the minimal reference packing algorithm flattens varying
structs to their individual components.

Mesa doesn't flatten varying structs to their individual components,
but this is ok, since it packs varyings of all kinds with no wasted
space at all (except where this is impossible due to differing
interpolation modes), so it will outperform the minimal reference
packing algorithm in all but the most pathological cases.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:49 -08:00
Paul Berry
cd53457ffa glsl: Disable transform feedback of varying structs.
It is not clear from the GLSL ES 3.00 spec how transform feedback is
supposed to apply to varying structs:

- There is no specification for how the structure is to be packed when
  it is recorded into the transform feedback buffer.

- There is no reasonable value for GetTransformFeedbackVarying to
  return as the "type" of the variable.

We currently have a Khronos bug requesting clarification on how this
feature is supposed to work
(https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9856).

This patch just disables transform feedback of varying structs for
now; we can implement the proper behaviour once we find out from
Khronos what it is.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:46 -08:00
Paul Berry
1ecd23dea9 glsl: Update lower_packed_varyings to handle varying structs.
This patch adds code to lower_packed_varyings to handle varyings of
type struct.  Varying structs are currently packed in the most naive
possible way (in declaration order, with no gaps), so there is a
potential loss of runtime efficiency.  In a later patch it would be
nice to replace this with a "flattening" approach (wherein a varying
struct is flattened to individual varyings corresponding to each of
its structure elements), so that the linker can align each structure
element independently.  However, that would require a significantly
more complex implementation.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:43 -08:00
Paul Berry
88e4bfde26 glsl: Generalize compute_packing_order for varying structs.
This patch paves the way for allowing varying structs by generalizing
varying_matches::compute_packing_order to handle any type of varying.
Previously, we packed in the order (vec4, vec2, float, vec3), with
matrices being packed according to the size of their columns.  Now, we
pack everything according to its number of components mod 4, in the
order (0, 2, 1, 3).

There is no behavioural change for vectors.  Matrices are now packed
slightly differently:

- mat2x2 gets assigned PACKING_ORDER_VEC4 instead of
  PACKING_ORDER_VEC2.  This is slightly better, because it guarantees
  that the matrix occupies a single varying slot.

- mat2x3 gets assigned PACKING_ORDER_VEC2 instead of
  PACKING_ORDER_VEC3.  This is kind of a wash.  Previously, mat2x3 had
  a 25% chance of having neither of its columns double parked, a 50%
  chance of having exactly one of its columns double parked, and a 25%
  chance of having both of its columns double parked.  Now it always
  has exactly one of its columns double parked.

- mat3x3 gets assigned PACKING_ORDER_SCALAR instead of
  PACKING_ORDER_VEC3.  This doesn't affect much, since in both cases
  there is no guarantee of how the matrix will be aligned.

- mat4x2 gets assigned PACKING_ORDER_VEC4 instead of
  PACKING_ORDER_VEC2.  This is slightly better for the same reason as
  in mat2x2.

- mat4x3 gets assigned PACKING_ORDER_VEC4 instead of
  PACKING_ORDER_VEC3.  This is slightly better for the same reason as
  in mat2x2.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:40 -08:00
Paul Berry
3680864c0b glsl: Disable structure splitting for shader ins/outs.
Previously, it didn't matter whether structure splitting tried to
split shader ins/outs, because structs were prohibited from being used
for shader ins/outs.  However, GLSL 3.00 ES supports varying structs.
In order for varying structs to work, we need to make sure that
structure splitting doesn't get applied to them, because if it does,
then the linker won't be able to match up varyings properly.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:37 -08:00
Paul Berry
42a29d89fd glsl: Eliminate ambiguity between function ins/outs and shader ins/outs
This patch replaces the three ir_variable_mode enums:

- ir_var_in
- ir_var_out
- ir_var_inout

with the following five:

- ir_var_shader_in
- ir_var_shader_out
- ir_var_function_in
- ir_var_function_out
- ir_var_function_inout

This eliminates a frustrating ambiguity: it used to be impossible to
tell whether an ir_var_{in,out} variable was a shader in/out or a
function in/out without seeing where the variable was declared in the
IR.  This complicated some optimization and lowering passes, and would
have become a problem for implementing varying structs.

In the lisp-style serialization of GLSL IR to strings performed by
ir_print_visitor.cpp and ir_reader.cpp, I've retained the names "in",
"out", and "inout" for function parameters, to avoid introducing code
churn to the src/glsl/builtins/ir/ directory.

Note: a couple of comments in the code seemed to indicate that we were
planning for a possible future in which geometry shaders could have
shader-scope inout variables.  Our GLSL grammar rejects shader-scope
inout variables, and I've been unable to find any evidence in the GLSL
standards documents (or extensions) that this will ever be allowed, so
I've eliminated these comments.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:30 -08:00
Paul Berry
7d51ead56e glsl: Clean up case statement in builtin_variables.cpp's add_variable.
The case statement purported to handle the addition of ir_var_const_in
and ir_var_inout builtin variables.  But no such variables exist.
This patch removes the unnecessary cases, and adds a comment
explaining why they're not needed.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:27 -08:00
Kenneth Graunke
fce9e5d41b i965/vs: Do headerless texturing for texelFetchOffset().
For texelFetchOffset(), we just add the texel offsets to the coordinate
rather than using the message header's offset fields.  So we don't
actually need a header on Gen5+.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 15:19:08 -08:00
Matt Turner
0412864ae8 libgl-xlib/build: Link with C++ when LLVM is used
Also link-in libX11 and libXext.

Tested-by: Brian Paul <brianp@vmware.com>
2013-01-24 14:00:27 -08:00
Paul Berry
b50c0feb2c intel: Fix ReadPixels on buffers whose width >= 32kbytes
When possible, glReadPixels calls are performed using the hardware
blitter.  However, according to the Ivy Bridge PRM, Vol1 Part4,
section 1.2.1.2 (Graphics Data Size Limitations):

    The BLT engine is capable of transferring very large quantities of
    graphics data. Any graphics data read from and written to the
    destination is permitted to represent a number of pixels that
    occupies up to 65,536 scan lines and up to 32,768 bytes per scan
    line at the destination. The maximum number of pixels that may be
    represented per scan line’s worth of graphics data depends on the
    color depth.

With an RGBA32F color buffer (which has 16 bytes per pixel) this
imposes a maximum width of 2048 pixels.

To make matters worse, if the pitch of the buffer is 32k or greater,
intel_miptree_map_blit's call to intelEmitCopyBlit will overflow
intelEmitCopyBlit's src_pitch and dst_pitch parameters (which are
16-bit signed integers).

We can conveniently avoid both problems by avoiding the readpixels
blit path when the miptree's pitch is >= 32k.

Fixes gles3conform "half_float" tests when the buffer width is greater
than 2048.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-24 13:17:07 -08:00
Ian Romanick
ac158f8ee7 intel: callocing a 32 byte temp is silly, so don't
I believe that the size used to vary, so the dynamic allocation is
necessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-24 13:57:46 -05:00
Marek Olšák
7a23029b2f st/mesa: implement ARB_internalformat_query v2
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 18:39:28 +01:00
Marek Olšák
041234ee1e st/mesa: advertise OES_depth_texture_cube_map if GLSL 1.30 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 18:38:49 +01:00
Marek Olšák
4f0563a658 st/dri: disallow recursion in dri_flush
ST_FLUSH_FRONT may call driThrottle, which is implemented with dri_flush.
This prevents double flush as well as fence leaks caused by a recursion
in the middle of throttling.

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

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 18:22:14 +01:00
Marek Olšák
fffe3e0908 st/dri: add null-pointer check, remove duplicated local variable
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 18:22:14 +01:00
Tom Stellard
0261b4ecdb Revert "Revert "targets/opencl: Link against libgallium.la instead of libgallium.a""
This reverts commit 7824ab8070.

Now that we force linking with LLVM shared libs when building clover,
we can link against libgallium.la with no problems.
2013-01-24 15:45:32 +00:00
Tom Stellard
cf69a591e1 configure.ac: Force use of LLVM shared libs with --enable-opencl v2
If we build clover with LLVM static libraries, then clover and also each
pipe_*.so driver that is built will contain their own static copy of
LLVM.  The recent automake changes have uncovered a problem where
the pipe_*.so drivers try to use clover's LLVM symbols.  This causes
LLVM's static registry objects to be initialized each time
a pipe_*.so driver is loaded by clover.  Initializing these objects
multiple times is not allowed and leads to assertion failures in the
LLVM code.

We can avoid all these problems by having clover and all the pipe_*.so
drivers link against the same LLVM shared library.

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

v2:
  - Fix shared library detection when LLVM is built with CMake
2013-01-24 15:45:18 +00:00
Tom Stellard
69d639ba8b configure.ac: Compute the required llvm static libraries only once
In order to determine which static LLVM libraries are needed we pass
a list of components to llvm-config and it generates the list of
library dependencies for us.  The advantage of only calling llvm-config
one time is that it can determine if two components depend on the same
library and then add it to the output list only once.  The old practice
of having each driver call llvm-config to add its own dependencies to
$(LLVM_LIBS) caused many libraries to be added to this variable multiple
times.
2013-01-24 15:44:53 +00:00
Michel Dänzer
35f0dc2cc7 radeonsi: Fall back to dummy pixel shader instead of trying indirect addressing.
Indirect addressing isn't fully handled yet.

Fixes crashes with piglit tests using indirect addressing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:48 +01:00
Marek Olšák
68cebb9a8f radeonsi: make sure copying of all texture formats is accelerated
[ Cherry-picked from r600g commit 7c371f4695 ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:31 +01:00
Michel Dänzer
de4e448095 radeonsi: Handle PIPE_FORMAT_L32A32_S/UINT for rendering.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:31 +01:00
Michel Dänzer
d0096dfa85 radeonsi: Make sure to use float number format for packed float colour formats.
These aren't covered by UTIL_FORMAT_TYPE_FLOAT.

Fixes 15 piglit (sub)tests.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:31 +01:00
Ian Romanick
5bd86b26df intel: Enable S3TC extensions always
Always enable the use of pre-compressed texture data.  The ability to
perform on-line compression still requires the presence of libtxc_dxtn
or an explicit driconf over-ride.  Applications that just want to submit
precompessed data when an on-line compressor is not available can look
for the GL_EXT_texture_compression_dxt1 and
GL_ANGLE_texture_compression_dxt[35] extensions.

v2: Only enable the extensions that do not require on-line compression
by default.  The previous statement "This should not impact many (if
any) real applications." proved to be false for at least Sauerbraten.
This application mostly submits pre-compressed data, but it also can
submit uncompressed data that it asks the driver to compress.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Acked-by: Eric Anholt <eric@anholt.net> [v1]
Acked-by: Lee Salzman <lsalzman@gmail.com>
2013-01-23 23:38:04 -05:00
Ian Romanick
53f8251107 mesa: Like EXT_texture_compression_dxt1, advertise ANGLE_texture_compression_dxt in all APIs
This is technically outside the ANGLE spec, but it seems unlikely to
cause any harm.

v2: Simplify the extension checks by assuming the ANGLE extension will
always be enabled by any driver that enables the EXT.  Suggested by
Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Lee Salzman <lsalzman@gmail.com>
2013-01-23 23:38:04 -05:00
Ian Romanick
d45c6c817d mesa: Simplify _mesa_choose_tex_format handling of compressed formats
For non-generic compressed format we assert two things:

1. The format has already been validated against the set of available
   extensions.

2. The driver only enables the extension if it supports all of the
   formats that are part of that extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 23:38:04 -05:00
Ian Romanick
a021881ccd mesa: Use a single flag for the S3TC extensions that don't require on-line compression
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Lee Salzman <lsalzman@gmail.com>
2013-01-23 23:38:04 -05:00
Carl Worth
8059c2ea90 i965: Use swizzles to force R, G, and B to 0.0 for ALPHA textures.
Similar to the previous commit, we may be using a texture with actual RGBA
storage for the GL_ALPHA format, so force the color values to 0.0.

This commit fixes the following piglit (sub) tests:

	EXT_texture_snorm/fbo-blending-formats
		GL_ALPHA16_SNORM
	        GL_ALPHA8_SNORM
		GL_ALPHA_SNORM

Note: Haswell bypasses this swizzle code, so may require an independent fix
for this bug.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 17:41:09 -08:00
Carl Worth
33599433c7 i965: Use swizzles to force alpha to 1.0 for RED, RG, or RGB textures.
We may be using a texture with actual RGBA storage for these formats, so force
the alpha value read to 1.0.

This commit fixes the following piglit (sub) tests:

	ARB_texture_float/fb-blending-formats
		GL_RGB16F_ARB
	EXT_framebuffer_object/fbo-blending-formats
                GL_RGB10
		GL_RGB12
	        GL_RGB16
	EXT_texture_snorm/fbo-blending-formats
		GL_RGB16_SNORM
		GL_RGB8_SNORM
		GL_RGB_SNORM

These test improvements depend on the previous commit as well. That commit
smashes alpha to 1.0 for the case of ReadPixels (so fixes "FBO testing" as
reported by this test), while this commit smashes alpha to 1.0 for the case of
texturing (fixed the "window testing" as reported by this test).

Note: Haswell bypasses this swizzle code, so may require an independent fix
for this bug.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 17:40:52 -08:00
Carl Worth
570ed2be7d ReadPixels: Force ALPHA to 1 while rebasing RGBA values for GL_RGB format
When performing a ReadPixels operation, we may be reading from a buffer that
stores alpha values, but that is actually representing a buffer with no alpha
channel. In this case, while rebasing the values, touch up all alpha values
read to 1.0.

This commit fixes the following piglit (sub) tests:

	ARB_texture_float/fbo-colormask-formats
		GL_RBG16F_ARB
	EXT_texture_snorm/fbo-colormask-formats
		GL_RGB16_SNORM
		GL_RGB8_SNORM
		GL_RGB_SNORM

It likely improves the results of other tests as well, but a PASS remains
elusive due to additional bugs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-23 17:40:52 -08:00
Carl Worth
b961ba44ed i965: Examine _BaseFormat when deciding to perform xRGB_alpha fixups
The renderbuffer's Format field may have an alpha channel even when the
underlying _BaseFormat does not. This can happen when mesa chooses to use
RGBA16 for an RGB16 format, for example.

So look at _BaseFormat when deciding whether to fixup the blend factors.

This test improves the results of at least the following piglit tests:

	EXT_frambebuffer_object/fbo-blending-formats
        	{GL_RGB10, GL_RGB12, GL_RGB16}
	EXT_texture_snorm/fbo-blending-formats
		{GL_RGB16_SNORM, GLRGB8_SNORM, GL_RGB_SNORM}

But none of these actually change from FAIL to PASS yet. The R, G, and B probe
values are fixed with this commit, but the tests still fail because the alpha
values are still wrong.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 17:40:24 -08:00
José Fonseca
0642437606 scons: Fix source lists parsing on Windows.
/ vs \ mismatch was causing .objs to be put in the source tree, causing
breakeage when doing different build types in the same tree (eg., debug
vs release).

Fix this by normalizing everything to / slashes.

It's probably a good idea to purge all .objs from source tree to prevent
issues completely.
2013-01-23 12:11:53 +00:00
Matt Turner
60315e3eaf GL3.txt: i965 supports ARB_base_instance
Added in commit cdd3f549.
2013-01-22 21:34:25 -08:00
Brian Paul
bd8045d4c5 wmesa: include api_exec.h to fix compilation 2013-01-22 16:44:11 -07:00
Brian Paul
26a05b5005 draw: fix MSVC divide-by-zero compilation error
Kind of lame, but it works.
2013-01-22 16:44:11 -07:00
Kenneth Graunke
cdd3f5496a i965: Implement the GL_ARB_base_instance extension.
Thanks to Fredrik Höglund, all the hard work was already done.

Tested using a modified oglconform (that actually runs these tests on
our driver); it looks like there may be some bugs when using client
arrays.  All applicable non-compatibility tests passed.

For now, only enable it in core profiles.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ian Romanick <idr@freedesktop.org>
2013-01-22 15:41:30 -08:00
Matt Turner
0d108116bd glsl/build: Build libglcpp and libglslcore in builtin_compiler
And reuse them if not cross compiling.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:45 -08:00
Matt Turner
952e6e9f3b glsl/Makefile.sources: Correct BUILTIN_COMPILER_CXX_FILES
Squashed with two reverts:

Revert "android: Update for builtin_stubs.cpp move"

This reverts commit c0def90ede.

Revert "scons: Update for builtin_stubs.cpp"

This reverts commit 8ac4b82699.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Tested-on-Android-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-22 14:33:41 -08:00
Matt Turner
2a71054396 build: Use AX_PROG_FLEX
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47248
2013-01-22 14:33:38 -08:00
Matt Turner
b68b85224d build: Use AX_PROG_BISON
No one tests yacc/byacc. Let's just request bison specifically.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46815
2013-01-22 14:33:31 -08:00
Matt Turner
3791ce05eb builtin_compiler/build: Use generated parser files
... instead of generating them again.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:28 -08:00
Matt Turner
efd201caa5 glsl/build: Build tests via the glsl Makefile
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:24 -08:00
Matt Turner
86d30dea3c glsl/build: Build glcpp via the glsl Makefile
Removing the subdirectory recursion provides a small speed up.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:20 -08:00
Matt Turner
cc9f609cb9 glsl/build: Don't build builtin_compiler separately if not cross compiling
Reduces the number of times that src/glsl/ is compiled when not cross
compiling.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:16 -08:00
Matt Turner
569f0e400a glsl/build: Don't build glsl_compiler
Use glslparsertest from piglit instead.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:07 -08:00
Brian Paul
ab74fee5e1 draw: fix problem in screen-space interpolation clip code
I don't see how this could have ever worked right.

The screen-space interpolation code uses the vertex->data[pos_attr]
position which contain window coords.  But window coords are only
computed for the unclipped vertices; the clipped vertices have
undefined window coords (see draw_cliptest_tmp.h).

Use the vertex clip coords instead which are always defined.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=55476
(piglit fbo-blit-stretch failure on softpipe)

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
ed643d6b2f draw: improve the clipper debug/printf code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
4a938ef713 draw: add new debug code and comments in clip code template
In debug builds, set clipped vertex window coordinates to NaN values
to help debugging.  Otherwise, we're just leaving the coordinate in clip
space and it's invalid to use it later expecting it to be a window coord.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
547a418888 swrast: fix blit code's nearest/linear coordinate arithmetic
Fixes piglit's fbo-blit-stretch test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
b70b486249 swrast: fix incorrect width for direct/nearest blit
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
728bf86a23 swrast: move resampleRow setup code in blit_nearest()
The resampleRow setup depends on pixelSize.  For color buffers,
we don't know the pixelSize until we're in the buffer loop.  Move
that code inside the loop.

Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=59541

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Andreas Boll
0a60ea4ddc docs: import release notes for 9.0.2, add news item 2013-01-22 21:28:51 +01:00
José Fonseca
9a0973044e scons: Disable frame pointer omission for all build types except release.
In particular for checked builds, where debug_backtrace_capture relies
on it.
2013-01-22 20:19:28 +00:00
José Fonseca
de0057caa6 nouveau/build: Fix build failures when drm is not in /usr/include.
Fixes failures to include libdrm/nouveau.h when drm is not installed in
/usr/include.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-22 19:10:47 +00:00
Michel Dänzer
a56dfd99e2 radeon/llvm: Handle LP_CHAN_ALL in emit_fetch_immediate().
Fixes piglit spec/ARB_sampler_objects/sampler-incomplete and
spec/EXT_texture_swizzle/depth_texture_mode_and_swizzle.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-22 18:50:02 +01:00
Kenneth Graunke
121d19de92 build: Fix build on systems where /usr/bin/python isn't python 2.
configure.ac sets up a PYTHON2 variable, which is what we want
AX_PYTHON_MODULE to use (since we only use Python 2 for now).

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31598
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 09:05:32 -08:00
Ian Romanick
148fc6d537 mesa/es3: Apply stricter multisample blit rules for ES3.
Fixes gles3conform
framebuffer_blit_error_blitframebuffer_multisampled_read_buffer_different_origins.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-22 03:26:24 -05:00
Ian Romanick
d7475c7966 mesa/es3: Disallow FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query of DEPTH_STENCIL_ATTACHMENT
This error was added in the 3.0.1 update to the OpenGL ES 3.0 spec.
Fixes the updated gles3conform packed_depth_stencil_parameters test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-22 03:26:24 -05:00
Ian Romanick
9cb64a4cb6 mesa: Don't allow blits to / from the same buffer in OpenGL ES 3.0
Fixes gles3conform test CoverageES30.  It temporarily regresses some
framebuffer_blit tests, but the failing subcases have been determined to
be invalid for OpenGL ES 3.0.

v2: Fix typo in depth (and stencil) RB checking.  Noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-22 03:26:24 -05:00
Eric Anholt
85c2e99039 mesa: Remove exec thunks from the dlist.c module.
These were introduced in 2000 during a rework of the TNL module (commit
cab974cf6c), though I'm having a hard time
finding an instance there of one of these Exec functions being changed
at runtime.

Regardless, as far as I can tell now, these functions don't get changed,
by grepping for calls to SET_* to change the dispatch table (we do change
functions in GLvertexformat at runtime, but those don't overlap with
this set of functions).  Remove them and just let them be initialized to
the same functions as are in the Exec table.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
ab4c549378 mesa: Initially populate the display list with the exec list.
This cuts out a ton of code to make functions not set to a save_ variant
match.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
7820e2dd8d mesa: Delay display list save dispatch setup until Exec is set up.
This will let us copy from the Exec dispatch to deal with our commands that
don't get compiled into display lists.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
be4b1664fb mesa: Make the drivers call a non-code-generated dispatch table setup.
I want to drive the Save dispatch table setup from this same function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
ced98f17ef mesa: Remove the size argument from _mesa_alloc_dispatch_table().
All callers are in Mesa core and all use _gloffset_COUNT, so just rely on
the already baked-in use of _gloffset_COUNT in the function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
cb49016622 mesa: Remove two of the now unused ASSERT_OUTSIDE_BEGIN_END macros.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
a9754793da mesa: Drop manual checks for outside begin/end.
We now have a separate dispatch table for begin/end that prevent these
functions from being entered during that time.  The
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to
change any return values or introduce new error-only stubs at this
point.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
c572251417 mesa: Install a minimal dispatch table during glBegin()/glEnd().
This is a step toward getting rid of ASSERT_OUTSIDE_BEGIN_END() in Mesa.

v2: Finish create_beginend_table() comment, move loopback API init into it,
    and add a const flag. (suggestions by Brian)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
2013-01-21 21:26:47 -08:00
Eric Anholt
0aaf0445ba mesa: Remove the dead PrepareExecBegin() driver hook.
This was used in i965 for a while, but no more.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
23916cae8e mesa: Use an early return to unindent most of vbo_exec_Begin/End().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:46 -08:00
Eric Anholt
7b3c8b3747 mesa: Improve a glTexEnv error message by looking up the enum.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:46 -08:00
Eric Anholt
4d8f72f2bc mesa: Fix regression in dlist save primitive tracking.
My change 7ca4f07b5b caused errors to not
be thrown when they should, because the new if statement for ExecuteFlag
made the CurrentSavePrimitive not get set.  And on further review, we
shouldn't be validating our primitive in GL_COMPILE mode, since the
command shouldn't be executed yet.

Partially fixes piglit gl-1.0-beginend-coverage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:46 -08:00
Maarten Lankhorst
3a91e7955a vl: round next_msc to integer frame, and kill skew_msc
This reduces jitter slightly in a cleaner way, without desynchronizing mplayer2 as badly
when falling behind.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-01-21 23:49:56 +01:00
José Fonseca
71c87e42e1 scons: Fix dependencies of generated headers.
It appears that scons implicit dependency scanners fail to chain
dependencies of generated headers when these are outside the build tree.

This patch ensures generated source files are _always_ put in the build
tree. I'm not 100% this will fix all depency issues, but from my
experiments it does seem to fix this.

NOTE: For this to be effective it is necessary to clean the source tree
from generated header/source files.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-21 19:10:54 +00:00
Ian Romanick
75b7e1df13 intel: Don't expose XRGB8888 visuals any more
There really isn't any point.  There is no resource savings, and we have
to do gymnastics in the driver to make it work.

There are also bad interactions with multisampling and OpenGL ES 3.0.
In ES3, a multisample-to-singlesample blit must have identical source
and destination format.  This means a multisample RGBA8 to singlesample
RGB8 (window) blit will generate an error.  Also in ES3, RGB8 is not a
renderable format.  This means that the application CANNOT make an RGB8
multisample renderbuffer.

As a result, if an application gets an RGB8 window and wants to do
multisample FBO rendering, it will probably break.

"Fixes" gles3conform
framebuffer_blit_functionality_multisampled_to_singlesampled_blit test
on RGB8 visuals.

v2: Fix 'formats' array size.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2013-01-21 13:34:34 -05:00
Ian Romanick
9bdf5bef76 i965: Enable floating-point textures always
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2013-01-21 11:46:21 -05:00
Marek Olšák
4a1af434e6 r300g: add a workaround for the AA colorbuffer addressing bug on R500 2013-01-21 17:00:51 +01:00
Marek Olšák
7bfbf5b287 r300g: allow resolutions up to 1280x1024 with AA optimizations on 1-pipe cards
because single-pipe cards have bigger CMASK RAM
2013-01-21 17:00:51 +01:00
Marek Olšák
b7cb655298 r300g: enable AA optimizations for the RGBA16F format 2013-01-21 17:00:51 +01:00
Marek Olšák
6f6112a2b9 radeonsi: More assorted depth/stencil changes ported from r600g.
[ Squashed port of the following r600g commits: - Michel Dänzer ]

commit 428e37c2da
Author: Marek Olšák <maraeo@gmail.com>
Date:   Tue Oct 2 22:02:54 2012 +0200

    r600g: add in-place DB decompression and texturing with DB tiling

    The decompression is done in-place and only the compressed tiles are
    decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F.

    The texture unit is programmed to use non-displayable tiling and depth
    ordering of samples, so that it can fetch the texture in the native DB format.

    The latest version of the libdrm surface allocator is required for stencil
    texturing to work. The old one didn't create the mipmap tree correctly.
    We need a separate mipmap tree for stencil, because the stencil mipmap
    offsets are not really depth offsets/4.

    There are still some known bugs, but this should save some memory and it also
    improves performance a little bit in Lightsmark (especially with low
    resolutions; tested with Radeon HD 5000).

    The DB->CB copy is still used for transfers.

commit e2f623f1d6
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jul 28 13:55:59 2012 +0200

    r600g: don't decompress depth or stencil if there isn't any

commit 43e226b6ef
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Jul 18 00:32:50 2012 +0200

    r600g: optimize uploading depth textures

    Make it only copy the portion of a depth texture being uploaded and
    not the whole 2D layer.

    There is also a little code cleanup.

commit b242adbe5c
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Jul 18 00:17:46 2012 +0200

    r600g: remove needless wrapper r600_texture_depth_flush

commit 611dd52942
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Jul 18 00:05:14 2012 +0200

    r600g: init_flushed_depth_texture should be able to report errors

commit 80755ff563
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jul 14 17:06:27 2012 +0200

    r600g: properly track which textures are depth

    This fixes the issue with have_depth_texture never being set to false.

commit fe1fd67556
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 03:10:37 2012 +0200

    r600g: don't flush depth textures set as colorbuffers

    The only case a depth buffer can be set as a color buffer is when flushing.

    That wasn't always the case, but now this code isn't required anymore.

commit 5a17d8318e
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 02:14:18 2012 +0200

    r600g: flush depth textures bound to vertex shaders

    This was missing/broken. There are also minor code cleanups.

commit dee58f94af
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 01:54:24 2012 +0200

    r600g: do fine-grained depth texture flushing

    - maintain a mask of which mipmap levels are dirty (instead of one big flag)
    - only flush what was requested at a given point and not the whole resource
      (most often only one level and one layer has to be flushed)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 15:42:28 +01:00
Vadim Girlin
bc398f908f radeonsi: improve flushed depth texture handling
Use r600_resource_texture::flished_depth_texture for GPU access, and
allocate it in the VRAM. For transfers we'll allocate texture in the GTT
and store it in the r600_transfer::staging.

Improves performance when flushed depth texture is frequently used by the
GPU, e.g. in Lightsmark

[ Ported from r600g commit 3770847960 ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 15:42:28 +01:00
Marek Olšák
bfb405ceee radeonsi: Assorted depth/stencil changes ported from r600g.
[ Squashed port of the following r600g commits: - Michel Dänzer ]

commit c1e8c845ea
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jul 7 19:10:00 2012 +0200

    r600g: inline r600_hw_copy_region

commit 4891c5dc64
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jun 25 22:53:21 2012 +0200

    r600g: inline r600_blit_push_depth and use resource_copy_region

    We are going to have a separate resource for depth texturing and transfers
    and this is just a transfer thing.

commit da98bb6fc1
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jun 25 12:45:32 2012 +0200

    r600g: split flushed depth texture creation and flushing

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 15:42:28 +01:00
Michel Dänzer
f0ffbbc9ff radeonsi: Enable 1D tiling for non-depth resources as well.
No piglit regressions anymore thanks to fixes in libdrm_radeon and here.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 14:10:52 +01:00
Michel Dänzer
90d919fcd0 radeonsi: Fix 1D tiling mode index for non-scanout resources.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 14:10:52 +01:00
Matt Turner
a076c272e2 build: Remove dead SHARED_GLAPI variable
The static Makefiles used it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:46 -08:00
Matt Turner
3f276b37b1 glsl/build: Build glsl_test only on make check
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:44 -08:00
Matt Turner
ecbe3118c2 glsl/build: Remove dead LIBRARY_* variables
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:41 -08:00
Matt Turner
37f34e53e0 xmlpool/build: generate options.h via BUILT_SOURCES
Fixes missing options.h when doing 'make check' in dri/common before
'make' has been run.

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:20 -08:00
Jordan Justen
6c7fa72229 fbobject: add additional fbo completeness checks for GLES
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
f8e7aa2827 framebuffer: update allowed implementation format/type
Allow additional format/type combinations based on the
color render buffer to fix failures with gles3-gtf.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
ffdffd834a readpix: allow implementation format/type
For GLES2/3 allow reading of pixels with format/type based on:
 * GL_IMPLEMENTATION_COLOR_READ_FORMAT
 * GL_IMPLEMENTATION_COLOR_READ_TYPE

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
119002a648 extensions: enable EXT_color_buffer_float for ES3
[mattst88] v2: Enable only for ES3 per spec.
[mattst88] v3: Use _mesa_is_gles3 since EXT_color_buffer_float is
	       ES3-only.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Matt Turner
227f58695e extensions: Add ES3-only extension support
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
ce9118c7f0 readpix: check FBO completeness before trying to access the read-buffer
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
8b0bc9de36 readpix: add error checking for GLES3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
a793ffa0b8 copyteximage: update error checking for GLES3
Changes based on GTF/gles3 conformance test suite.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
3b51d71c85 copyteximage: check that sRGB usage is valid for GLES3 / GL
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Ian Romanick
285fe32bd9 intel: Enable GL_OES_depth_texture_cube_map
For now I'm just enabling this on the same subset of hardware that has
OpenGL 3.0 enabled.  This same functionality is part of OpenGL 3.0, and
there is no matching desktop extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:23 -05:00
Ian Romanick
1c29d8f4ff mesa/es3: Allow unsized depth and depth-stencil formats in ES3
They're part of GL_OES_depth_texture_cube_map, and we'll always enable
that extension in ES3 contexts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:20 -05:00
Ian Romanick
b3eed73c3b mesa/es2: Allow depth component cube maps in ES2 if the extension is enabled
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:18 -05:00
Ian Romanick
0f899c2da8 mesa: Add extension bit tracking for GL_OES_depth_texture_cube_map
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:01 -05:00
Adam Jackson
30530ee9ac gallium: Remove ppc asm backend
The vs part hasn't been wired up since tgsi_sse2 was disabled in:

    commit 4eb3225b38
    Author: José Fonseca <jose.r.fonseca@gmail.com>
    Date:   Tue Nov 8 00:10:47 2011 +0000

	Remove tgsi_sse2.

And it would certainly not work correctly in its current state:

draw/draw_vs_ppc.c: In function ‘draw_create_vs_ppc’:
draw/draw_vs_ppc.c:190:24: warning: assignment from incompatible pointer
type [enabled by default]

As with the sse2 backend, this should be done in llvm anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-20 17:12:47 -05:00
Andreas Boll
410b58c7bf build: require python module libxml2
configure should warn if libxml2 is not found.
libxml2 is needed by glapi/gen.

Fixes error during build in src/mapi/glapi/gen:
ImportError: No module named libxml2

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31598
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-19 23:50:39 +01:00
Vincent Lejeune
f9f5c92f73 r600g/llvm: Fixes addressspace of basevectors for clipvertex 2013-01-19 22:28:13 +01:00
Christoph Bumiller
e264b8ef41 nv50/ir: add definitions of Target and CodeEmitter dtors
I really did build test, my compiler just doesn't seem to care.
2013-01-19 22:13:45 +01:00
Christoph Bumiller
7d2d450ea6 nouveau: fix undefined behaviour when testing sample_count
NOTE: This is a candidate for the 9.0 branch.
2013-01-19 20:54:39 +01:00
Christoph Bumiller
b0863c26d4 nv50/ir: fix a couple of warnings 2013-01-19 20:54:39 +01:00
Ian Romanick
f59a3a0fe2 mesa: Array uniform name length includes length of [0]
This is required by OpenGL ES 3.0 and desktop OpenGL 4.2.  Previous
version were ambiguous.  This also matches the behavior of NVIDIA's
closed-source driver (version 304.64).

Fixed gles3conformance test uniform_buffer_object_getactiveuniformsiv
and uniform_buffer_object_structure_and_array_element_names (on my
in-progress branch that fixes a bunch of other stuff...YMMV).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
8ef3c83ffe mesa: Array uniform names are supposed to have [0] appended
This is required by OpenGL ES 3.0 and desktop OpenGL 4.2.  Previous
version were ambiguous.  This also matches the behavior of NVIDIA's
closed-source driver (version 304.64).

Fixed gles3conformance test uniform_buffer_object_getactiveuniform.

Several piglit tests expect glGetActiveUniform to *not* include the [0]
on the end.  These tests were already failing on NVIDIA, and this change
regresses them on Mesa.  Patches have been sent to the piglit mailing
list to fix the tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
5938c7774f mesa: Refactor getting a uniform's name to a helper function
We currently have a bug in this code, and I don't want to fix it in two
places.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
f26520146b glsl: Eliminate link_update_uniform_buffer_variables return value
It always returns true, so there's no point in having a return value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
bd85c75922 glsl: Remove unused loc parameter from generate_call
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
56053b0a2d mesa: Remove unused field gl_uniform_buffer_variable::Buffer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
feea85da06 linker: Use helper variable sh
This looks like a copy-and-paste left over.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:32 -08:00
Ian Romanick
db718e2472 glsl: Remove stale comment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:32 -08:00
Kenneth Graunke
4f29169913 glsl: Track UBO block names in the symbol table.
The GLSL 1.40 spec says:

    "Uniform block names and variable names declared within uniform
    blocks are scoped at the program level."

Track the block name in the symbol table and emit errors when conflicts
exist.

Fixes es3conform's uniform_buffer_object_block_name_conflict test, and
fixes the piglit block-name-clashes-with-{variable,function,struct}.vert
tests.

NOTE: This is a candidate for the 9.0 branch.

v2: Fix bad constructor initialization.  Noticed by Topi Pohjolainen.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 17:35:32 -08:00
Ian Romanick
bb47a4d081 glsl: Reject row_major and column_major on non-matrix types
About both row_major and column_major layout qualifiers, the GLSL spec
says:

    "It only affects the layout of matrices."

However, the OpenGL ES 3.0 conformance tests have taken this to mean it
is an error use it elsewhere.  This seems logical given that
'layout(row_major) vec4 foo' is probably not what the programmer meant.

The only catch is dealing with structures that contain matrices.  Layout
qualifiers cannot be applied directly to fields of structures, so the
only way to affect the layout of the fields is to apply a qualifier to
the structure declaration itself.  There is ongoing debate about this
within Khronos, and it seems to be settling in favor of allowing the
qualifiers on structures.  I light of this, I have chosen to allow the
qualifiers on structures but emit a warning since the usage may not be
portable.

Fixes gles3conform test
uniform_buffer_object_layouts_not_for_matrix_type and causes no
regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:32 -08:00
Eric Anholt
1ec1b577f7 mesa: Skip updating texgen when not doing fixed function.
Between the previous commit and this one, improves GLBenchmark 2.1
offscreen performance by 0.48% +/- 0.24% (n=22, throttling outliers
removed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 13:03:46 -08:00
Eric Anholt
078727d41c mesa: Don't bother updating ff texture state if we have a fragment shader.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 13:03:41 -08:00
Eric Anholt
b5788146ba mesa: Drop a comment about ff vertex shading and texturing.
It's never going to have texture fetches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 13:03:27 -08:00
Eric Anholt
4533a38fa8 mesa: Fix out of bounds writes when uncompressing non-block-aligned ETC1.
Fixes a crash in GLB2.1 offscreen on the glthread branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:27 -08:00
Eric Anholt
5e529d708a i965: Add support for GL_ARB_texture_buffer_object_rgb32.
Tested with piglit ARB_texture_buffer_object/formats.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:22 -08:00
Eric Anholt
582b06c2c6 i965: Add support for MESA_FORMAT_RGB_FLOAT32 surfaces.
This is for GL_ARB_texture_buffer_object_rgb32 support, but it also
causes the format to get used for float32 rgb textures as well on
Ironlake and later.  Since that came with some surprises, separate
the change from the enable commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:18 -08:00
Eric Anholt
60894edeef intel: Make intel_region's pitch be bytes instead of pixels.
We almost never want a stride in pixels -- if you're doing anything with
a stride, you're specifying an offset or incrementing a pointer, and in
both cases you had to multiply by cpp to get the bytes value you wanted.
But worse, on the way to creating a region from a new tiled BO, we
divided by cpp to get pitch in pixels, and for an RGB32 buffer (an
upcoming change) the pitch wouldn't divide exactly, and we'd end up with
a wrong stride in our region.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:13 -08:00
Eric Anholt
8fd62e80ae intel: Make intel_blit.c take pitches in bytes.
As we gain support for NPOT cpp, a pitch may not divide by cpp cleanly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:07 -08:00
Vincent Lejeune
3b14ce2caf r600g/llvm: tgsi to llvm emits store.swizzle intrinsic for vs/fs output
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:34:26 +00:00
Vincent Lejeune
7b20526466 r600g/llvm: tgsi to llvm emits stream output intrinsics.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:34:21 +00:00
Vincent Lejeune
ce34ff1ad7 r600g/llvm:translate ARL opcode to a simple cast
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:08:10 +00:00
Vadim Girlin
7d532800d8 r600g/llvm: rework handling of the constants
Vincent Lejeune:
  - tgsi to llvm now emits pointers for constants

Tom Stellard:
  - Only use texture cache for vtx fetch with compute shaders
  - Change address space used for constant loads to match LLVM
    backend.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:08:10 +00:00
Kenneth Graunke
1ee2880e86 mesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.
According to the OpenGL 3.2 Core Profile specification, section 3.8.12:

"For one-, two-, and three-dimensional and one-and two-dimensional array
 textures, a texture is mipmap complete if all of the following
 conditions hold true:
 - [...]
 - levelbase <= levelmax [...]

 Using the preceding definitions, a texture is complete unless any of
 the following conditions hold true:
 - [...]
 - The minification filter requires a mipmap (is neither NEAREST nor
   LINEAR), and the texture is not mipmap complete."

(This text also appears in all GL >= 3.2 specs and the ES 3.0 spec.)

From this, we see that levelbase <= levelmax should only affect mipmap
completeness, not base-level completeness.

Prior versions of GL did not have the notion of mipmap completeness,
simply calling the texture incomplete in this case.  But I don't think
we really care.

Fixes es3conform's sgis_texture_lod_basic_completeness test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:27 -08:00
Kenneth Graunke
f0dbd9255b i965/vs: Store texturing results into a vec4 temporary.
The sampler appears to ignore writemasks (even when correcting the
WRITEMASK_XYZW in brw_vec4_emit.cpp to the proper writemask) and just
always writes all four values.

To cope with this, just texture into a temporary, then MOV out into a
register that has the proper number of components.

NOTE: This is a candidate for stable branches.

Fixes es3conform's shadow_execution_vert.test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:27 -08:00
Kenneth Graunke
aeff9a0d98 i965/vs: Set LOD to 0 for ordinary texture() calls.
Previously it was left undefined, causing us to select a random LOD.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:26 -08:00
Kenneth Graunke
56ce55d198 i965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.
This is purely a refactor.  However, in a moment, we'll want to set
lod_type to float for ir_tex, where ir->lod_info.lod is NULL.

NOTE: This is a candidate for stable branches (for the next patch).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:26 -08:00
Kenneth Graunke
613e64060c i965: Lower textureGrad() with samplerCubeShadow on pre-Haswell.
Fixes regressions since commit 899017fc54
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Fri Jan 4 07:53:09 2013 -0800

    i965: Use Haswell's sample_d_c for textureGrad with shadow samplers.

That patch assumed that all instances were lowered.  However, we weren't
lowering textureGrad() with samplerCubeShadow because I couldn't figure
out the LOD calculations.  It turns out they're easy: you just have to
use 1 for the depth.  This causes it to pass oglconform's four tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 10:30:54 -08:00
Roland Scheidegger
d03d9b657e llvmpipe: turn on integer texture support
Now that things mostly seem to work enable those formats.
Some formats cause crashes (notably RGB8 variants) so switch these off
(these crashes are not specific to INT/UINT variants but the state tracker
doesn't use them for UNORM etc. formats so it went unnoticed so far).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Roland Scheidegger
f2a87a1f5b llvmpipe: more fixes for integer color buffers
Cast back the fake floats to ints, and make sure we don't try to do scaling
in format conversion (which only makes sense with normalized values).
Also need to disable blending and alpha test (as per spec) for such buffers.
This makes fbo-blending from the piglit ext_texture_integer tests work for most
formats (some crash, and the luminance and intensity variants have the GB or
GBA channels respectively wrong).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Roland Scheidegger
dc6bc3b642 llvmpipe: trivial code and comment cleanup.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Roland Scheidegger
8c84a82383 llvmpipe: fix using wrong format with MRT in blend code
We were passing in the rt index however this was always 0 for non-independent
blend case. (The format was only actually used to decide if the color mask
covered all channels so this went unnoticed and was discovered by accident.)
Additionally, there was a second problem because we do fixups in the key based
on color buffer format we cannot use non-independent blend anyway as the fixed
up values would never get used.
So always turn non-independent blending into independent.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Ian Romanick
ca39c0f94a mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_type
Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already
done in texture_error_check because these combinations aren't allowed on
desktop GL either.

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>
2013-01-17 10:47:46 -08:00
Ian Romanick
311cc5d973 mesa: Don't allow DEPTH_STENCIL for 3D textures
Just like DEPTH_COMPONENT.

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>
2013-01-17 10:47:42 -08:00
Brian Paul
57ddf1227f swrast: fix assorted bugs in software blit code
1. The loop over dest buffers in blit_linear() needed a null pointer
check.  Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59499

2. The code to grab the drawRb's format needs to be inside the drawing loop.

3. An equality test was using = instead of == thus messing up a
renderbuffer attachment texture pointer.  This lead to memory
corruption and a crash at exit.

Finally, fix a capitalization error NumDrawBuffers -> numDrawBuffers
and change type to unsigned to fix signed/unsigned comparison warnings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-17 09:38:54 -07:00
Michel Dänzer
51efb081f7 radeonsi: Actually keep track if we are using depth textures for samplers.
20-odd more piglits.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:21 +01:00
Michel Dänzer
3c92bfe2d2 radeonsi: Fix Z24 texture formats.
About half a dozen more piglits.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:21 +01:00
Michel Dänzer
1ace200b2b radeonsi: Set SPI_SHADER_COL_FORMAT to what the pixel shader actually exports.
Instead of deriving it from the colour buffer formats only.

Fixes a number of piglit tests which export depth from the pixel shader.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:21 +01:00
Michel Dänzer
bc5e65096d radeonsi: Use proper hardware format for stencil texturing.
Fixes piglit 'spec/ARB_depth_buffer_float/fbo-clear-formats stencil' crash.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:20 +01:00
Michel Dänzer
c486e3ef34 radeonsi: Enable tiling for depth/stencil resources.
Enabling it for all resources still seems to cause problems, but depth/stencil
buffers are always accessed with tiling by the DB block.

Also, stick to 1D tiling for now. Getting 2D tiling to work properly will
require substantial changes in libdrm_radeon and possibly the kernel as well.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:20 +01:00
Michel Dänzer
c408f0c5c4 radeonsi: Consolidate calculation of tile mode index.
Apart from the obvious cleanup, this makes sure all blocks use the same tiling
mode for accessing the resource.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:20 +01:00
Maarten Lankhorst
9ba7eac535 nvc0: add support for accelerated video decoding through the dedicated engines
Currently the use of external firmware is required, with kernel and
userspace firmware needed for all Fermi cards except nvd9. Kepler and nvd9
should only require kernel firmware.
2013-01-17 16:28:57 +01:00
Michel Dänzer
6eb0d3d863 radeonsi: Pass texture type to sampling intrinsics.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 15:47:38 +01:00
Maarten Lankhorst
edc8e8cbef nvc0: add space checks to clear functions
Thanks to calim for helping me find and fix the issue.
2013-01-17 12:37:25 +01:00
Maarten Lankhorst
5dc76c7670 nv50: add space checks to clear functions, and respect depth
Thanks to calim for helping me find and fix the issue.
2013-01-17 12:37:15 +01:00
Brian Paul
56c01d8109 st/mesa: a couple fixes for st_BlitFramebuffer()
1. Loop over multiple destination color buffers.  If we set
glDrawBuffers(GL_FRONT_AND_BACK) we need to loop over multiple color
buffers, blitting to each.

2. Add checks for null src/dst surface pointers.  This fixes a crash
in the piglit fbo-missing-attachment-blit test.
See bug http://bugs.freedesktop.org/show_bug.cgi?id=59450

Reviewed-by: Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-16 17:06:17 -07:00
Brian Paul
af7b4b01f1 st/mesa: simplify some src/dst surface setup in BlitFramebuffer
Use the renderbuffer attachment pointers that we grabbed earlier.

Reviewed-by: Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-16 17:06:17 -07:00
Brian Paul
09154c274c meta: add 'f' suffix to floats to silence some MSVC warnings 2013-01-16 17:06:17 -07:00
Brian Paul
6064810e53 mesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-16 17:06:17 -07:00
Matt Turner
99629735e7 build: Make src/gtest before src/mesa
Fixes a make check problem where libgtest.la wasn't build before tests
that want to link with it.
2013-01-16 13:31:36 -08:00
Jon TURNEY
e6e73089e5 Fix mapi code generator for out-of-tree build
Use os.path.join() rather than hand-rolling it, so path is correct if
sys.argv[0] returns an absolute path.

(According to the python documentation, it's platform dependent whether
sys.argv[0] is a full pathname or not.  It probably also depends on how
the process was started...)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-16 19:53:01 +00:00
Maarten Lankhorst
4fad211502 nvc0: Add support for video buffer 2013-01-16 17:44:09 +01:00
Maarten Lankhorst
4b8af72f96 vl/video_buffer: fix up surface ordering for the interlaced case
It seems the other code expects surface[0..1] to be the luma field in interlaced case.

See for example vdpau/surface.c vlVdpVideoSurfaceClear and vlVdpVideoSurfacePutBitsYCbCr.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-01-16 17:22:55 +01:00
Maarten Lankhorst
892c1fa8d8 vl/compositor: fix weave shader bugs
Writemask was XY instead of YZ (thanks to calim for spotting it).

The pixel calculation resulted in the pixel always being off by one.
If y was .5:

y' = round(y) + 0.5 = 1.5

Fixing this also means the LRP function has to swap the pixels it, since
it's now the other way around for top/bottom.

WIth these fixes only chroma for top and bottom pixel rows are wrongly interpolated
in my test program:

--- nvidia
+++ nouveau
@@ -1,4 +1,4 @@
-YCbCr[0] = 00c080
+YCbCr[0] = 00b070
 YCbCr[1] = 00b070
 YCbCr[2] = 029050
 YCbCr[3] = 207050
@@ -61,4 +61,4 @@
 YCbCr[60] = 0c5070
 YCbCr[61] = c05090
 YCbCr[62] = 0e70b0
-YCbCr[63] = e080c0
+YCbCr[63] = e070b0

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-01-16 17:22:45 +01:00
Brian Paul
dfcd7658c5 mesa: add new formatquery.c file to SConscript file to fix build 2013-01-16 08:18:33 -07:00
Christian König
f449948812 radeonsi/vdpau: remove nonsense state tracker dep
Added with automake conversion, but makes no sense at all.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-16 15:28:43 +01:00
Ian Romanick
1cedf7819b glapi: Remove duplicate ARB_base_instance from gl_API.xml
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 23:20:18 -08:00
Ian Romanick
3c00a52f7e intel: Enable GL_ARB_internalformat_query
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
f5e7f12e4a mesa: Add driver method to determine the possible sample counts
Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and
GL_NUM_SAMPLE_COUNTS.

v2: internalFormat may not be color renderable by the driver, so zero
can be returned as a sample count.  Require that drivers supporting the
extension provide a QuerySamplesForFormat function.  The later was
suggested by Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
bda540d235 mesa: Add dispatch and extension XML for GL_ARB_internalformat_query
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
5e4bb063f0 mesa: Add extension tracking bit for GL_ARB_internalformat_query
Though, I'm tempted to always expose this extension when
GL_ARB_framebuffer_object is exposed.  In that case, it would share the same
enable bit.

v2: Correctly sort extension names.  Suggested by Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
1b468d043e mesa: Add skeleton implementation of glGetInternalformativ
This is for the GL_ARB_internalformat_query extension and GLES 3.0.

v2: Generate GL_INVALID_OPERATION if the extension is not supported.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Vinson Lee
780c2cb42b meta: Move loop variable declaration outside for loop.
Fixes build with MSVC.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-01-15 18:03:25 -08:00
Brian Paul
7ecbbc3386 mesa: move declarations before code to fix MSVC build 2013-01-15 17:02:30 -07:00
Anuj Phogat
d0ce8d6ceb mesa: Round float param in glTexparameterf() to nearest integer
OpenGL 4.2 specification suggests rounding the float data to nearest
integer when the type of internal state is integer. Out of range floats
should be clamped to {INT_MIN, INT_MAX}. This is not specified anywhere
in gl/gles spec but below test expects this behavior.  This patch makes
gles3 conformance sgis_texture_lod_basic_getter.test pass.

A GL spec bug will be raised to include clamping of out of range floats.

V2: Round float to nearest integer for all cases where
_mesa_Texparameterf() converts float param to int. Use the same block of
float to int conversion code for GL_TEXTURE_SWIZZLE_{R,G,B,A}_EXT cases
as well.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:37 -08:00
Anuj Phogat
bed997daba mesa: Add support to allow blitting to multiple color draw buffers
This patch fixes a blitting case when drawAttachment->Texture ==
readAttachment->Texture. It was causing an assertion failure in
intel_miptree_attach_map() with gles3 conformance test case:
framebuffer_blit_functionality_minifying_blit

Number of changes in this file look scary. But most of them are caused
by introducing a big for loop to support rendering to multiple color
draw buffers.

V2: Fixed a case when number of draw buffer attachments are zero.
V3: Put a for loop in blit_nearest() and blit_linear() functions in to
    support blitting to multiple color draw buffers.
V4: Remove variable declaration in for loop to avoid MSVC compilation
    issues.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:23 -08:00
Anuj Phogat
ab36ca0614 mesa: Add error checking in _mesa_BlitFramebuffer() for MRTs
This patch adds required error checking in _mesa_BlitFramebuffer() when
blitting to multiple color render targets. It also fixes a case when
blitting to a framebuffer with renderbuffer/texture attached to
GL_COLOR_ATTACHMENT{i} (where i!=0). Earlier it skips color blitting if
nothing is found attached to GL_COLOR_ATTACHMENT0.

V2: Fixed a case when number of draw buffer attachments are zero.
V3: Do compatible_color_datatypes() and compatible_resolve_formats()
    check for all the draw renderbuffers in fbobject.c. Fix debug code
    at bottom of _mesa_BlitFramebuffer() to handle MRTs. Combine error
    checking code for linear blits with other color blit error checking.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:12 -08:00
Anuj Phogat
2f2801f876 mesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()
This allows query on default framebuffer in
glGetFramebufferAttachmentParameteriv() for gles3. Fixes unexpected GL
errors in gles3 conformance test case:
framebuffer_blit_functionality_multisampled_to_singlesampled_blit

V2: Use _mesa_is_gles3() check to restrict allowed attachment types to
specific APIs.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:03 -08:00
Anuj Phogat
b77243b9c2 intel: Support blitting to multiple color draw buffers
This patch enables blitting to multiple color attachments of a
framebuffer.  It also fixes a case when blitting to a framebuffer with
renderbuffer/texture attached to non-zero attachment point
i.e. GL_COLOR_ATTACHMENT{1, 2, ...}.  Earlier we were incorrectly
blitting to GL_COLOR_ATTACHMENT0 by default.

V2: Use intel_copy_texsubimage() for blitting only if all the color
attachments can blit using it.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:08:55 -08:00
Anuj Phogat
0c535ae7fc meta: Add functionality to do _mesa_meta_BlitFrameBuffer() using glsl
This patch rewrites _mesa_meta_BlitFrameBuffer() function to add support
for blitting with GLSL/GLSL ES shaders. These changes were required to
support glBlitFrameBuffer() in gles3. This patch, along with other
patches in this series, make 16 failing framebuffer_blit test cases in
gles3 conformance pass.

V2: Properly handle flipped blits for source and destination
    renderbuffer / textures. Add support for GL_TEXTURE_RECTANGLE in
    _mesa_meta_BlitFrameBuffer. Create a temp depth texture to support
    depth buffer blitting.
V3: Remove unsupported / redundant shader code. Add an assertion to make
    sure that we don't use rectangle texture in ES. Put API guard on
    glTexEnvi().
V4: For gles3: Don't use ReadPixels or CopyTexImage2D to blit depth
    buffer.  gles3 spec says for CopyTexImage2D that "color buffer
    components can be dropped during the conversion to internalformat,
    but new components cannot be added." So, use the internal format of
    read renderbuffer to create texture for color buffer blitting.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-15 15:08:38 -08:00
Anuj Phogat
252573ae0f mesa: Fix GL error generation in glBlitFramebuffer()
V2:
If mask has GL_STENCIL_BUFFER_BIT set, the depth formats for
readRenderBuffer and drawRenderBuffer must match unless one of the two
buffers doesn't have depth, in which case it's not blitted, so the
format check should be ignored.  Same comment goes for stencil formats
in depth renderbuffers if mask has GL_DEPTH_BUFFER_BIT set.

v3 (Kayden): Refactor code to be a bit more readable.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:08:12 -08:00
Kenneth Graunke
f727fc6304 mesa: Make ES3 glDrawBuffers() only accept BACK/NONE for the winsys fbo.
Nothing was explicitly checking this.

v2: Update GL3 spec reference.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> [v2]
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
2013-01-15 15:04:50 -08:00
Kenneth Graunke
fd3891cbbe mesa: Handle GL_BACK correctly for ES 3.0 in glDrawBuffers().
In ES 3.0, when calling glDrawBuffers() on the window system
framebuffer, the only valid targets are GL_NONE or GL_BACK.  Since there
is no stereo rendering in ES 3.0, this is a single buffer, unlike
desktop where it may be two (and thus isn't allowed).

For single-buffered configs, GL_BACK ironically means the front (and
only) buffer.  I'm not sure that it matters, however, as ES shouldn't
have front buffer rendering in the first place.

Fixes es3conform framebuffer_blit_coverage_default_draw_buffer_binding.

v2: Update GLES3 spec reference.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> [v2]
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
2013-01-15 14:59:40 -08:00
Ian Romanick
d786bf2c2a egl/dri2: Fix typo in the previous commit
I didn't notice this due to a noobed piglit run.  It wasn't previously
noticed because the patch was only run on a driver that supported GLES3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 14:19:04 -08:00
Rob Schneider
45575ff388 libgl-gdi: Avoid hangs on DLL_PROCESS_DETACH.
At process exit DLL_PROCESS_DETACH is signaled to DllMain(), where then
a final cleanup is triggered.  In stw_cleanup() code is triggered that
tries to communicate a shutdown to the spawned threads -- however at
that time those threads have already been terminated by the OS and so
the process hangs.

v2: skip stw_cleanup_thread() too

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2013-01-15 14:16:09 -08:00
Chad Versace
eb09940e55 egl/dri2: Add plumbing for EGL_OPENGL_ES3_BIT_KHR
Fixes error EGL_BAD_ATTRIBUTE in the tests below on Intel Sandybridge:
    * piglit egl-create-context-verify-gl-flavor, testcase OpenGL ES 3.0
    * gles3conform, revision 19700, when runnning GL3Tests with -fbo

This plumbing is added in order to comply with the EGL_KHR_create_context
spec. According to the EGL_KHR_create_context spec, it is illegal to call
eglCreateContext(EGL_CONTEXT_MAJOR_VERSION_KHR=3) with a config whose
EGL_RENDERABLE_TYPE does not contain the EGL_OPENGL_ES3_BIT_KHR. The
pertinent
portion of the spec is quoted below; the key word is "respectively".

  * If <config> is not a valid EGLConfig, or does not support the
    requested client API, then an EGL_BAD_CONFIG error is generated
    (this includes requesting creation of an OpenGL ES 1.x, 2.0, or
    3.0 context when the EGL_RENDERABLE_TYPE attribute of <config>
    does not contain EGL_OPENGL_ES_BIT, EGL_OPENGL_ES2_BIT, or
    EGL_OPENGL_ES3_BIT_KHR respectively).

To create this patch, I searched for all the ES2 bit plumbing by calling
`git grep "ES2_BIT\|DRI_API_GLES2" src/egl`, and then at each location
added a case for ES3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:54 -08:00
Chad Versace
26f9faa04b intel: Expose support for DRI_API_GLES3
If the hardware/driver combo supports GLES3, then set the GLES3 bit in
intel_screen's bitmask of supported DRI API's.  Neither the EGL nor GLX
layer uses the bit yet.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:54 -08:00
Chad Versace
e90c08e667 dri: Define enum __DRI_API_GLES3
This enum corresponds to EGL_OPENGL_ES3_BIT_KHR.
Neither the GLX nor EGL layer use the enum yet.

I don't like the GLES bits. I'd prefer that all GLES APIs be exposed
through a single API bit, as is done in GLX_EXT_create_context_es_profile.
But, we need this GLES3 enum in order to do the plumbing necessary to
correctly support EGL_OPENGL_ES3_BIT_KHR as required by the
EGL_KHR_create_context spec.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:53 -08:00
Chad Versace
a11fe62058 intel: Move validation of context version into intelInitContext
Each driver (i830, i915, i965) used independent but similar code to
validate the requested context version. With the rececnt arrival of GLES3,
that logic has needed an update. Rather than apply identical updates to
each drivers validation code, let's just move the validation into the
shared routine intelInitContext.

This refactor required some incidental changes to functions
i830CreateContext and intelInitContext. For each function, this patch:
    - Adds context version parameters to the signature.
    - Adds a DRI_CTX_ERROR out param to the signature.
    - Sets the DRI_CTX_ERROR at each early return.

Tested against gen6 with piglit egl-create-context-verify-gl-flavor.
Verified that this patch does not change the set of exposed EGL context
flavors.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:51 -08:00
Chad Versace
4945086f36 intel: Set screen's api mask according to hw capabilities (v3)
Before this patch, intelInitScreen2 set DRIScreen::api_mask with the hacky
heuristic below:

    if (gen >= 3)
        api_mask = GL | GLES1 | GLES2;
    else
        api_mask = 0;

This hack was likely broken on gen2 (i830), but I don't care enough to
properly investigate. It appears that every EGLConfig on i830 has
EGL_RENDERABLE_TYPE=0, and thus eglCreateContext will never succeed.
Anyway, moving on to living drivers...

With the arrival of EGL_OPENGL_ES3_BIT_KHR, this heuristic is now
insufficient. We must enable the GLES3 bit if and only if the driver is
capable of creating a GLES3 context. This requires us to determine the
maximum supported context version supported by the hardware/driver for
each api *during initialization of intel_screen*.

Therefore, this patch adds four new fields to intel_screen which indicate
the maximum supported context version for each api:
  max_gl_core_version
  max_gl_compat_version
  max_gl_es1_version
  max_gl_es2_version

The api mask is now correctly set as:

    api_mask = GL;
    if (max_gl_es1_version > 0)
        api_mask |= GLES1;
    if (max_gl_es2_version > 0)
        api_mask |= GLES2;

Tested against gen6 with piglit egl-create-context-verify-gl-flavor.
Verified that this patch does not change the set of exposed EGL context
flavors.

v2:
  - Replace the if-tree on gen with a switch, for Ian.
  - Unconditionally enable the DRI_API_OPENGL bit, for Ian.

v3:
  - Drop max gl version to 1.4 on gen3 if !has_occlusion_query,
    because occlusion queries entered core in 1.5. For Ian.

v4:
  - Drop ES2 version back to 2.0 due to rebase (Ian).

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick.intel.com>
2013-01-15 13:44:29 -08:00
Matt Turner
112e302481 mesa: Return INVALID_ENUM for glReadPixels(..., GL_DEPTH_*, ...) on ES 3
I'm not sure if this is the correct fix. The
_mesa_es_error_check_format_and_type function (used above in the ES 1
and 2 cases) was originally added for glTexImage checking and allows
GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8 combinations. Using it in ES 3
causes other tests to regress.

Fixes es3conform's packed_depth_stencil_error test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Matt Turner
2906e2034c mesa: Return INVALID_OPERATION when type is known but not allowed
INVALID_ENUM is for when the type is simply not known.

Fixes part of es3conform's packed_depth_stencil_error test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Matt Turner
c8901133a4 mesa: Allow HALF_FLOAT in glVertexAttribPointer for GLES3
Fixes es3conform's half_float_max_vertex_dimensions and
half_float_textures tests.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Matt Turner
cbef5371f6 mesa: Reject texture-only formats as renderbuffer formats in ES 3
ES 3 specifies some formats as texture-only (i.e., not available for
renderbuffers).

See the "Required Texture Formats" section (pg 126) of the ES 3 spec.

v2: Allow RED and RG float rendering in core profiles The check used to
be (version > 30) || (compat profile w/extensions).  Just deleting
<version > 30) broke 3.0+ core profiles.

Fixes es3conform's color_buffer_unsupported_format test.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Kenneth Graunke
8907b6a8e4 mesa: Fix default value of BUFFER_ACCESS_FLAGS.
According to both the GL 3.0 and ES 3.0 specifications (table 2.7 for GL
and table 2.8 for ES), the default value of BUFFER_ACCESS_FLAGS is
supposed to be zero.

Note that there are two related quantities: the obsolete BUFFER_ACCESS
enum and the new BUFFER_ACCESS_FLAGS bitfield.

BUFFER_ACCESS can only be GL_READ_ONLY, GL_WRITE_ONLY, or GL_READ_WRITE;
BUFFER_ACCESS_FLAGS can easily represent all three via GL_MAP_WRITE_BIT,
GL_MAP_READ_BIT, and their logical or.  It also supports more flags.

Thus, Mesa only stores the bitfield, and simply computes the old enum
when queried, via simplified_access_mode(bufObj->AccessFlags).

The tricky part is that, while BUFFER_ACCESS_FLAGS defaults to 0,
BUFFER_ACCESS defaults to GL_READ_WRITE for desktop [GL 3.0, table 2.8]
and GL_WRITE_ONLY_OES for ES [the GL_EXT_map_buffer_range extension].

Mesa tried to implement this by setting the default AccessFlags to
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT on desktop, and GL_MAP_WRITE_BIT on
ES.  But in all specifications, it needs to be 0.

This patch moves that logic into simplified_access_mode(): when
AccessFlags == 0, it now returns GL_READ_WRITE for desktop and
GL_WRITE_ONLY for ES 1/2.  (BUFFER_ACCESS doesn't exist on ES 3.0,
so it's irrelevant there.)

With that in place, it changes the AccessFlags default to 0.

Fixes three es3conform tsets:
- copy_buffer_defaults
- map_buffer_range_modify_indices
- pixel_buffer_object_default_parameters

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Kenneth Graunke
f3db20da1a mesa: Rework crazy error code rules in glDrawBuffers().
Perhaps most importantly, this patch adds comments quoting the relevant
spec paragraphs above each error condition.

It also makes three changes:
- For FBOs, GL_COLOR_ATTACHMENTm where m >= MaxDrawBuffers is supposed
  to generate INVALID_OPERATION (not INVALID_ENUM).
- Constants that refer to multiple buffers (such as FRONT, BACK, LEFT,
  RIGHT, and FRONT_AND_BACK) are supposed to generate INVALID_OPERATION,
  not INVALID_ENUM.
- In ES 3.0, for FBOs, buffers[i] must be NONE or GL_COLOR_ATTACHMENTi
  or else INVALID_OPERATION occurs.  (This is a new restriction.)

Fixes es3conform's draw-buffers-api test.

v2: The error path was missing a "return" like all the other error
paths.  Also, we may as well call it glDrawBuffers in the error message
since the ARB suffix doesn't exist in ES 3.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Carl Worth
d9d857e24f i965: Force even an empty query to flush all previous queries.
The specification requires that query results are processed in order, (when
one query result is returned, all previous query of the same type must also be
available). The implementation was failing this requirement in the case of
BeginQuery and EndQuery with no intervening drawing, (the result would be made
available immediately without flushing previous queries).

This fixes the following es3conform test:

	occlusion_query_query_order

as well as the following piglit test:

	occlusion_query_order

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:18 -08:00
Carl Worth
c0b768ffee meta: Allow meta operations to pause/resume an active occlusion query
This allows for avoiding the occlusion query erroneously accumulating results
during the meta operation. This functionality is made conditional on a new
MESA_META_OCCLUSION_QUERY bit so that meta-operations which should generate
fragments can continue to get the current behavior.

The implementation of glClear is specifically augmented to request the flag
since glClear is specified to not generate fragments.

This fixes the following es3conform tests:

	occlusion_query_draw_occluded.test
 	occlusion_query_clear
	occlusion_query_custom_framebuffer
	occlusion_query_stencil_test
	occlusion_query_discarded_fragments

As well as the following piglit test:

	occlusion_query_meta_no_fragments

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:18 -08:00
Carl Worth
3dd76f7168 queryobj: Add EverBound flag, making ISQuery() return false before BeginQuery()
This flag allows for the specified behavior that GenQueries reserves a name,
but does not associate an object with it until BeginQuery. We allocate the
object immediately with the new EverBound flag set to false, and then set the
flag to true at the time of BeginQuery.

This allows us to implement a conformant IsQuery function by checking the
state of the new EverBound flag.

This fixes the following es3conform tests:

	occlusion_query_genqueries
	occlusion_query_is_query_nonzero

and the following piglit test:

	occlusion_query_lifetime

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:01 -08:00
Carl Worth
c7df9c0e12 Update comment to specify actual text being referenced from the specification.
The reference to "correct, see spec" was a bit too vague to be useful,
(particularly since the language being referenced here changes between OpenGL
3.1 and OpenGL 4.3).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:10:58 -08:00
Brian Paul
133383f77a docs: minor updates to VMware guest driver docs
The DRM's --enable-vmwgfx-experimental-api flag isn't needed anymore.
2013-01-15 13:55:24 -07:00
Marek Olšák
7660529c44 r300g: fix and cleanup flushing before clearing CMASK, ZMASK, and HIZ 2013-01-15 21:50:34 +01:00
Marek Olšák
ca2c28859e r300g: implement MSAA compression and fast MSAA color clear
These are optimizations which make MSAA a lot faster.

The MSAA work is complete with this commit.  (except for enablement of AA
optimizations for RGBA16F, for which a patch is ready and waiting until
the kernel CS checker fix lands)

MSAA can't be made any faster as far as hw programming is concerned.

The catch is only one process and one colorbuffer can use the optimizations
at a time.  There usually is only one MSAA colorbuffer, so it shouldn't be
an issue.

Also, there is a limit on the size of MSAA colorbuffer resolution in terms
of megapixels.  If the limit is surpassed, the AA optimizations are disabled.
The limit is:
- 1 Mpix on low-end and some mid-level chipsets (1024x768 and 1280x720)
- 2 Mpix on some mid-level chipsets (1600x1200 and 1920x1080)
- 3 or 4 Mpix on high-end chipsets (2048x1536 or 2560x1600, respectively)
It corresponds to the number of raster pipes (= GB pipes) available, each pipe
can hold 1 Mpix of AA compression data.

If it's enabled, the driver prints to stdout:
  radeon: Acquired access to AA optimizations.
2013-01-15 21:48:58 +01:00
Marek Olšák
1dfe8eead9 gallium/util: add a half float array to util_color
For convenient packing into half floats.
2013-01-15 21:48:49 +01:00
Tom Stellard
7824ab8070 Revert "targets/opencl: Link against libgallium.la instead of libgallium.a"
This reverts commit 4148a29ed8.

This is a work-around for bug:
https://bugs.freedesktop.org/show_bug.cgi?id=59334

We really should be linking against libgallium.la instead of
libgallium.a, but until we can figure why linking against libgallium.la
causes runtime failures in clover we will continue to link against
libgallium.a

Acked-by: Andreas Boll <andreas.boll.dev@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
2013-01-15 18:04:51 +00:00
Marek Olšák
f26eb36e8b st/mesa: use a generic varying to pass the clear color to the FS
The color varying may have reduced precision or be even clamped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
355d463f73 gallium/util: fix glClear with MRT by making the FS write to all cbufs
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
2cd1407d2d st/mesa: fix InternalFormat for Z24X8 window-system buffers
This probably doesn't fix anything, but it's good to be consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
d489c90a68 st/mesa: remove dead conditional in Clear
I think the conditional always evaluates to false.

If I understand the code in core Mesa correctly, depthBits or stencilBits
is 0 if the depth or stencil renderbuffer is NULL, respectively.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
f94ea25a4a st/mesa: simplify conditionals in Clear
just check depth and stencil separately, the outcome is the same

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
01b7124788 st/mesa: fix glClear with different colormask for each colorbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
f04dd3d003 gallium: remove PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
cabe4fbb85 st/mesa: always assume separate depth and stencil clear is supported
All drivers implement it now.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
16a30e201e softpipe: implement separate depth-stencil clear
The CAP is going away.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Jon TURNEY
77dd50d020 libgl-xlib: softpipe and llvmpipe aren't mutually exclusive at link time
Since automake changes, softpipe and llvmpipe are mutually exclusive at link
time.  This doesn't make much sense to me as we can choose between them at
run-time using GALLIUM_DRIVER.

Creating library file: .libs/libGL.dll.a
.libs/xlib.o: In function `sw_screen_create_named':
/jhbuild/checkout/mesa/mesa/src/gallium/targets/libgl-xlib/../../../../src/gallium/auxiliary/target-helpers/inline_sw_helper.h:35:
undefined reference to `_softpipe_create_screen'

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 10:43:33 +00:00
Jordan Justen
8443b59a5b pack: handle GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV case
For floats, if GL_RGB is the source, then alpha should be set to
1.0F.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:52:19 -08:00
Jordan Justen
80784066cc glformats: allow GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV for GLES2/3
This format is allowed by the GL_EXT_texture_type_2_10_10_10_REV
extension.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:52:09 -08:00
Jordan Justen
ba34c1d570 copyteximage: Use Driver's AllocTextureImageBuffer instead of TexImage
Call Driver.AllocTextureImageBuffer rather than calling
Driver.TexImage with NULL data, format=GL_NONE and type=GL_NONE.

This avoids setting ctx->Unpack, which can lead to incorrectly
trying to upload data.

The GLES3 GTF program's packed_pixels_pbo test was triggering
an error for i965 with the previous code.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:50:31 -08:00
Jordan Justen
91ec623bd2 copyteximage: update signed vs. unsigned format matching
Fixes issues with gles3-gtf

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:48:14 -08:00
Jordan Justen
161a3cd9fc framebuffer: add _mesa_get_read_renderbuffer
This returns the current read renderbuffer for the specified
format type.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:48:14 -08:00
Matt Turner
f5a3d151b0 teximage: use _mesa_es3_error_check_format_and_type for GLES3
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:48:13 -08:00
Matt Turner
9cfcac4528 glformats: add _mesa_es3_error_check_format_and_type
This function checks for ES3 compatible
format/type/internalFormat/dimension combinations.

[jordan.l.justen@intel.com: additional tweaks for gles3-gtf]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:59 -08:00
Jordan Justen
cf300eaab6 fbobject: don't allow LUMINANCE/INTENSITY/ALPHA fbo on ES/Core
v2:
 * Only allow on GL Legacy contexts

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:02 -08:00
Jordan Justen
275620c4b2 fbobject: add VERBOSE=api message for renderbuffer storage
Add API debug trace message for:
 * glRenderbufferStorage
 * glRenderbufferStorageMultisample

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:02 -08:00
Jordan Justen
7f867851f5 fbobject: add VERBOSE=api message for check framebuffer status
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:02 -08:00
Brian Paul
1c9833ba70 util: add new primitive types to pipe_prim_names[] array
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-14 18:15:41 -07:00
Brian Paul
f5eb1b123f st/mesa: add some simple buffer/draw debug code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-14 18:15:41 -07:00
Brian Paul
cb6ef3d112 libgl-xlib: link with -lrt
Fixes a runtime error:

glxgears: symbol lookup error: /home/brian/mesa/lib/gallium/libGL.so.1: undefined symbol: clock_gettime

v2: use $(CLOCK_LIB) and $(PTHREAD_LIBS) per Andreas Boll.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-14 18:15:41 -07:00
Carl Worth
258453716f i965: Avoid blending with destination alpha when RB format has no alpha bits
The hardware does not support a render target without an alpha channel.
So when the user creates a render buffer with no alpha channel, there actually
is storage available for alpha internally. It requires special care to
avoid these unwanted alpha bits from causing any problems.

Specifically, when blending, and when the blend factors would read the
destination alpha values, this commit coerces the blend factors to instead be
either 0 or 1 as appropriate.

A similar fix was made for pre-gen6 hardware in commit eadd9b8e and this
commit shares the fixup function written by Ian then.

This commit the following es3conform test:

	rgb8_rgba8_rgb

As well as the following piglit (sub) tests:

	EXT_framebuffer_object/fbo-blending-formats/3
	EXT_framebuffer_object/fbo-blending-formats/GL_RGB
	EXT_framebuffer_object/fbo-blending-formats/GL_RGB8

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 15:35:37 -08:00
Kristian Høgsberg
6d4d4b00dd egl/wayland: Implement EGL_EXT_buffer_age
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-01-14 16:39:15 -05:00
Kristian Høgsberg
90804e886d egl/wayland: Pull color buffers from dri2_surf->color_buffers pool
We used to keep the color buffers in the dri_buffers array and
swap __DRI_BUFFER_BACK_LEFT and __DRI_BUFFER_FRONT_LEFT around there
and swap third_buffer in in case we needed to triple buffer.  That
gets a little fidgety with all the swaps, so lets use the
color_buffers pool like the gbm platform does.  We track the color buffers,
their corresponding wl_buffer and locked status here and just plug
a free one into dri2_surf->buffers when we need to.

This is a nice clean-up in itself, but it also sets us up to track
buffer age in the color_buffers structs.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-01-14 16:39:15 -05:00
Johannes Obermayr
dc473c5f0a gallium/svga: Make sure -std=gnu99 is set.
This is a work-around until configure.ac stops touching CFLAGS.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-14 13:32:13 -08:00
Damien Lespiau
164a04ed1b build: Fix the documented default value of --with-gallium-drivers
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-14 09:11:44 -08:00
Marek Olšák
e3e1ffb252 r300g: set a dummy vertex buffer in context_create
so that the driver doesn't crash if an app doesn't set any vertex buffers.
2013-01-14 05:58:06 +01:00
Marek Olšák
5330c5a248 r300g: fix MSAA resolve to an untiled texture
RB3D_DEBUG_CTL doesn't help, so I resolve to a tiled temporary texture and
then blitting it to the destination one, which we also do in other situations.
2013-01-14 03:12:01 +01:00
Marek Olšák
e102b665e6 r300g: advertise MSAA support for the RGB10_A2 format on r500
It seems to be working just fine.
2013-01-14 03:12:01 +01:00
Marek Olšák
5fc83101fb r300g: allow separate depth and stencil clear
The handling of the CAP is broken in st/mesa anyway. Let's just kill it.

This commit pretty much enables fast Z clear for FBOs with Z24S8.
The driver falls back to clearing with a quad if the fast clear cannot be
used. It can still do fast color clear, for example.
2013-01-14 03:11:43 +01:00
Marek Olšák
e93a5c2b86 r300g: if both Z and stencil are present, they must be fast-cleared together 2013-01-14 03:11:42 +01:00
Marek Olšák
631c631cbf r300g: allow HiZ with a 16-bit zbuffer 2013-01-14 03:11:42 +01:00
Marek Olšák
3f584c211a r300g: random hyperz cleanups 2013-01-14 03:11:42 +01:00
Marek Olšák
4d6faf5175 r300g: kill the X.Org state tracker target
This won't ever be made default and we don't need it anyway.

We should also consider doing this for other drivers.
2013-01-14 03:11:41 +01:00
Johannes Obermayr
6acef6c5f7 xmlpool: Fix out-of-tree builds.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-13 12:38:50 +01:00
Johannes Obermayr
40a9b0f5d2 gtest: Build it only for 'make check'.
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-13 12:38:44 +01:00
Johannes Obermayr
ebcabb88cf tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:38:38 +01:00
Adam Jackson
06f3a1f792 r200: Fix probable thinko in r200EmitArrays
Effectively this path would always assert.  Move the break statement to
the (probable) intended place.

Note: This is a candidate for the stable branches.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-01-13 12:38:31 +01:00
Nathan Schulte
1b8adabe2e target/dri-swrast: fix for nonstandard LLVM prefix
Include LLVM_LDFLAGS when building with LLVM.  Fixes the following build
errors:
  CXXLD  swrast_dri.la
  /usr/bin/ld: cannot find -lLLVMR600CodeGen
  /usr/bin/ld: cannot find -lLLVMR600Desc
  /usr/bin/ld: cannot find -lLLVMR600Info
  /usr/bin/ld: cannot find -lLLVMR600AsmPrinter

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:22:15 +01:00
Andreas Boll
9da454f295 targets/dri-r600: Force c++ linker in all cases
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59282
2013-01-13 12:19:29 +01:00
Andreas Boll
e09a5846cd glapi/gen: remove an obsolete comment from Makefile.am
Glapi gets generated at build time.

See commit:
0ce0f7c0c8
mesa: Remove the generated glapi from source control, and just build it.
2013-01-13 00:55:37 +01:00
Matt Turner
92ce9c38fd Remove hacks for static Makefiles
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - don't remove compatibility with scripts for the old build system

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - remove more obsolete hacks

v4: Andreas Boll <andreas.boll.dev@gmail.com>
    - add a previously removed TOP variable to fix vgapi build
2013-01-13 00:55:37 +01:00
Kenneth Graunke
8c80bdc4a8 i965: Move program_id to intel_screen instead of brw_context.
According to bug #54524, I regressed oglconform's multicontext test
when I reenabled the fragment shader precompile.

However, these test cases only passed by miraculous coincedence.  We
assign each fragment program a unique ID (brw_fragment_program::id which
becomes brw_wm_prog_key::program_string_id) which we obtain by storing a
per-context counter.

The test case uses GLX context sharing to access the same fragment
program from two different contexts.  This means that we share a program
cache.  Before the precompile, if both contexts happened to use the same
shaders in the same order, we'd obtain the same program_string_ids (by
virtue of doing the same computation twice).  However, the more likely
scenario is that they completely disagree on program_string_id.

This meant that we'd have two completely different fragment shaders in
the cache with the same ID, tricking us to think they were the same
(aside from NOS), so we'd render using the wrong program.

This patch implements a simple fix suggested by Eric: it moves the
global counter out of brw_context and into intel_screen, which is shared
across all contexts.  A mutex protects it from concurrent access.

This is also the first direct usage of pthreads in the i965 driver.

Fixes 10 subcases of oglconform's multicontext test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54524
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:36:21 -08:00
Kenneth Graunke
2c4ad502ce i965: Fix build error with clang.
Technically, variable sized arrays are a required feature of C99,
redacted to be optional in C11, and not actually part of C++ whatsoever.

Gcc allows using them in C++ unless you specify -pedantic, and Clang
appears to allow them for simple/POD types.

exec_list is arguably POD, since it doesn't have virtual methods, but I
can see why Clang would be like "meh, it's a C++ struct, say no", seeing as
it's meant to support C99.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58970
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-12 15:35:40 -08:00
Kenneth Graunke
fea648db08 i965/fs: Don't mix integer/float immediates in i2b handling.
The simulator gets very angry about our i2b code:

cmp.ne(16)      g3<1>D          g2<0,1,0>D      0F

We can't mix integer DWord and float types.  The only reason to use 0F
here was to share code with f2b.  Split it and use 0D instead.

While we don't believe anything bad will actually happen because of
this, it's nice to fix the warnings and easy enough to do.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:35:38 -08:00
Kenneth Graunke
4a6753926f i965: Add an INTEL_DEBUG=no16 option.
Often when debugging, I don't want to see SIMD16 shaders.  It makes
INTEL_DEBUG=vs/fs output much easier to read, especially when a program
dumps many shaders.  Plus, I also want to verify that SIMD8 works before
even considering SIMD16.

v2: Fix the likeliness check (caught by Chris and Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:35:38 -08:00
Alexandre Demers
67ef755908 configure.ac: Fixing common dri dependency when using dri state tracker
Fixes a regression caused by b587a7595e

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59261
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 00:13:16 +01:00
Fredrik Höglund
ac1c2b8238 st/mesa: set ctx->Const.UniformBufferOffsetAlignment
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-12 22:08:09 +01:00
José Fonseca
a3dd1ff45f scons: Update for xmlpool/options.h generation. 2013-01-12 19:00:04 +00:00
Johannes Obermayr
6bca283ad5 nv50/nvc0: Build codegen in nv50.
This is required to make libnv50 independent of libnvc0.
2013-01-12 17:14:04 +01:00
Pekka Vuorela
09a00a141f winsys/sw/wayland: Fix build to properly use wayland cflags
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59281
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-12 16:02:30 +01:00
Jordan Justen
3c3a2b51b8 texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV
Choose MESA_FORMAT_ARGB2101010 when storing
GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV or
GL_RGB + GL_UNSIGNED_INT_2_10_10_10_REV.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:46:12 -08:00
Jordan Justen
53e0f32efe texstore argb2101010: merge GL_RGBA and GL_RGB cases
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:46:02 -08:00
Jordan Justen
f1c5b5d15e glformats: support _mesa_bytes_per_pixel for 2101010+GL_RGB
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:45:01 -08:00
Jordan Justen
89e07ccf61 glformats: add _mesa_base_format_component_count
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:44:25 -08:00
Jordan Justen
6d63b6e503 glformats: add functions to detect signed/unsigned integer types
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:40:47 -08:00
Jordan Justen
2ace406b1f unpack: support unpacking MESA_FORMAT_ARGB2101010
Note: This is a candidate for the stable branches.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:40:01 -08:00
Ian Romanick
8af7d3ce9f mesa: Add extension tracking for {ARB,OES}_get_program_binary
The ARB_get_program_binary spec says "OpenGL 3.0 is required."  The
nearly identical OES_get_program_binary extension is available for
OpenGL ES 2.0, so I don't see how / why OpenGL 3.0 is a requirement for
the ARB version.  Let's just enable whenever GL_ARB_shader_objects is
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
31ca0c8be3 mesa: Add GetProgramiv support for GL_PROGRAM_BINARY_LENGTH
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
50c5fac4e2 mesa: Add Get support for PROGRAM_BINARY_FORMATS and NUM_PROGRAM_BINARY_FORMATS
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
fefd03e16c mesa: Add tracking for GL_PROGRAM_BINARY_RETRIEVABLE_HINT state
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
8e2e670007 mesa: Emit errors for geometry shader enums when ARB_gs4 is not supported
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
e3f273e2f4 glapi: Emit dispatch for {ARB,OES}_get_program_binary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
11b49dbd05 glapi: Remove spurious space from end of extension name
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
3fe747a0fe mesa: Add stub implementations of glGetProgramBinary and glProgramBinary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
ec41349a78 mesa: Fix the naming of _mesa_ProgramParameteriARB
After recent changes in the XML, the dispatch generators will expect
this function to be named _mesa_ProgramParameteri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
bb7f1a9ae8 glapi: Reorder and clean up some of the includes and comments
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
a002902168 mesa: Fix GL_SHADER_BINARY_FORMATS query
There were two bugs here.  First, this and several other queries were
not available in a desktop GL context with GL_ARB_ES2_compatibility.
Second, GL_NUM_SHADER_BINARY_FORMATS returns zero, but
GL_SHADER_BINARY_FORMATS writes one element of data to the buffer.  If
NUM is zero, no data should be written.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Dave Airlie
4f1e037acf docs/GL3.txt: update GL3 status for r600g.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-12 00:19:18 +00:00
Dave Airlie
5039ad6bc5 r600g: fix warnings for htile va
This fixes a warning about mismatched types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 23:19:11 +00:00
Dave Airlie
d23aa65001 r600g: texture buffer object + glsl 1.40 enable support (v2)
This adds TBO support to r600g, and with GLSL 1.40 enabled,
we now get 3.1 core profiles advertised for r600g.

The r600/700 implementation is a bit different from the evergreen one,
as r6/7 hw lacks vertex fetch swizzles. So we implement it by passing 5
constants per sampler to the shader, the shader uses the first 4 as masks
for each component and the 5th as the alpha value to OR in.

Now TXQ is also broken so we have to pass a constant for the buffer size,
on evergreen we just pass this, on r6/7 we pass it as the 6th element
in the const info buffer.

v1.1: drop return as DDX doesn't use a texture type
v2: add r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Dave Airlie
77c10225ee r600g: uniform buffer object support
This adds 12 more constant buffers for use as UBOs,
along with adding relative constant fetching for 2D indices.

This with GLSL 1.40 enabled passes all the same tests as softpipe
on my evergreen system.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Dave Airlie
199eea4a4b r600: always export a position from vertex shader
This fixes piglit glsl-1.40-tf-no-position from gpu hanging on my rv635
at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Carl Worth
cc5fc8bf2f glcpp: Add tests for line continuation
First we test that line continuations are honored within a comment, (as
recently changed in glcpp), then we test that line continuations can be
disabled via an option within the context. This is tested via the new support
for a test-specific command-line option passed to glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
2483039aca glcpp: Rewrite line-continuation support to act globally.
Previously, we were only supporting line-continuation backslash characters
within lines of pre-processor directives, (as per the specification). With
OpenGL 4.2 and GLES3, line continuations are now supported anywhere within a
shader.

While changing this, also fix a bug where the preprocessor was ignoring
line continuation characters when a line ended in multiple backslash
characters.

The new code is also more efficient than the old. Previously, we would
perform a ralloc copy at each newline. We now perform copies only at each
occurrence of a line-continuation.

This commit fixes the line-continuation.vert test in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
63d156900f glcpp: Add --disable-line-continuations argument to standalone glcpp
This will allow testing of disabled line-continuation on a case-by-case basis,
(with the option communicated to the preprocessor via the GL context).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
409dee5eac glcpp: Allow test-specific arguments for standalone glcpp tests
This will allow the test exercising disabled line continuations to arrange
for the --disable-line-continuations argument to be passed to the standalone
glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
0206ea3751 glcpp: Honor the GL context's DisableGLSLLineContinuations option
And simply don't call into the function that removes line continuations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
f8987f9972 glcpp: Accept pointer to GL context rather than just the API version
As the preprocessor becomes more sophisticated and gains more optional
behavior, it's easiest to just pass the GL context pointer to it so that
it can examine any fields there that it needs to (such as API version,
or the state of any driconf options, etc.).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
4b00ecebd0 drirc: Add quirk to disable GLSL line continuations for Savage2
This application is known to contain shaders that:

1. Have a stray backslash as the last line of comment lines
2. Have a declaration immediately following that line

Hence, interpreting that backslash as a line continuation causes the
declaration to be hidden and the shader fails to compile.  Fortunately, the
shaders also:

3. Do not have any other intentional line-continuation characters

So disabling line continuations entirely for the application fixes this
problem without causing any other breakage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
c0c9c9966f driconf: Add a new option: disable_glsl_line_continuations
This is to enable a quirk for Savage2 which includes a shader with a stray '\'
at the end of a comment line. Interpreting that backslash as a line
continuation will break the compilation of the shader, so we need a way to
disable this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
c6c575c69a driconf: Add proper dependency for compiling .mo files from .po files.
Previously this was happening unconditionally, leading to some excessive
rebuilding/relinking during builds.

Note that the .po files are not automatically updated due to changes to the
t_options.h file. Instead, translators should continue to use "make po"
manually. This is because after new strings are merged into the existing .po
file, manual work is still required by translators to ensure that the
translations are correct.
2013-01-11 13:54:54 -08:00
Carl Worth
b587a7595e driconf: Add translation-generation to build system, don't track generated files
Previously, the xmlpool directory had a lone Makefile to assist poeple in
manually invoking a deep make in order to update the translations in
options.h. We can observe that this wasn't happening in fact, (new
translations had been added to de.po without being generated into options.h,
and new options had been manually added directly to options.h rather than to
t_options.h).

Prevent both of these problems from occurring in the future by automatically
generating options.h as part of the standard build of mesa.

For this, the generated options.h is now removed from version control, (along
with Makefile in favor of Makefile.am).

[chadv: Port the Autotools changes to Android.]
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Carl Worth
8888c6f8e5 driconf: Fix German translations by removing a couple of bogus backslashes
As can be seen, many other translation strings already include a single
apostrophe just fine without any escaping. This strangely-escaped apostrophe
was causing a build failure ("invalid escape sequence") resulting in no "de"
translations in the final options.h file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Chad Versace
ec04617fb3 driconf: Fix gen_xmlpool.py script to allow running from any directory
The gen_xmlpool.py script would work correctly only when executed from the
directory that contained the script. This shortcoming was due to some
hard-coded paths in the script.

In order to easily invoke the script from the Android build system, we
must be able to execute the script from an arbitrary directory. To enable
that, this patch replaces the two hard-coded paths with new command line
arguments.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-11 13:54:54 -08:00
Carl Worth
11c3013610 driconf: Add some translations which have been available, but were not compiled
These translations have existed in the de.po file, but were not in the
generated options.h file. This was fixed by simply running "make options.h".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Carl Worth
bc50f02bc7 driconf: Add option definitions to source file, not generated target
For the last two most-recently-added driconf options, their definition was
manually added to options.h, a file which is intended to be automatically
generated, (as part of support for translated driconf option
descriptions). This means that these options would be eliminated if the
generation step were performed again.

Fix this by correctly adding the definitions of these options to t_options.h,
(the file used as input to the generator), and not the options.h file, which
is generated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Tom Stellard
4148a29ed8 targets/opencl: Link against libgallium.la instead of libgallium.a 2013-01-11 21:40:42 +00:00
Tom Stellard
4fc11fa3c8 drivers/radeon: Don't link against libgallium.la
This fixes several duplicate symbol errors.

libllvmradeon is a simple helper library.  If it requires symbols in
other libraries, this should be taken care of by the gallium target that
uses it (e.g. libr600.la)
2013-01-11 21:40:42 +00:00
Matt Turner
93d5fe1478 mesa: Use _mesa_lookup_enum_by_nr in tex*_error_check
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 11:45:10 -08:00
Ian Romanick
42ed81a7c3 mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEX
This requires some derived state.  The cut vertex used is either the
value specified by glPrimitiveRestartIndex or it's hard-coded to ~0.
The derived state gl_array_attrib::_RestartIndex captures this value.
In addition, the derived state gl_array_attrib::_PrimitiveRestart is set
whenever either gl_array_attrib::PrimitiveRestart or
gl_array_attrib::PrimitiveRestartFixedIndex is set.

v2: Use _mesa_is_gles3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Ian Romanick
00d8ad81ff i965: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE
We just treat this as an alias for GL_ANY_SAMPLES_PASSED.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 10:57:25 -08:00
Ian Romanick
886979a097 mesa/es3: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE query target
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Ian Romanick
8d47fe2960 mesa/es3: Allow transpose matrix uniforms in GLES3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Matt Turner
5e918a3825 glcpp: Reject token pasting operator in GLES
The GLSL ES 3.0 spec (Section 12.17) says:
"GLSL ES 1.00 removed token pasting and other functionality."

NOTE: This is a candidate for the stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-11 10:57:25 -08:00
Carl Worth
93e719ba4d glcpp: Make undefined macros illegal in #if and #elif for GLES3
Simply emitting a nicely-formatted error message if any undefined macro is
encountered in a parser context expecting an expression.

With this commit, the following piglit test now passes:

	spec/glsl-es-3.00/compiler/undefined-macro.vert

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Carl Worth
77e1bc9f1d glcpp: Add a flag to the parser state to indicate GLES.
This can be triggered either by creation of a GLES context (with
api == API_OPENGLES2) or else by a #version directive with version
value 100 or with a string of "es" following the version value.

There's no behavioral change with this commit—just preparation for ES-specific
behavior in the preprocessor in the future.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Andreas Boll
100440d1b1 glcpp: Add back tests/*.out to .gitignore
Accidentally removed in ac2793cf3e
2013-01-11 11:49:33 +01:00
Knut Andre Tidemann
8da2dab31d targets/egl-static: fix link failure to libwayland-drm
Fixes the following build error:
  CXXLD    egl_gallium.la
g++: error: ../../../../src/egl/wayland/wayland-drm/.libs/.libs/libwayland-drm.a: No
such file or directory

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-11 10:56:36 +01:00
Johannes Obermayr
d98716233e targets/dri-swrast: Force c++ linker in all cases.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59226

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-01-11 10:20:42 +01:00
Roland Scheidegger
babab28760 llvmpipe: fix clearing integer color buffers
We get int/uint clear color value in this case, and util_pack_color can't
handle these formats at all (even if it could, float input color isn't what
we want).
Pass through the color union appropriately and handle the packing ourselves
(as I couldn't think of a good generic util solution).
This gets piglit fbo_integer_precision_clear and
fbo_integer_readpixels_sint_uint from the ext_texture_integer test group from
segfault to pass (which only leaves fbo-blending from that group not working).

v2: fix up comments
2013-01-10 18:10:20 -08:00
Roland Scheidegger
5785f22d23 gallivm: fix border color for integer textures
Need to bitcast the float border color (luckily we already get
the color as int just disguised as float).
Fixes piglit texwrap GL_EXT_texture_integer bordercolor.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-10 18:02:01 -08:00
Roland Scheidegger
31884946b5 gallivm: more integer texture format fetch fixes
Change the texel type to int/uint instead of float throughout the sampling
code which makes it easier to catch errors (as llvm will complain about wrong
types if we mistakenly treat these values as real floats somewhere).
This should also get things like e.g. sampler swizzles (for unused channels)
right.
This fixes piglit texture_integer_glsl130 test.
Border color not working (crashing) yet.
(These formats are not exposed yet in llvmpipe.)

v2: couple cleanups according to José's comments

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-10 18:02:01 -08:00
Matt Turner
5eeedb852b build: mapi/glapi/gen: Use BUILT_SOURCES 2013-01-10 22:01:31 +01:00
Matt Turner
ac2793cf3e Clean up .gitignore files 2013-01-10 22:01:31 +01:00
Matt Turner
3ed95dc073 Remove MESA_PIC_FLAGS macro 2013-01-10 22:01:31 +01:00
Matt Turner
f1d229ee94 Remove installmesa 2013-01-10 22:01:31 +01:00
Matt Turner
b585c0059c Remove minstall 2013-01-10 22:01:31 +01:00
Matt Turner
424f200881 Remove checking for makedepend 2013-01-10 22:01:31 +01:00
Matt Turner
c977e61fe2 Remove gallium's unused Makefile.template 2013-01-10 22:01:31 +01:00
Matt Turner
74d105174b Remove gbm's unused Makefile.template 2013-01-10 22:01:31 +01:00
Matt Turner
ae352ccb90 Remove gallium targets' Makefile.{dri,vdpau,xorg,xvmc} 2013-01-10 22:01:31 +01:00
Matt Turner
8f8e85e703 Remove mklib 2013-01-10 22:01:31 +01:00
Matt Turner
41349a4253 Remove unused glsl Makefile.template 2013-01-10 22:01:31 +01:00
Matt Turner
c87474089d Remove configs/{current,default} 2013-01-10 22:01:30 +01:00
Andreas Boll
cb4d5021c6 gallium/tests/unit: Convert to automake 2013-01-10 22:01:30 +01:00
Andreas Boll
59088a2c2c gallium/tests/trivial: Convert to automake 2013-01-10 22:01:30 +01:00
Matt Turner
45270fb0fd targets/pipe-loader: Convert to automake
C++ linking (controlled by the nodist_EXTRA idiom) is needed

unconditionally for:
	nouveau (uses C++ in the driver)
	r300 (since LLVM is always required)
	radeonsi (since LLVM is always required)
	swrast (if builting LLVM pipe)

and conditionally (depends whether LLVM is enabled) for
	i915
	r600
	vmwgfx

and never needed for swrast (softpipe).

Unfortunately, automake seems to *always* link with C++ if nodist_EXTRA
is specified, even inside a false conditional. Not sure if this is a
bug, but it does seem to be weird behavior.

v2: Johannes Obermayr <johannesobermayr@gmx.de>
    - Fix some undefined symbols.

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    - Install pipe_* to $(libdir)/gallium-pipe.

v4: Johannes Obermayr <johannesobermayr@gmx.de>
    - Build it only once on --enable-gallium-gbm / --enable-opencl.
2013-01-10 22:01:30 +01:00
Matt Turner
53c62d3fb0 targets/gbm: Convert to automake 2013-01-10 22:01:30 +01:00
Matt Turner
cdee0e8084 targets/egl-static: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
    - Add missing Automake.inc

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    - Fix linking.

v4: Andreas Boll <andreas.boll.dev@gmail.com>
    - Port changes from ff574d653b
	  gallium/egl-static: Fix unresolved symbol 'clock_gettime'
2013-01-10 22:01:28 +01:00
Matt Turner
d53901c67c targets/xa-vmwgfx: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
af6a2e4f82 targets/xvmc-softpipe: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
45bf6aa617 targets/xvmc-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
c2371ccdac targets/xvmc-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
b173b16cba targets/xvmc-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
0b132df3ad build: AC_SUBST XVMC_MAJOR/MINOR 2013-01-10 22:01:11 +01:00
Matt Turner
f2bf0cdf72 targets/xorg-radeonsi: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
ff5ab73d53 targets/xorg-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
7d451ba83a targets/xorg-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
f984d128c5 targets/xorg-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
1a4349125b targets/xorg-i915: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
7f24483e3d targets/vdpau-softpipe: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
e3b2160a1f targets/vdpau-radeonsi: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
98c051355f targets/vdpau-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
7e0d6ff6d7 targets/vdpau-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
d0df9e82c7 targets/vdpau-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
184b2f0f68 build: AC_SUBST VDPAU_MAJOR/MINOR 2013-01-10 22:01:10 +01:00
Matt Turner
0470fb4efe targets/libgl-xlib: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
c14c801a03 targets/dri-vmwgfx: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
b3068d87cb targets/dri-swrast: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
dd65729057 targets/dri-radeonsi: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
ab07ae05a3 targets/dri-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
b570f1fc31 targets/dri-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:09 +01:00
Matt Turner
6ed9f9f232 targets/dri-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:09 +01:00
Matt Turner
2cd5bf7536 targets/dri-i915: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:09 +01:00
Matt Turner
880063f5bc build: Update drivers/Makefile.am to use LTLIBRARIES 2013-01-10 22:01:09 +01:00
Matt Turner
c236fa82c2 state_trackers/xvmc/test: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
984562d630 state_trackers/xvmc: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
69089ef5b0 Remove xvmc hack 2013-01-10 22:01:09 +01:00
Matt Turner
405a9dabe2 state_trackers/xorg: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
2ad2603467 state_trackers/xa: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
68c0311996 state_trackers/vega: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
d2ca32e332 state_trackers/vdpau: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
1ba5d8ac40 Remove vdpau hack 2013-01-10 22:01:09 +01:00
Matt Turner
083dcdf809 state_trackers/glx: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
c0b9081dc5 state_trackers/gbm: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
8443efdf2c state_trackers/egl: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
9b35758926 state_trackers: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
5089072419 Remove state_tracker/Makefile
Unneeded and unnecessary.
2013-01-10 22:01:08 +01:00
Matt Turner
9f38a1c871 build: Don't build pipebuffer
It's already built by src/gallium/auxiliary.
2013-01-10 22:01:08 +01:00
Tom Stellard
0dcb9ae0d9 radeon/llvm: Convert to Automake
v2: Johannes Obermayr <johannesobermayr@gmx.de>
    Fix some undefined symbols.

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    Build it -shared to fix egl_gallium.so on r600/radeonsi builds.
2013-01-10 22:01:08 +01:00
Matt Turner
2cbb94b3ce build: Add automake conditionals for gallium drivers 2013-01-10 22:01:08 +01:00
Matt Turner
f4b1f2807f state_trackers/dri/sw: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
d988481d58 state_trackers/dri/drm: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
2ff51cd639 state_trackers/dri: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
44653c0a0e winsys/sw/xlib: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
24c2fe94a2 winsys/sw/wrapper: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
1d0ef53e7b winsys/sw/wayland: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
1c9fb3c5b5 winsys/sw/null: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
5c4ade53a4 winsys/sw/fbdev: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
a6b3cd1349 winsys/sw/dri: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
b4beea6418 winsys/sw: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
2b5a1c0299 svga/winsys/drm: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
77fc30b57d nouveau/winsys/drm: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
da2d98fac7 radeonsi: Convert to automake
Can't use LTLIBRARIES here yet, since libradeon isn't converted.
2013-01-10 22:01:07 +01:00
Matt Turner
c35cddd134 nvc0: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
2a28353ca0 nv50: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
36066770bf nv30: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
1cf66321f9 nouveau: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
0a42131f3b svga: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
f781d4c60d softpipe: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
960cbd8b78 llvmpipe: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
b51cdfa64b rbug: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
3bfe7c2111 i915/winsys/sw: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
266d639b91 i915/winsys/drm: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
7d5496ab3b i915g: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
533130a5bb r600g: Use gallium automake include file 2013-01-10 22:01:06 +01:00
Tom Stellard
80d290d47a libgallium: Convert to automake 2013-01-10 22:01:06 +01:00
Tom Stellard
047fe04750 trace: Convert to automake 2013-01-10 22:01:06 +01:00
Tom Stellard
34a6150188 radeon/winsys: Convert to automake 2013-01-10 22:01:06 +01:00
Matt Turner
8dc4048b3b r300g: Link ralloc.c and register_allocate.c into separate library 2013-01-10 22:01:06 +01:00
Tom Stellard
e04413cbb0 r300g: Build a libtool archive 2013-01-10 22:01:06 +01:00
Tom Stellard
c07c2696c7 r300g: Use gallium automake include file
[mattst88] v2: Remove ARCH_FLAGS/OPT_FLAGS
2013-01-10 22:01:06 +01:00
Tom Stellard
c040fe102c gallium: Add common automake include file
v2: Matt Turner <mattst88@gmail.com>
    Remove ARCH_FLAGS/OPT_FLAGS

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    Add -I$(top_srcdir)/include to GALLIUM_CFLAGS
2013-01-10 22:01:06 +01:00
Matt Turner
9bf0d49abe automake: Convert Gallium target and winsys 2013-01-10 22:01:06 +01:00
Kristian Høgsberg
4e42e569dd egl/gbm: Implement EGL_EXT_buffer_age
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-10 15:58:05 -05:00
Matt Turner
0ae81b8422 mesa: Rename and wire-up GetInteger64i_v
The function was named badly and wasn't in the dispatch table,
making it hard to find.

Fixes transform_feedback2_states and gets a few other transform
feedback tests closer to working in es3conform.

Reviewed-by Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
1a3ffbf378 mesa: Correct glGet{Boolean,Integer}i_v names
Reviewed-by Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
ec8ee91923 mesa: Allow GL_DEPTH_STENCIL_ATTACHMENT in ES 3
Fixes framebuffer_srgb_default_encoding_fbo and 5 packed_depth_stencil
tests from es3conform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-10 10:57:51 -08:00
Chad Versace
75b963c095 mesa: Support more glGet enums for ES3
For glGetIntegerv, add support for the following in an OpenGL ES 3.0
context:
    GL_MAJOR_VERSION
    GL_MINOR_VERSION
    GL_NUM_EXTENSIONS

See Table 6.29 of the OpenGL ES 3.0 spec.

Fixes error GL_INVALID_ENUM in piglit egl-create-context-verify-gl-flavor,
testcase for OpenGL ES 3.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
532e05a9d0 mesa: Support querying GL_MAX_ELEMENT_INDEX in ES 3
The ES 3 spec says that the minumum allowable value is 2^24-1, but the
GL 4.3 and ARB_ES3_compatibility specs require 2^32-1, so return 2^32-1.

Fixes es3conform's element_index_uint_constants test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
92855727f1 mesa: De-duplicate ES2 queries
From GL/GLES/GL_CORE and GLES2 -> GL/GL_CORE/GLES2.

Yes, we really were exposing ES2_compatibility queries on ES 1.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
5bb1827d95 mesa: Allow glGet* queries on EXT_texture_lod_bias data in ES 3
Fixes the remaining 4 texture_lod_bias failures in es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
e895d368e1 mesa: Allow glGet* queries on EXT_framebuffer_blit data in ES 3
Fixes 2 framebuffer_blit es3conform tests.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
d9948e49d3 mesa: Allow glGet* queries on ARB_fragment/vertex_shader data in ES 3
Fixes uniform_buffer_object_implementation_dependent_limits in
es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
d93c1b62f8 mesa: Allow glGet* queries on ARB_framebuffer_object data in ES 3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
914415a63f mesa: Allow glGet* queries on ARB_transform_feedback2 data in ES 3
Fixes the transform_feedback2_init_defaults test from es3conform.

The ES 3 spec lists these as TRANSFORM_FEEDBACK_PAUSED and
TRANSFORM_FEEDBACK_ACTIVE.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
3d0e4eb134 mesa: Allow glGet* queries on EXT_transform_feedback data in ES 3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
3f1217607a mesa: Allow glGet* queries on ARB_sync data in ES 3
Fixes the sync_coverage_max_server_wait_timeout test in es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
0a8866e751 mesa: Allow glGet* queries of EXT_pbo data in ES 3
Fixes pixel_buffer_object_default_binding and gets other tests in
es3conform closer to passing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
be68dae374 mesa: Allow glGet* queries of select ARB_ubo data in ES 3
Fixes 5 uniform_buffer_object tests in es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
0cc018526f Add ES 3 handling to get.c and get_hash_generator.py
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Matt Turner
57616159aa glapi: Move ARB_base_instance to the correct location
It's #107, it shouldn't be added after the #116 comment.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Matt Turner
a5ed966069 mesa/tests: Add ARB_ES3_compatibility enums
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Matt Turner
910a0bfe5b glapi: Add enums for ARB_ES3_compatibility
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Quentin Glidic
c5e9396424 mesa/program: Fix both Classic and Gallium build
Follow-up for 9078441072 and
3a5ad21cd3

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57044
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
Tested-by: Brad King <brad.king@kitware.com>
2013-01-10 10:34:56 -08:00
Andreas Boll
f416b382d6 configure.ac: fix typo in error message 2013-01-10 18:41:53 +01:00
Marek Olšák
2f89949b66 r300g: don't set sample positions to the pixel center if MSAA is disabled
but an MSAA resource is bound. This effectively makes the MSAA disable switch
not affect rasterization, but it still affects the alpha-to-one and
alpha-to-coverage states. This hardware just lacks a proper MSAA disable
switch.

This fixes graphics corruption in sauerbraten.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59194
2013-01-10 15:37:10 +01:00
Paul Berry
9a07b6bd74 intel: Clean up confusion between logical and physical surface dimensions.
In most cases, the width, height, and depth of the physical surface
used by the driver to implement a texture or renderbuffer is equal to
the logical width, height, and depth exposed to the client through
functions such as glTexImage3D().  However, there are two exceptions:
cube maps (which have a physical depth of 6 but a logical depth of 1)
and multisampled renderbuffers (which have larger physical dimensions
than logical dimensions to allow multiple samples per pixel).

Previous to this patch, we accounted for the difference between
physical and logical surface dimensions at inconsistent places in the
call graph (multisampling was accounted for in
intel_miptree_create_for_renderbuffer(), and cubemaps were accounted
for in intel_miptree_create_internal()).  As a result, it wasn't
always clear, when calling a miptree creation function, whether
physical or logical dimensions were needed.  Also, we weren't
consistent about storing logical dimensions in the intel_mipmap_tree
structure (we only did so in the
intel_miptree_create_for_renderbuffer() code path, and we did not
store depth).

This patch refactors things so that intel_miptree_create_internal() is
responsible for converting logical to physical dimensions and for
storing both the physical and logical dimensions in the
intel_mipmap_tree structure.  As a result, all miptree creation
functions interpret their arguments as logical dimensions, and both
physical and logical dimensions are always available to functions that
work with intel_mipmap_trees.

In addition, it renames the fields in intel_mipmap_tree used to store
the dimensions, so that it is clear from the name whether physical or
logical dimensions are being referred to.

This should fix the following bugs:

- When creating a separate stencil surface for a depthstencil cubemap,
  we would erroneously try to convert the depth from 1 to 6 twice,
  resulting in an assertion failure.

- When creating an MCS buffer for compressed multisampling, we used
  physical dimensions instead of logical dimensions, resulting in
  wasted memory.

In addition, this should considerably simplify the implementation of
ARB_texture_multisample, because it moves the code to compute the
physical size of multisampled surfaces out of renderbuffer-only code.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09 13:10:47 -08:00
Paul Berry
a5f87e8843 intel: Add a force_y_tiling parameter to intel_miptree_create().
This allows intel_miptree_alloc_mcs() to force Y tiling for the MCS
buffer.  Previously we accomplished this by the hack of passing
INTEL_MSAA_LAYOUT_CMS as the msaa_layout parameter, but that parameter
is going to be going away soon.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09 13:10:30 -08:00
Paul Berry
8f15f19696 intel: Move compute_msaa_layout earlier in file.
No functional change.  This patch moves the compute_msaa_layout()
function earlier in intel_mipmap_tree.c so that it can be used by
other functions in that file.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09 13:10:14 -08:00
Vinson Lee
b37930f309 r600g: Fix memory leak in r600_bytecode_add_vtx.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-01-09 11:11:46 -05:00
Marek Olšák
f8651dea4e r300g: optionally log MSAA resources to stderr
Set: RADEON_DEBUG=msaa
2013-01-09 16:47:10 +01:00
Marek Olšák
1385c353cf r300g: fix the GPU name in the renderer string
Broken by ca474f98f2.
2013-01-09 16:40:37 +01:00
Marek Olšák
4f2d9a8f52 r300g: fix CS checker errors caused by emit_dsa_state
size is 10 on r500 and 8 on r300
2013-01-09 16:40:37 +01:00
Johannes Obermayr
959e83d650 clover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced libclc.pc.
Tom Stellard:
  -Keep --with-libclc-path and mark it deprecated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-08 20:32:47 -05:00
Ian Romanick
ed3f237e09 glsl: Don't add structure fields to the symbol table
I erroneously added this back in January 2011 in commit 88421589.
Looking at the commit message, I have no idea why I added it.  It only
added non-array structure fields to the symbol table, so array structure
fields are treated correctly.

Fixes piglit tests structure-and-field-have-same-name.vert and
structure-and-field-have-same-name-nested.vert.  It should also fix
WebGL conformance tests shader-with-non-reserved-words.

NOTE: This is a candidate for the stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57622
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 13:09:31 -08:00
Kenneth Graunke
a5265f7536 i965/fs: Fix struct vs. class in acp_entry definitions. 2013-01-08 13:09:31 -08:00
Marek Olšák
a70e5e2b94 r600g: implement buffer copying using CP DMA for R7xx, Evergreen, Cayman
R6xx doesn't work - the issue seems to be with flushing (sometimes
the destination buffer contains garbage). There are no hangs, so we're good.

R7xx doesn't seem to have any alignment restriction despite our initial
thinking. Everything just works.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-08 21:58:28 +01:00
Marek Olšák
2d3d0d3a5a st/mesa: fix possible MSVC build error v2
https://bugs.freedesktop.org/show_bug.cgi?id=59143

Using GLubyte as per Brian's suggestion.
2013-01-08 21:53:13 +01:00
Paul Berry
c35abcd1b0 glsl: Pack flat "varyings" of mixed types together.
This patch enhances the varying packing code so that flat varyings of
uint, int, and float types can be packed together.

We accomplish this in lower_packed_varyings.cpp by making the type of
all flat varyings ivec4, and then using information-preserving type
conversions (e.g. ir_unop_bitcast_f2i) to convert all other types to
ints.

The varying_matches::compute_packing_class() function is updated to
reflect the fact that varying packing no longer needs to segregate
varyings of different base types.

Fixes piglit test varying-packing-mixed-types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Split lower_packed_varyings_visitor::bitwise_assign into
pack/unpack variants.
2013-01-08 09:18:14 -08:00
Paul Berry
18720555dd glsl: Prohibit structs and bools from being used as "varyings".
The GLSL 1.30 spec only allows vertex shader outputs and fragment
shader inputs ("varyings" in pre-GLSL-1.30 parlance) to be of type
int, uint, float, or vectors, matrices, or arrays thereof.  Bools,
bvec's, and structs are prohibited.  (Integral varyings were
prohibited prior to GLSL 1.30).

Previously, Mesa only performed this check on variables declared with
the "varying" keyword, and it always performed the check according to
the pre-GLSL-1.30 rules.  As a result, bools and structs were allowed
to slip through, provided they were declared using the new in/out
syntax.

This patch modifies the error check so that it occurs after "varying"
is converted to "in/out", and corrects it to properly account for GLSL
version.

Fixes piglit tests:
  in-bool-prohibited.frag
  in-bvec2-prohibited.frag
  in-bvec3-prohibited.frag
  in-bvec4-prohibited.frag
  in-struct-prohibited.frag
  out-bool-prohibited.vert
  out-bvec2-prohibited.vert
  out-bvec3-prohibited.vert
  out-bvec4-prohibited.vert
  out-struct-prohibited.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:09:21 -08:00
Paul Berry
c33be485c5 glsl: Plumb through is_parameter to apply_type_qualifier_to_variable()
This patch adds logic to allow the ast_to_hir function
apply_type_qualifier_to_variable() to tell whether it is acting on a
variable declaration or a function parameter.  This will allow it to
correctly interpret the meaning of "out" and "in" keywords (which have
different meanings in those two contexts).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:09:18 -08:00
Paul Berry
4b11b57ab4 glsl: Separate varying linking code to its own file.
linker.cpp is getting pretty big, and we're about to add even more
varying packing code, so split out the linker code that concerns
varyings to its own file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:09:09 -08:00
Paul Berry
8706395f25 mesa: Add ALIGN() macro to main/macros.h.
Previously this macro existed in 3 separate places, some inside the
intel driver and some outside of it.  It makes more sense to have it
in main/macros.h

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:08:57 -08:00
Paul Berry
09df6bb96d glsl: Fix loop bounds detection.
When analyzing a loop where the loop condition is expressed in the
non-standard order (e.g. "4 > i" instead of "i < 4"), we were
reversing the condition incorrectly, leading to a loop bound that was
off by 1.

Fixes piglit tests {vs,fs}-loop-bounds-unrolled.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-08 09:08:53 -08:00
Marek Olšák
844d14ebee winsys/radeon: bump the size of relocation hashlist
This should reduce the number of hash collisions in ETQW.
2013-01-08 16:41:57 +01:00
Christoph Bumiller
18f3f7b958 nvc0: catch too high GENERIC indices to prevent GRAPH traps 2013-01-08 16:13:52 +01:00
Christoph Bumiller
b9c8a98e21 nvc0: use correct resource target to select blit shader 2013-01-08 16:13:52 +01:00
Christoph Bumiller
41e105d5be nvc0: add missing call to map edge flag in push_vbo
Note: this is a candidate for the 9.0 stable branch.
2013-01-08 16:13:52 +01:00
Christoph Bumiller
be75a9373a nv50/ir: wrap assertion using typeid in #ifndef NDEBUG
Note: this is a candidate for the 9.0 stable branch.
2013-01-08 16:13:52 +01:00
Christoph Bumiller
076f4ced8b nvc0: fix out of bounds writes for unaligned sizes in push_data 2013-01-08 16:13:51 +01:00
Christoph Bumiller
39fe03e2de nouveau: increase max order of suballocated buffers by 1
This is really a hack to make TF2 (considerably, up to 20 -> 70 fps
at low res) faster.
2013-01-08 16:13:51 +01:00
Christoph Bumiller
48a45ec24a nouveau: improve buffer transfers
Save double memcpy on uploads to VRAM in most cases.
Properly handle FLUSH_EXPLICIT.
Reallocate on DISCARD_WHOLE_RESOURCE to avoid sync.
2013-01-08 16:13:51 +01:00
Marek Olšák
a75ddfd55d r300g: fix assertion failure in emit_dsa_state
Broken by 8ed6b1400b.
2013-01-08 14:33:18 +01:00
Kenneth Graunke
a60c567fcf i965: Support GL_FIXED and packed vertex formats natively on Haswell+.
Haswell and later support the GL_FIXED and 2_10_10_10_rev vertex formats
natively, and don't need shader workarounds.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
e219764fde i965: Add #defines for GL_FIXED vertex formats.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
f3840b1632 i965: Add remaining #defines for packed vertex formats.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
899017fc54 i965: Use Haswell's sample_d_c for textureGrad with shadow samplers.
The new hardware actually just supports this now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
30f8f58c20 i965/fs: Remove dead code from generate_uniform_pull_constant_load_gen7.
generate_uniform_pull_constant_load_gen7() is only called on Gen7+, so
the gen < 6 code is dead.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Alexander von Gluck IV
23595aa427 mesa: Drop mmx optimizations on Haiku
* Prevents compatibility problems. As Haiku
  doesn't use rtasm anymore, it's kind of
  pointless.
2013-01-07 17:39:49 -06:00
Alexander von Gluck IV
b9227b3e15 mesa: Don't use rtasm for Haiku swrast
* We have a symbol conflict as rtasm in
  Mesa collides with rtasm in gallium.
* As us linking gallium and mesa together
  is an edge case, lets just omit the rtasm
  code from Mesa as we should be going
  llvmpipe soon :)
2013-01-07 17:39:49 -06:00
Alex Deucher
4332f6fc18 r600g: set the virtual address for the htile buffer
Fixes cayman and TN with htile enabled.  Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=59089
https://bugs.freedesktop.org/show_bug.cgi?id=58667
Possibly others.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-07 15:21:46 -05:00
Jerome Glisse
ca474f98f2 radeon/winsys: move radeon family/class identification to winsys
Upcoming async dma support rely on winsys knowing about GPU families.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-07 11:06:07 -05:00
Jerome Glisse
d499ff98cd r600g/radeon/winsys: indentation cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-07 11:06:02 -05:00
Marek Olšák
afec10df37 r600g: flush FMASK and CMASK at the end of CS 2013-01-06 22:06:34 +01:00
Marek Olšák
8ed6b1400b r300g: implement MSAA
This is not as optimized as r600g - the MSAA compression is missing,
so r300g needs a lot of bandwidth (more than r600g to do the same thing).
However, if the bandwidth is not an issue for you, you can enjoy this
unoptimized MSAA support.
The only other missing optimization for MSAA is the fast color clear.

MSAA is enabled on r500 only, because that's the only GPU family I tested.
That said, MSAA should work on r300 and r400 as well (but you must set
RADEON_MSAA=1 to allow it, then turn MSAA on in your app or set GALLIUM_MSAA=n,
n >= 2, n <= 6)
I will enable the support by default on r300-r400 once someone (other than me)
tests those chipsets with piglit.

The supported modes are 2x, 4x, 6x.

The supported MSAA formats are RGBA8, BGRA8, and RGBA16F (r500 only).
Those 3 formats are used for all GL internal formats.

Tested with piglit. (I have ported all MSAA tests to GL2.1)
2013-01-06 14:44:12 +01:00
Marek Olšák
cc030da428 r300g: simplify DSA state, add ability to patch FG_ALPHA_FUNC while emitting
Preparation for MSAA and alpha-to-coverage.
2013-01-06 14:44:12 +01:00
Marek Olšák
25b3c0a52c r300g/compiler: add shader emulation for the alpha_to_one state 2013-01-06 14:44:12 +01:00
Vinson Lee
2f358feda3 configure.ac: Remove space after indent -T flag.
Fixes this build error on platforms not using GNU indent.

indent: Command line: ``-T'' requires a parameter

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-01-04 19:10:48 -08:00
Ian Romanick
d299ef3ad0 intel: Fix copy-and-paste bug setting gl_constants::MaxSamples
gl_constants::MaxSamples is an integer, so setting it to 1.0 is just
silly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Ian Romanick
a86d629799 mesa: Disallow R, RG, or RGB integer and unsigned formats in OpenGL ES 3.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Ian Romanick
2aae3abd77 mesa: Disallow SNORM formats for renderbuffers in OpenGL ES
v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the previous commit to
this commit.  Based on suggestions from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Ian Romanick
4b92379da2 mesa: Disallow deprecated SNORM formats for renderbuffers
The OpenGL 3.2 core profile spec says:

    "The following base internal formats from table 3.11 are
    color-renderable: RED, RG, RGB, and RGBA. The sized internal formats
    from table 3.12 that have a color-renderable base internal format
    are also color-renderable. No other formats, including compressed
    internal formats, are color-renderable."

The OpenGL 3.2 compatibility profile spec says (only ALPHA is added):

    "The following base internal formats from table 3.16 are
    color-renderable: ALPHA, RED, RG, RGB, and RGBA. The sized internal formats
    from table 3.17 that have a color-renderable base internal format
    are also color-renderable. No other formats, including compressed
    internal formats, are color-renderable."

Table 3.12 in the core profile spec and table 3.17 in the compatibility
profile spec list SNORM formats as having a base internal format of RED,
RG, RGB, or RGBA.  From this we infer that they should also be color
renderable.

The OpenGL ES 3.0 spec says:

    "An internal format is color-renderable if it is one of the formats
    from table 3.12 noted as color-renderable or if it is unsized format
    RGBA or RGB. No other formats, including compressed internal
    formats, are color-renderable."

In the OpenGL ES 3.0 spec, none of the SNORM formats have "color-
renderable" marked in table 3.12.  The RGB I and UI formats also are not
color-renderable in ES3, but we'll save that change for another patch.

Both NVIDIA's closed-source driver (version 304.64) and AMD's
closed-source driver (Catalyst 12.6 on HD 3650) reject *all* SNORM
formats for renderbuffers in OpenGL 3.3 compatibility profiles.

v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the this commit to the
next commit.  Based on suggestions from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Brian Paul
69c2528b83 util: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOAT
The Z32 pixel is 4 bytes so multiply x by 4, not 2.

Note: This is a candidate for the stable branches.
2013-01-04 15:30:46 -07:00
Brian Paul
073a53fe2f util: add get/put_tile_z() support for PIPE_FORMAT_Z32_FLOAT_S8X24_UINT
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58972

Note: This is a candidate for the stable branches.
2013-01-04 15:30:46 -07:00
Brian Paul
1b6ba9c4c8 gallivm: support more immediates in lp_build_tgsi_info()
Bump limit from 32 to 128.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58545
2013-01-04 15:30:45 -07:00
Brian Paul
46bad058eb xlib: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values
Fixes piglit glx-dont-care-mask test.

Note: This is a candidate for the stable branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-04 15:18:53 -07:00
Brian Paul
fe90762414 st/glx: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values
Fixes piglit glx-dont-care-mask test.

Note: This is a candidate for the stable branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-04 15:18:53 -07:00
Tom Stellard
aed37cbee8 radeon/llvm: Remove backend code from Mesa
This code now lives in an external tree.

For the next Mesa release fetch the code from the master branch
of this LLVM repo:
http://cgit.freedesktop.org/~tstellar/llvm/

For all subsequent Mesa releases, fetch the code from the official LLVM
project:
www.llvm.org
2013-01-04 21:05:09 +00:00
Johannes Obermayr
05c143cc04 Support LLVM >= 3.2 on radeonsi and opencl.
Tom Stellard:
 - Backend now has same name for all LLVM versions
 - Add missing LLVM_VERSION_INT definition
2013-01-04 21:05:09 +00:00
Tom Stellard
54f3a3e88d clover: Fix build after the addition of enum pipe_flush_flags
Broken since commit 598cc1f74d
2013-01-04 21:05:09 +00:00
Marek Olšák
bce36d1556 r300g: don't check for vertex and index buffer bind flags 2013-01-04 21:08:28 +01:00
Marek Olšák
beb358809e r300g/swtcl: use memcpy to emit indices 2013-01-04 21:08:28 +01:00
Marek Olšák
ad1d1a4d9e r300g/swtcl: simplify vertex uploading
- skip the vertex buffer reallocation in flush and just use
  the unsynchronized flag to get new memory.
- remove the cruft needed to get around the issues with the vertex buffer
  reallocation in flush
- use pb_buffer instead of pipe_resource
2013-01-04 21:08:28 +01:00
Marek Olšák
37fd455b21 r300g/swtcl: fix crash when setting vertex buffers
Broken by e73bf3b805.
2013-01-04 21:08:28 +01:00
Marek Olšák
d4ff72b944 r300g: don't set PIPE_BIND flags for internal textures 2013-01-04 21:08:28 +01:00
Paul Berry
06f67e75ee i965: Fix glCompressedTexSubImage2D offsets for ETC textures.
This patch fixes intel_miptree_unmap_etc() (which decompresses ETC
textures to linear) to pay attention to map->x and map->y when writing
to the destination image.  Previously these values were ignored,
causing the xoffset and yoffset parameters passed to
glCompressedTexSubImage2D() to be ignored.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-04 11:16:43 -08:00
Kristian Høgsberg
48ac6d7e97 egl/wayland: Remove kooky flush code
We used to have to jump through hoops to call glFlush at swap buffer time,
but the flush extension made that unnecessary a long time ago.
2013-01-04 11:20:12 -05:00
Kristian Høgsberg
b433e319b3 egl/wayland: Remove confusing comment about front buffer rendering 2013-01-04 11:20:12 -05:00
Kristian Høgsberg
b5160a10c0 egl_dri2: Remove unused struct dri2_egl_buffer from header file 2013-01-04 11:20:12 -05:00
Kristian Høgsberg
0725f2d654 egl: Add extension infrastructure for EGL_EXT_buffer_age 2013-01-04 11:20:12 -05:00
Kristian Høgsberg
f79739ebdd egl: Update to revision 19987 of eglext.h
This pulls in EGL_EXT_buffer_age.
2013-01-04 11:20:12 -05:00
Brian Paul
35fe71d97e util: move var declaration before loop to fix MSVC error 2013-01-04 08:22:02 -07:00
Marek Olšák
1aebb6911e r600g: implement 3D transfers
That means we can map and read multiple slices with one transfer_map call.
2013-01-04 14:06:54 +01:00
Marek Olšák
ee351ea178 st/mesa: fix assertion failures with 2101010 vertex formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:39 +01:00
Marek Olšák
d1818d6f68 st/mesa: accelerate CopyTexSubImage for 1D array textures
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:36 +01:00
Marek Olšák
ed86809ac9 st/mesa: fix CopyTexSubImage fallback for 1D array textures
- We should use a 3D transfer of size Width x 1 x NumLayers.
- We should use layer_stride instead of stride.
  (even though they are likely to be equal with 1D array textures)

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:28 +01:00
Marek Olšák
85cb4f299d st/mesa: fix GetTexImage for compressed 2D array textures
This uses a 3D blit to decompress the texture and then a 3D transfer
to read it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:17 +01:00
Marek Olšák
538d3a2d46 gallium/util: remove unused helper util_create_rgba_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:14 +01:00
Marek Olšák
5daba187c9 st/mesa: try to find the format matching format+type in decompressed_with_blit
There was the fast path based on _mesa_format_matches_format_and_type
for GetTexImage, but it never worked, because the Mesa format we were testing
there was always compressed. Further testing showed that the fast path
had been completely broken.

In this commit, the somewhat limited helper util_create_rgba_texture is
no longer used and instead, custom code for the texture creation is added,
which tries to find the best matching RGBA8 format, so that we can hit
the fast path *always* if the read format is a variant of RGBA8 and supported
by the driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:09 +01:00
Marek Olšák
0aecb174ce st/mesa: fix GetTexImage for compressed cubemaps
I'll deal with 2D arrays later.

NOTE: This is a candidate for the stable branches.
2013-01-04 14:05:52 +01:00
Marek Olšák
afec42a648 gallium/u_blitter: implement 3D blitting
Scaling and flipping in the Z direction isn't allowed yet.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:49 +01:00
Marek Olšák
5665deeaea gallium/u_blitter: fix blitting TEXTURE_CUBE_ARRAY with a non-zero cube index
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:47 +01:00
Marek Olšák
53d232d223 gallium/u_blitter: minor simplification
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:45 +01:00
Marek Olšák
ccfcf32873 gallium/u_blitter: unify some parameters into a dstbox parameter in blit_generic
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:43 +01:00
Marek Olšák
23f76f558e gallium/u_blitter: remove useless parameter from blitter_default_dst_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:40 +01:00
Marek Olšák
8fdece2896 gallium/util: complete implementation of util_dump_transfer
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:32 +01:00
Marek Olšák
8bd134f31b mesa: allow TEXTURE_CUBE_MAP_ARRAY in GetTexImage
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:21 +01:00
Marek Olšák
12aeb47b6a gallium/radeon: send the END_OF_FRAME flag to the DRM 2013-01-04 13:18:50 +01:00
Marek Olšák
598cc1f74d gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flag
Usage with pipe_context:
  pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME);

Usage with st_context_iface:
  st->flush(st, ST_FLUSH_END_OF_FRAME, NULL);

The flag is only a hint for drivers. Radeon will use it for buffer eviction
heuristics in the kernel (e.g. for queries like how many frames have passed
since a buffer was used).

The flag is currently only generated by st/dri on SwapBuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2013-01-04 13:18:33 +01:00
Marek Olšák
4ad5ebaefa radeonsi: fix int->bool conversion in fence_signalled 2013-01-04 12:42:03 +01:00
Marek Olšák
9f0ddbc9e4 r600g: fix int->bool conversion in fence_signalled
NOTE: This is a candidate for the stable branches.
2013-01-04 12:42:03 +01:00
Paul Berry
b8b1d61e76 Add new .gitignore entries for Automake 1.13 tests
Automake 1.13 creates a bunch of new build artefacts:
- bin/test-driver, a script for running tests.
- *.trs files for every "make check" test result.
- *.log files containing the output of every test run by "make check".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-03 15:24:45 -08:00
Kenneth Graunke
82f8e8ebd5 i965: Replace structs with bit-shifting for Gen7 SURFACE_STATE entries.
Every generation except Gen7 creates SURFACE_STATE entries via a
uint32_t array.  Only Gen7 uses the older bitfield structure, which we
moved away from because it was less efficient.  Convert it for
consistency.

This reduces the compiled size of gen7_wm_surface_state.o by 2.86% in a
release build.

v2: Fix accidental use of BRW_SURFACE_WIDTH/HEIGHT in brw_state_dump.c;
    switch back to gen7_set_surface_mcs_info setting surf[6] directly
    (both per Eric's review comments).

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-03 13:36:04 -08:00
smoki
5bf357db89 radeon/r200: Fix tcl culling
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57842
2013-01-03 13:22:22 -05:00
Jonas Ådahl
800ed958c3 wayland: Don't cancel a roundtrip when any event is received
Since wl_display_dispatch_queue() returns the number of processed events
or -1 on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when the
roundtrip does an early return and the callback later writes to the then
out of scope stack allocated `done' parameter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2013-01-03 11:44:55 -05:00
Vinson Lee
622d96aae4 i965: Add break statement at end of BRW_OPCODE_CONTINUE case.
Fixes missing break in switch defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 22:30:13 -08:00
Chad Versace
bfe28b8d93 egl/android: Fix build for Jelly Bean (v2)
In Jelly Bean, the interface to ANativeWindow changed. The change included
adding a new parameter the queueBuffer and dequeueBuffer methods,
removing the lockBuffer method, and requiring libsync.

v2:
  - s/fence_fd == -1/fence_fd != -1/
  - Fix leak. Close the fence_fd.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-02 14:55:36 -08:00
Chad Versace
56c6cdc9e7 android: Define Make variables for Android version
Define the following Make variables:
    MESA_ANDROID_MAJOR_VERSION
    MESA_ANDROID_MINOR_VERSION
    MESA_ANDROID_VERSION

These variable will allow us to make version-dependent decisions on
library dependencies. In particular, building Mesa against JellyBean will
require libsync.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-02 14:51:18 -08:00
Matt Turner
7f962c5ef3 mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to GetSamplerParameter*
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 12:33:49 -08:00
Matt Turner
f10b54fd79 mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to SamplerParameter*
Commit f22d49de added the SamplerParamter* functions but only used
ASSERT_OUTSIDE_BEGIN_END inside the -f and -fv versions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 12:33:44 -08:00
Matt Turner
1b06a0478f mesa: Mark _mesa_{init,delete}_sampler_object as static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 12:33:35 -08:00
Adam Jackson
86b6964ef9 glcpp: Typo fix.
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:09:22 -05:00
Adam Jackson
c8d3fd4a12 r300g: Fix visibility CFLAGS in automake
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:08:21 -05:00
Adam Jackson
443954d161 galahad, noop: Fix visibility CFLAGS in automake
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:08:15 -05:00
Adam Jackson
0daabd5239 glcpp: Fix visibility CFLAGS in automake
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:07:58 -05:00
Paul Berry
7c0323296e mesa: Implement compressed 2D array textures.
This patch adds functionality to Mesa to upload compressed
2-dimensional array textures, using the glCompressedTexImage3D and
glCompressedTexSubImage3D calls.

Fixes piglit tests "EXT_texture_array/compressed *" and "!OpenGL ES
3.0/ext_texture_array-compressed_gles3 *".  Also partially fixes GLES3
conformance test "CoverageES30.test".

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-02 10:28:39 -08:00
Paul Berry
261ee4d907 mesa: Fix error reporting in _mesa_invalidate_pbo_{compressed_,}teximage.
The old error reporting was completely bogus, passing _mesa_error() a
format string that didn't even match the remaining arguments.  Also,
in many cases the number of dimensions in the TexImage call was not
preserved in the error message (e.g. an error in glTexImage2D was
reported simply as an error in glTexImage).

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-02 10:28:23 -08:00
Brian Paul
c7d3254b8e mesa: fix signed/unsignd mix-up in fetch_signed_l_latc1()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58844
2013-01-02 09:02:04 -07:00
Brian Paul
955babf2d9 glsl: add cast to silence signed/unsigned comparision warning 2013-01-01 08:47:04 -07:00
Brian Paul
05cd6cfd5f xlib: handle _mesa_initialize_visual()'s return value
If the call fails, we should return NULL from XMesaCreateVisual().
This was found when Waffle tried to create a visual with depth/stencil
bits = -1.  That's an illegal value for glXChooseFBConfig() and we should
return NULL in that situation.

Note: This is a candidate for the stable branches.
2012-12-31 18:17:58 -07:00
Kenneth Graunke
66ea6e8ec3 i965: Fail to blit rather than assert on invalid pitch requirements.
Dungeon Defenders hits TexImage()'s try_pbo_upload() path where
image->Width == 2, which doesn't meet intelEmitCopyBlit's requirement
that the pitch needs to be a multiple of 4.

Since intelEmitCopyBlit can already fail for a myriad of other reasons,
and it's not clear that other callers are immune to this failure mode,
simply make it return false rather than assert.

Fixes Dungeon Defenders on i965/Ivybridge.  Now playable (aside from
having to work around the EXT_bindable_uniform issue).

NOTE: This is probably a candidate for the 9.0 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-12-29 01:04:30 -08:00
Eric Anholt
2f225f6145 intel: Skip texture validation logic when nothing has changed.
Improves GLBenchmark 2.1 offscreen performance by 3.2% +/- 1.5% (n=52).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 11:05:23 -08:00
Eric Anholt
73c376bbde intel: Turn a test in miptree_match_image into an assert.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 11:05:20 -08:00
Eric Anholt
12751ef2a7 i965: Stop making a copy of non-builtin uniforms in ParameterValues[].
We don't need them now that our set of parameter pointers points at the
GL core storage for them.  This should save memory/bandwidth/overhead in
uniform updates.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:54 -08:00
Eric Anholt
7e28d6c1ab i965: Consistently use nr_pull_params instead of NumParameters.
NumParameters used to be an upper bound on the number of vec4s to be
uploaded, which was basically safe (unless your buffer was bound near
the top of address space *and* you array indexed outside the buffer, in
which case I think you might GPU hang).  As I migrate the driver away
from ParameterValues[], this is no longer true.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:50 -08:00
Eric Anholt
aa6e35e80d i965/vs: Reference the core GL uniform storage for non-builtin uniforms.
Like in the FS, there's no reason to use an external copy if the
ParameterValues[] relayout of it isn't the layout we need.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:48 -08:00
Eric Anholt
c0d1f508d6 i965/fs: Reference the core GL uniform storage for non-builtin uniforms.
There's no reason to use an external copy if the relayout in the
external copy isn't serving us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:45 -08:00
Eric Anholt
bd326623ef glsl: Add a note about a surprising feature of gl_uniform_storage->type.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:42 -08:00
Eric Anholt
f189570ccf i965/fs: Remove the param_index/param_offset indirection.
Now that ParameterValues doesn't change across the visitor, we don't
need to go through this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:39 -08:00
Eric Anholt
d5efc14635 i965: Add asserts to check that we don't realloc ParameterValues.
Things are even more restrictive than they used to be, so I've made
mistakes in this area.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:36 -08:00
Eric Anholt
ffdfafb06c i965: Add texrect scale parameters before pointers to ParameterValues.
If adding scale parameters during program compile caused a realloc of
ParameterValues, then the driver uniform storage set up by
_mesa_associate_uniform_storage() would point to potentially freed
memory.

Note that this uses TexturesUsed, which may change at runtime for GLSL
when sampler uniforms change.  This is a flaw in our handling of texrect
in general, and not one I'm fixing currently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:33 -08:00
Eric Anholt
6ccc505fc0 i965: Fix a typo in a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:30 -08:00
Eric Anholt
50a88e2f44 i965: Add a note about a bug from the no-recompile-on-sampler-updates change.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:25 -08:00
Brian Paul
7c35521295 mesa: add missing texel fetch code for sRGB DXT formats
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58548
2012-12-26 15:23:05 -07:00
Eric Anholt
5791c56811 i965: Fix border color handling for deprecated SNORM formats.
We don't have native hardware support for these, so they get promoted to
RGBA, in which case we don't have hardware dealing with the channel
swizzling for us.

Fixes piglit EXT_texture_snorm/texwrap formats bordercolor (-swizzled).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-26 12:08:33 -08:00
Eric Anholt
5628501e7b i965: Start using HIZ for Z16 textures.
I had left this out for a long time because it regressed some
depthstencil-render-miplevels cases when it was enabled.  Now that the
bugs causing those are fixed, there's nothing stopping us.

Improves glbenchmark 2.1 offscreen performance by 7.3% +/- 2.8% (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-26 12:03:04 -08:00
Eric Anholt
3e1d8e62e7 intel: Use the parent miptree's format for setting up HiZ miptrees.
This worked out before because the parent was always 4 bytes so it
didn't affect the layout, but now we want to support Z16 too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-26 12:02:47 -08:00
Eric Anholt
cb3b172d19 intel: Remove a couple of dead function prototypes.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:12 -08:00
Eric Anholt
0d6a722ec4 i965: Add perf debug for depth/stencil alignment workaround.
Fixing these rendering bugs has been implicated in performance
regressions (which may be unfixable), but at least knowing that it's
happening should help diagnose those regressions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
e454b2d480 i965: Assert that relayout laid out something that won't need it again.
The ETC1 changes failed at this, so let's make sure it will be caught in
testing next time.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
3b458416e3 i965: Also fix validation of Z32F_S8 textures.
This was caught by the assertion in the next commit.  It fixes the
remaining piglit depthstencil-render-miplevels cases, probably by
avoiding broken stencil copies in the validation path.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
46386816a7 i965: Fix validation of ETC miptrees.
When comparing to the teximage's format, we have to look at the
format-the-mt-was-created-for not the format-actually-stored-in-the-mt.

Improves glbenchmark 2.1 offscreen test performance 159% +/- 17% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54582
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
3b99d094c9 qi965: Add perf debug for texture relayout.
Relayout is expensive, so it's something developers (both us and others)
should know about when it happens.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-22 13:45:56 -08:00
Eric Anholt
c417d261dd i965: Fix hiz resolves getting stomped by depth offset validation.
Fixes all the remaining non-Z32F_S8 depthstencil-render-miplevels tests
in piglit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:41:22 -08:00
Marek Olšák
a58bf9d8f9 r600g: rename GPU_FLUSH -> INVAL_READ_CACHES
because that's what it does.
2012-12-22 19:39:29 +01:00
Marek Olšák
9ef26fc667 r600g: remove redundant parameter alloc_bo from r600_texture_create_object
alloc_bo == !buf
2012-12-22 19:39:29 +01:00
Matt Turner
a585b8f3a6 Make IsVertexArray() return false before BindVertexArray()
Rename existing _Used flag to EverBound.

The GL 4.3 and ES 3.0 specs say

   These names are marked as used, for the purposes of GenVertexArrays
   only, but they do not acquire array state until they are first bound.

This also affects Apple VAOs, which is fine since the
APPLE_vertex_array_object spec says

   A vertex array object is created by binding an unused name. This
   binding is accomplished by calling BindVertexArrayAPPLE with id set
   to the name of the new vertex array object.

Fixes arb_vertex_array_object_isvertexarray.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-21 20:03:30 -08:00
Matt Turner
fd93d55141 Make IsTransformFeedback() return false before BindTransformFeedback()
The GL 4.3 an ES 3.0 specs say

   A transform feedback object is created by binding a name returned by
   GenTransformFeedbacks with the command
      void BindTransformFeedback( enum target, uint id );

Fixes arb_transform_feedback2-istransformfeedback and part of
es3conform's CoverageES30.test.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-21 20:03:07 -08:00
Dave Airlie
54203ef5ac nouveau: deal with tbo cap for now.
This fixes the printk running apps against master.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-22 13:12:30 +10:00
Marek Olšák
9c6410e5c3 r600g: always use a tiled resource as the destination of MSAA resolve
i.e. we have to allocate a temporary tiled resource if dst isn't tiled.

This fixes hardlocks on r6xx-r7xx, though using a linear resource is forbidden
on later asics as well.

NOTE: This is a candidate for the stable branches.
2012-12-21 23:43:34 +01:00
Marek Olšák
9b0b4cf058 winsys/radeon: the env var RADEON_NOOP can be used to skip CS ioctls 2012-12-21 23:42:23 +01:00
Marek Olšák
eccc74f5d3 r600g: remove a false comment 2012-12-21 23:42:09 +01:00
Marek Olšák
fb45a816eb r600g: don't suspend TIME_ELAPSED queries during flushing
According to the GL spec, the result should be equivalent to comparing
two timestamps.
2012-12-21 23:42:04 +01:00
Marek Olšák
6d49ffde11 gallium/tests: fix build breakage after pipe_surface::usage removal 2012-12-21 23:41:41 +01:00
Frank Henigman
46e3aeb077 mesa: add bounds checking for uniform array access
No piglit regressions and now passes glsl-uniform-out-of-bounds-2.

validate_uniform_parameters now checks that the array index is
valid.  This means if an index is out of bounds, glGetUniform* now
fails with GL_INVALID_OPERATION, as it should.
_mesa_uniform and _mesa_uniform_matrix also call
validate_uniform_parameters so the bounds checks there became
redundant and were removed.

The test in glGetUniformLocation is modified to check array bounds
so it now returns GL_INVALID_INDEX (-1) if you ask for the location
of a non-existent array element, as it should.

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2012-12-21 11:23:48 -08:00
José Fonseca
74f0731953 util/u_format: Round when converting depth values from float to z16_unorm.
This makes the z16_unorm -> float -> z16_unorm conversion lossless.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-12-21 10:04:51 +00:00
Jerome Glisse
e8ca1a53a6 r600g: add cs tracing infrastructure for lockup pin pointing
It's a build time option you need to set R600_TRACE_CS to 1 and it
will print to stderr all cs along as cs trace point value which
gave last offset into a cs process by the GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-12-20 18:23:54 -05:00
Jerome Glisse
6532eb17ba r600g: add htile support v16
htile is used for HiZ and HiS support and fast Z/S clears.
This commit just adds the htile setup and Fast Z clear.
We don't take full advantage of HiS with that patch.

v2 really use fast clear, still random issue with some tiles
   need to try more flush combination, fix depth/stencil
   texture decompression
v3 fix random issue on r6xx/r7xx
v4 rebase on top of lastest mesa, disable CB export when clearing
   htile surface to avoid wasting bandwidth
v5 resummarize htile surface when uploading z value. Fix z/stencil
   decompression, the custom blitter with custom dsa is no longer
   needed.
v6 Reorganize render control/override update mecanism, fixing more
   issues in the process.
v7 Add nop after depth surface base update to work around some htile
   flushing issue. For htile to 8x8 on r6xx/r7xx as other combination
   have issue. Do not enable hyperz when flushing/uncompressing
   depth buffer.
v8 Fix htile surface, preload and prefetch setup. Only set preload
   and prefetch on htile surface clear like fglrx. Record depth
   clear value per level. Support several level for the htile
   surface. First depth clear can't be a fast clear.
v9 Fix comments, properly account new register in emit function,
   disable fast zclear if clearing different layer of texture
   array to different value
v10 Disable hyperz for texture array making test simpler. Force
    db_misc_state update when no depth buffer is bound. Remove
    unused variable, rename depth_clearstencil to depth_clear.
    Don't allocate htile surface for flushed depth. Something
    broken the cliprect change, this need to be investigated.
v11 Rebase on top of newer mesa
v12 Rebase on top of newer mesa
v13 Rebase on top of newer mesa, htile surface need to be initialized
    to zero, somehow special casing first clear to not use fast clear
    and thus initialize the htile surface with proper value does not
    work in all case.
v14 Use resource not texture for htile buffer make the htile buffer
    size computation easier and simpler. Disable preload on evergreen
    as its still troublesome in some case
v15 Cleanup some comment and remove some left over
v16 Define name for bit 20 of CP_COHER_CNTL

Signed-off-by: Pierre-Eric Pelloux-Prayer <pelloux@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-12-20 18:23:51 -05:00
Jerome Glisse
24b1206ab2 r600g: rework flusing and synchronization pattern v7
This bring r600g allmost inline with closed source driver when
it comes to flushing and synchronization pattern.

v2-v4: history lost somewhere in outer space
v5: Fix compute size of flushing, use define for flags, update
    worst case cs size requirement for flush, treat rs780 and
    newer as r7xx when it comes to streamout.
v6: Fix num dw computation for framebuffer state, remove dead
    code, use define instead of hardcoded value.
v7: Remove dead code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-12-20 18:23:31 -05:00
Paul Berry
cf5632094b mesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.
Previously, Mesa code assumed that glReadBuffer(GL_NONE) was only
valid for user-created framebuffer objects.  However, the spec is
quite clear that is should also be valid for the default framebuffer.
From section 18.2.1 ("Obtaining Pixels from the Framebuffer") of the
GL 4.3 spec:

    "When READ_FRAMEBUFFER_BINDING is zero, i.e. the default
    framebuffer, src must be one of the values listed in table 17.4,
    including NONE."

Similar language exists in the GLES 3.0 spec, and in desktop GL all
the way back to ARB_framebuffer_object.

Partially fixes GLES3 conformance test "CoverageES30.test".

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-20 10:03:30 -08:00
José Fonseca
ab2f573634 llvmpipe: Drop PIPE_QUERY_TIME_ELAPSED support.
It was slightly wrong: we were computing the longest duration of
the query among all the rasterizer tasks.

Regardless, for tile-based implementations such as llvmpipe, time differences
will never be very useful, because rendering before/during/after the query
is all interleaved.  And this is expected, see ARB_timer_query spec, issue 10.

In particular, piglit ext_timer_query-time-elapsed still fails, because
it makes assumptions that don't hold true in in tiled architectures. Not
sure how to fix that though.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-20 16:33:49 +00:00
José Fonseca
3160b0b9fc mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.
ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the
subtraction of two GL_TIMESTAMP queries.

And for a lot of drivers, that's precisely how they have to implement
internally -- by emitting two hardware timestamp queries.

So, to simplify driver implementation, simply allow doing so in the state
tracker.

Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could
retire it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-20 16:33:49 +00:00
José Fonseca
9976216bf6 gallium: s/PIPE_CAP_TIMER_QUERY/PIPE_CAP_QUERY_TIME_ELAPSED/
To better reflect what it is being advertised.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-20 16:33:49 +00:00
Marek Olšák
ef11ed61a0 r600g: add assertions to prevent creation of invalid surfaces 2012-12-20 17:13:18 +01:00
Marek Olšák
fefa2112bf r600g: refactor and make streamout dumping more informative
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:15 +01:00
Marek Olšák
6a2ec765bd r600g: try to fix streamout for the cases where BURST_COUNT > 0
The burst was incorrectly used, because ELEM_SIZE was always 0.
I don't know if the burst works, because I don't know of any test
which uses it.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:12 +01:00
Marek Olšák
72362ebefb r600g: lower stream outputs with dst_offset < start_component
This fixes streamout breakage caused by the varying packing.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:09 +01:00
Marek Olšák
d0e40bd3ed r600g: use r600_get_temp to get temporaries for CLIPDIST shader outputs
I need this to be able to use r600_get_temp in the function later.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:06 +01:00
Brian Paul
fddcc67f5c softpipe: fix up FS variant unbinding / deletion
The old call to tgsi_exec_machine_bind_shader() in
softpipe_delete_fs_state() was never called since the shader's original
tokens are never passed to the tgsi interpreter (only shader _variant_
tokens are).  Now, unbind the variant's tokens from the tgsi interpreter
when we free the variant.

This doesn't fix any known bugs but it's the right thing to do.

Note: This is a candidate for the stable branches.
2012-12-19 09:02:08 -07:00
Brian Paul
18ef8f83b2 softpipe: fix unreliable FS variant binding bug
In exec_prepare() we were comparing pointers to see if the fragment
shader variant had changed before calling tgsi_exec_machine_bind_shader().
This didn't work reliably when there was a lot of shader token malloc/
freeing going on because the memory might get reused.
Instead, bind the shader variant during regular state validation.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=40404
(fixes a couple of piglit's glsl-max-varyings test)

Note: This is a candidate for the stable branches.
2012-12-19 09:02:08 -07:00
Jerome Glisse
50880314e3 Revert "r600g: work around ddx over alignment"
This reverts commit d8287bac1f.

Cause more issue than it fix. Need to think of a proper solution.
2012-12-19 09:56:17 -05:00
Jerome Glisse
d8287bac1f r600g: work around ddx over alignment
This force surface allocated from ddx to be consider as height
aligned on 8 and fix 1D->2D tiling transition that result from
this.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-18 16:10:54 -05:00
Paul Berry
1b37fc40fc i965: Fix gl_VertexID when there are no other vertex inputs.
brw_emit_vertices contains special case logic to handle the case where
a vertex shader doesn't read any inputs.  This special case logic was
incorrectly activating in the case were the only vertex input is
gl_VertexID.  As a result, if a shader used gl_VertexID but used no
other inputs, then all vertices got a gl_VertexID of zero.

Fixes oglconform test "ubo-usage advanced.transform_feedback".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-18 09:02:53 -08:00
Paul Berry
5b7099c74d mesa: Make a function is_transform_feedback_active_and_unpaused.
The rather unweildy logic for determining this condition was repeated
in a large number of places.  This patch consolidates it to a single
inline function.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-18 09:02:53 -08:00
Paul Berry
1ad516207d mesa: Fix corner cases of BindBufferBase with transform feedback.
This patch implements the following behaviours, which are mandated by
the GL 4.3 and GLES3 specs.

1. Regarding the GL_TRANSFORM_FEEDBACK_BUFFER_SIZE query: "If the
   ... size was not specified when the buffer object was bound
   (e.g. if it was bound with BindBufferBase), ... zero is returned."
   (GL 4.3 section 6.7.1 "Indexed Buffer Object Limits and Binding
   Queries").

2. "BindBufferBase binds the entire buffer, even when the size of the
   buffer is changed after the binding is established. It is
   equivalent to calling BindBufferRange with offset zero, while size
   is determined by the size of the bound buffer at the time the
   binding is used."  (GL 4.3 section 6.1.1 "Binding Buffer Objects to
   Indexed Targets").  I interpret "at the time the binding is used"
   to mean "at the time of the call to glBeginTransformFeedback".

3. "Regardless of the size specified with BindBufferRange, or
   indirectly with BindBufferBase, the GL will never read or write
   beyond the end of a bound buffer. In some cases this constraint may
   result in visibly different behavior when a buffer overflow would
   otherwise result, such as described for transform feedback
   operations in section 13.2.2."  (GL 4.3 section 6.1.1 "Binding
   Buffer Objects to Indexed Targets").

Item 1 has been part of the spec all the way back to the inception of
the EXT_transform_feedback extension.  Items 2 and 3 were added in GL
4.2 and GLES 3.

Prior to GL 4.2, in place of items 2 and 3, the spec simply said
"BindBufferBase is equivalent to calling BindBufferRange with offset
zero and size equal to the size of buffer."  For transform feedback,
Mesa behaved as though this meant "...equal to the size of buffer at
the time of the call to BindBufferBase".  However, this was
problematic because it left it ambiguous what to do if the buffer is
shrunk between the call to BindBuffer{Base,Range} and the call to
BeginTransformFeedback.  Prior to this patch, Mesa's behaviour was to
try to write beyond the end of the buffer, likely resulting in memory
corruption.  In light of this, I'm interpreting the spec change as a
clarification, not an intended behavioural change, so I'm making the
change apply regardless of API version.

Fixes GLES3 conformance test transform_feedback2_pause_resume.test.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-18 09:02:49 -08:00
Paul Berry
b87e65c3b6 mesa/gles3: Generate error on draw call if transform feedback would overflow.
In desktop GL, if a draw call would cause transform feedback buffers
to overflow, the draw call should succeed, and the extra primitives
should simply not be recorded in the transform feedback buffers.

In GLES3, however, if a draw call would cause transform feedback
buffers to overflow, the draw call is supposed to produce an
INVALID_OPERATION error and no drawing should occur.

This patch implements the GLES3-required behaviour.

Fixes GLES3 conformance test "transform_feedback_overflow.test".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-18 08:31:38 -08:00
Paul Berry
febc237141 mesa/gles3: Generate error on DrawElements* calls if transform feedback active.
In GLES3, only glDrawArrays() and glDrawArraysInstanced() calls are
allowed when transform feedback is active.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-18 08:31:34 -08:00
Paul Berry
3870f2903f mesa: refactor _mesa_compute_max_transform_feedback_vertices from i965.
Previously, the i965 driver contained code to compute the maximum
number of vertices that could be written without overflowing any
transform feedback buffers.  This code wasn't driver-specific, and for
GLES3 support we're going to need to use it in core mesa.  So this
patch moves the code into a core mesa function,
_mesa_compute_max_transform_feedback_vertices().

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

v2: Eliminate C++-style variable declarations, since these won't work
with MSVC.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-18 08:31:26 -08:00
Paul Berry
61c1b065fb mesa: Change args to vbo_count_tessellated_primitives.
No functional change--this simply paves the way to allow futures
patches to call vbo_count_tessellated_primitives() during error
checking, before the _mesa_prim struct has been constructed.

This will be needed for GLES3, which requires draw calls to fail if
there is not enough space available in transform feedback buffers to
accommodate the primitives to be drawn.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-18 08:31:03 -08:00
Vadim Girlin
8cf552b182 radeon/llvm: improve cube map handling
Add support for TEX2, TXB2, TXL2, fix SHADOWCUBE

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-18 17:40:57 +04:00
Vadim Girlin
3b89fcbe54 radeon/llvm: fix TXQ_LZ handling for cube maps
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-12-18 17:40:57 +04:00
Vadim Girlin
63cabf0abb r600g: initialize inst_mod in r600_tex_from_byte_stream
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-12-18 17:40:57 +04:00
Roland Scheidegger
dc613f11dd gallivm: fix conversion for pure integer formats
Since the idea is to just expand or shrink the bit width but not otherwise do
conversion we also need to adjust the sign bit according to src, otherwise
the conversion code will incorrectly clamp the values. (Since this only works
for casting to ordinary floats the norm and fixed bits should always be fine.)

This fixes the remaining piglit attribs GL3 failures.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-18 01:57:35 +01:00
Kenneth Graunke
12f3b3d437 glsl: Fix gl_context vs. ralloc context in check_version again, again.
Dave found some, but there were more.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58039
2012-12-17 11:20:53 -08:00
Andreas Pokorny
fd65fb5aa8 vega: fix for object handle leak
frees the object handle when a OpenVG
is destroyed.

Signed-off-by: Andreas Pokorny <andreas.pokorny@elektrobit.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-17 10:22:26 -07:00
Brian Paul
9b13e731fa wmesa: include version.h to silence warning 2012-12-17 10:22:22 -07:00
Brian Paul
a9048aa6e6 xlib: include headers to fix errors/warnings 2012-12-17 10:22:10 -07:00
Jordan Justen
6cf3034ba7 mesa osmesa/x11: fix build error introduced in 4bea4cb9
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58380

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-17 08:55:41 -08:00
Roland Scheidegger
3d14b25030 gallivm: fix texel fetch for array textures (2)
a460aea3f1 wasn't entirely correct,
since all coords are already ints hence need to skip the iround.
Passes piglit texelFetch with sampler1DArray/sampler2DArray.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-17 11:50:27 +01:00
Jordan Justen
1358f3a905 mesa: assert if driver did not compute the version
Make sure drivers initialize the version before:
 * _mesa_initialize_exec_table is called
 * _mesa_initialize_exec_table_vbo is called
 * A context is made current

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:28 -08:00
Jordan Justen
075f8722ab mesa: don't initialize VBO vtxfmt in _vbo_CreateContext
The driver should call _mesa_initialize_vbo_vtxfmt after
computing the context version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:28 -08:00
Jordan Justen
53ee3959f2 mesa: don't initialize exec dispatch tables in _mesa_initialize_context
Drivers must compute the context version, and then call
_mesa_initialize_exec_table themselves.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
d5d1f10955 mesa dispatch_sanity: call new functions to initialize exec table
In a future patch the exec functions will no longer set up
by _mesa_initialize_context and _vbo_CreateContext.

Therefore we must call _mesa_initialize_exec_table and
_mesa_initialize_exec_table_vbo.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
4bea4cb9fd drivers: compute version and then initialize exec table
This change forces the context version to be computed before
initilizing the exec dispatch tables.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
0924f4e90c vbo: add _mesa_initialize_vbo_vtxfmt
This function initializes the exec/save dispatch tables
for VBO vtxfmt.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
d440149538 mesa: separate exec allocation from initialization
In glapi/gl_genexec.py:
* Remove _mesa_alloc_dispatch_table call

In glapi/gl_genexec.py and api_exec.h:
* Rename _mesa_create_exec_table to _mesa_initialize_exec_table

In context.c:
* Call _mesa_alloc_dispatch_table instead of _mesa_create_exec_table
* Call _mesa_initialize_exec_table (this is temporary)

Once all drivers have been modified to call
_mesa_initialize_exec_table, then the call to
_mesa_initialize_context can be removed from context.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Dave Airlie
fa5078c255 r600g: fixup offset types for printing
This allows the debug code to at least show the sign properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 10:36:42 +00:00
Henri Verbeet
cf358a2b42 gallium/u_blitter: Remove the overlapped blit assert from util_blitter_blit_generic().
This is used by st_BlitFramebuffer() / r600_blit(), and ARB_fbo allows
overlapped blits, even though the result is undefined. No piglit regressions
on r600g / CYPRESS.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-16 11:13:20 +01:00
Dave Airlie
a9abaaafd8 glsl_parser_extras.cpp: fixup gl vs mem contexts again.
This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=58039

Tested-by: Darxus on bug 58039
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 17:30:08 +10:00
Kenneth Graunke
4f91f8dd60 i965: Move BRW_MAX_GRF and similar defines to brw_reg.h.
These don't really belong in brw_structs.h.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-15 13:40:16 -08:00
Kenneth Graunke
1db1283563 i965: Split struct brw_reg out from brw_eu.h into its own header.
struct brw_instruction and the related instruction emitting code won't
be useful on Gen8+, as the instruction encoding changed.  However, the
struct brw_reg code is still extremely valuable.

While we're at it, fix up some style points:
- s/GLuint/unsigned/g
- s/GLint/int/g
- s/GLshort/int16_t/g
- s/GLushort/uint16_t/g
- s/INLINE/inline/g
- Replace tabs with spaces
- Put return types on a separate line from the function name/parameters
- Remove trailing whitespace
- Remove extraneous whitespace around function parameters

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-15 13:40:09 -08:00
Dave Airlie
e1ca88f098 docs: add ARB_texture_buffer_object_rgb32
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 07:07:43 +10:00
Dave Airlie
39fa4c0a58 st/mesa: add texture buffer object rgb32 support.
This checks if the pipe driver can support RGB32 formats.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 06:55:39 +10:00
Dave Airlie
1b62c326ea mesa: add support for ARB_texture_buffer_object_rgb32
This adds the extensions + the tex buffer support for checking
the formats.

There is a piglit test enhancement sent to that list.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 06:55:33 +10:00
Dave Airlie
7d7a549fa0 glsl: avoid using gl context as a memory context
Not sure what was going on here, but running piglit with debug builds
might be a good plan :-)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-15 15:29:49 +10:00
Ian Romanick
b23e92dbe7 i965: Add missing autoconf bits so test_vec4_register_coalesce will build
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Eric Anholt <eric@anholt.net>
2012-12-14 18:44:18 -08:00
Eric Anholt
c9e48e5b08 i965: Generalize VS compute-to-MRF for compute-to-another-GRF, too.
No statistically significant performance difference on glbenchmark 2.7
(n=60).  It reduces cycles spent in the vertex shader by 3.3% +/- 0.8%
(n=5), but that's only about .3% of all cycles spent according to the
fixed shader_time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:06:35 -08:00
Eric Anholt
471af25fc5 i965/vs: Extend opt_compute_to_mrf to handle limited "reswizzling"
The way our visitor works, scalar expression/swizzle results that get
stored in channels other than .x will have an intermediate MOV from
their result in the .x channel to the real .y (or whatever) channel, and
similarly for vec2/vec3 results.

By knowing how to adjust DP4-type instructions for optimizing out a
swizzled MOV, we can reduce instructions in common matrix multiplication
cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:06:30 -08:00
Eric Anholt
a76a03f437 i965/vs: Add a unit test for opt_compute_to_mrf().
The compute-to-mrf code is really twitchy, and it's hard to construct
GLSL testcases for it.  This unit test is also really hard to work with
(for example, if your instruction is removed by dead code elimination,
you end up inspecting something irrelevant), but I did use it for
debugging some of the commits to follow.

I called it test_vec4_register_coalesce because the compute-to-mrf code
is about to morph into that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:06:01 -08:00
Eric Anholt
7171c45d3a i965/fs: Drop an unnecessary _safe on a list walk.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:05:57 -08:00
Eric Anholt
78ce522932 i965/fs: Add a note explaining a detail of register_coalesce_2().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:05:48 -08:00
Eric Anholt
7baf9198b2 i965: Also consider HALTs a potential block end.
The final halt of the fragment shader turns off the remaining channels,
then jumps such that everything is turned back on.  So, we can have our
last ENDIF of the shader point at that directly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:45:26 -08:00
Kenneth Graunke
2702202290 i965: Jump to the end of the next outer conditional block on ENDIFs.
From the Ivybridge PRM, Volume 4, Part 3, section 6.24 (page 172):

"The endif instruction is also used to hop out of nested conditionals by
 jumping to the end of the next outer conditional block when all
 channels are disabled."

Also:
"Pseudocode:
 Evaluate(WrEn);
 if ( WrEn == 0 ) {  // all channels false
   Jump(IP + JIP);
 }"

First, ENDIF re-enables any channels that were disabled because they
didn't match the conditional.  If any channels are active, it proceeds
to the next instruction (IP + 16).  However, if they're all disabled,
there's no point in walking through all of the instructions that have no
effect---it can jump to the next instruction that might re-enable some
channels (an ELSE, ENDIF, or WHILE).

Previously, we always set JIP on ENDIF instructions to 2 (which is
measured in 8-byte units).  This made it do Jump(IP + 16), which just
meant it would go to the next instruction even if all channels were off.

It turns out that walking over instructions while all the channels are
disabled like this is worse than just instruction dispatch overhead: if
there are texturing messages, it still costs a couple hundred cycles to
not-actually-read from the texture results.

This patch finds the next instruction that could re-enable channels and
sets JIP accordingly.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 15:42:34 -08:00
Chris Forbes
2f7f095a80 i965: expose ARB_texture_cube_map_array
V3: Put enable in an existing block rather than making a new
one for no good reason.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:51 -08:00
Eric Anholt
380fc562b3 i965/fs: Fix setup for textureGrad(samplerCubeArray, coord, dPdx, dPdy)
Caught by tex_grad-01.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:48 -08:00
Eric Anholt
3c56063354 i965/fs: Move the failure for gen7 16-wide intdiv to emit_math().
The cube map array code adds another caller of emit_math(), which
needs this check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:43 -08:00
Chris Forbes
d2dbba8755 i965: fs: Add fixup for textureSize on Gen6/7
V2: Moved up into emit(ir_texture *) to avoid duplication and fix
ordering for Gen7; Gen6 math quirks moved into previous patches.

Tested on Gen6 only; passes all the cube_map_array piglits.

V3: Fixed weird whitespace
V4: Use sampler->type; otherwise broken on arrays of samplers.
v5: Minor style fixes (by anholt)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:39 -08:00
Chris Forbes
6e34723ac9 i965: fs: fix gen6+ math operands in one place
V4: Fix various style nits as pointed out by Eric, and expand IMM
    operands on both Gen6 and Gen7.
v5: minor style nits (by anholt)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:35 -08:00
Chris Forbes
f6a3fda25d i965: vs: Add fixup for textureSize with cube array samplers
V3: Fixed weird whitespace
V4: Use sampler's type rather than variable's type; otherwise broken
    with arrays of samplers. (Thanks Eric)
v5: Fix a couple more style nits (by anholt)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:31 -08:00
Chris Forbes
1cb57ea493 i965/vs: Fix gen6+ math operand quirks in one place
This causes immediate values to get moved to a temp on gen7, which is needed
for an upcoming change but hadn't happened in the visitor until then.

v2: Drop gen > 7 checks (doesn't exist), and style-fix comments (changes by
    anholt).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:28 -08:00
Chris Forbes
0cda3382a6 i965: Add various plumbing for cubemap arrays
V4: Fixed style nits

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:12 -08:00
Eric Anholt
2cae9f2d4a i965/fs: Add empirically-determined instruction latencies for gen7.
v2: Actually switch on the other math instructions mentioned in the
    comment.
v3: Add timing data for textureSize(), and clean up some long comment
    lines.

Testing shader_time of fs16 shaders on a few frames of various apps:
nexuiz improved by 2.9% +/- 1.5% (n=10)
no difference on GLB2.5 (n=36, outliers removed)
no difference on GLB2.7 (n=25)
etqw improved by 2.6% +/- 2.2% (n=25)
no difference on lightsmark (n=25)

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:22 -08:00
Eric Anholt
4df1e18864 i965/fs: Fix the clock increment in scheduling.
I've tested this to be true with various ALU ops on gen7 (with the
exception of MADs, which go at either 3 or 4 cycles per dispatch).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:14 -08:00
Eric Anholt
6255fc7426 i965/fs: Move the old gen4 bspec-based scheduling info to a helper func.
For gen7 everything changes, and we have actual information on latency.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:10 -08:00
Eric Anholt
461a29783a i965/fs: Set up gen7 UBO loads as sends from GRFs.
This gives the instruction scheduler a chance to schedule between the
loads, whereas before it was restricted due to the dependencies between
the MRFs for setting them up.

For one shader in gles3conform, it goes from getting stuck in register
allocation for as long as anybody's bothered to leave it running down
to 23 seconds, thanks to the LIFO scheduling.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:05 -08:00
Eric Anholt
456dbcc337 i965/fs: Before reg alloc, schedule instructions to reduce live ranges.
This came from an idea by Ben Segovia.  16-wide pixel shaders are very
important for latency hiding on i965, so we want to try really hard to
get them.  If scheduling an instruction makes some set of instructions
available, those are probably the ones that make the instruction's
result dead.  By choosing those first, we'll have a tendency to reduce
the amount of live data as opposed to creating more.

Previously, we were sometimes getting this behavior out of the
scheduler, which was what produced the scheduler's original performance
wins on lightsmark.  Unfortunately, that was mostly an accident of the
lame instruction latency information that I had, which made it
impossible to fix the actual scheduling for performance.  Now that we've
fixed the scheduling for setup for register allocation, we can safely
update the latency parameters for the final schedule.

In shader-db, we lose 37 16-wide shaders, but gain 90 new ones.  4
shaders that were spilling change how many registers spill, for a
reduction of 70/3899 instructions.

v2: Simplify the new loop.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:17:59 -08:00
Eric Anholt
ba864bfcfa i965/fs: Add some optional debug printfs to scheduling.
Seeing when instructions become available to schedule is really useful.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:17:55 -08:00
Eric Anholt
7a9f940cab i965/fs: Schedule instructions both before and after register allocation.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:17:41 -08:00
Eric Anholt
1315f3b4b3 i965: Make sure that the shader_time report at context destroy happens.
Otherwise, you end up with some report from within a second of context
destroy, which is now what you really want for testing the impact of
changes
2012-12-14 15:05:10 -08:00
Eric Anholt
81c247404a i965: Print a total time for the different shader stages.
Sometimes I've got a patch for a performance optimization that's not
showing a statistically significant performance difference on reported
FPS, but still seems like a good idea because it ought to reduce time
spent in the shader.  If I can see the total number of cycles spent in
the shader stage being optimized, it may show that the patch is still
worthwhile (or point out that it's actually broken in some way).
2012-12-14 15:05:10 -08:00
Eric Anholt
f74560f3fb i965: Scale shader_time to compensate for resets.
Some shaders experience resets more than others, which skews the numbers
reported.  Attempt to correct for this by linearly scaling according to
the number of resets that happen.

Note that will not be accurate if invocations of shaders have varying
times and longer invocations are more likely to reset.  However, this
should at least be better than the previous situation.
2012-12-14 15:05:10 -08:00
Eric Anholt
338b5f887d i965: Adjust the split between shader_time_end() and shader_time_write().
I'm about to emit other kinds of writes besides time deltas, and it
turns out with the frequency of resets, we couldn't really use the old
time delta write() function more than once in a shader.
2012-12-14 15:05:10 -08:00
Paul Berry
ca7e891e8a glsl/linker: Pack between varyings.
This patch implements varying packing between varyings.

Previously, each varying occupied components 0 through N-1 of its
assigned varying slot, so there was no way to pack two varyings into
the same slot.  For example, if the varyings were a float, a vec2, a
vec3, and another vec2, they would be stored as follows:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 flt  x   x   x  <vec2->  x   x  <--vec3--->  x  <vec2->  x   x   varyings

(Each * represents a varying component, and the "x"s represent wasted
space).

This change packs the varyings together to eliminate wasted space
between varyings, like so:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 <vec2-> <vec2-> flt <--vec3--->  x   x   x   x   x   x   x   x   varyings

Note that we take advantage of the sort order introduced in previous
patches (vec4's first, then vec2's, then scalars, then vec3's) to
minimize how often a varying is "double parked" (split across varying
slots).

Reviewed-by: Eric Anholt <eric@anholt.net>

v2: Skip varying packing if ctx->Const.DisableVaryingPacking is true.
2012-12-14 10:51:21 -08:00
Paul Berry
df87722bec glsl/linker: Pack within compound varyings.
This patch implements varying packing within varyings that are
composed of multiple vectors of size less than 4 (e.g. arrays of
vec2's, or matrices with height less than 4).

Previously, such varyings used up a full 4-wide varying slot for each
constituent vector, meaning that some of the components of each
varying slot went unused.  For example, a mat4x3 would be stored as
follows:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 <-column1->  x  <-column2->  x  <-column3->  x  <-column4->  x   matrix

(Each * represents a varying component, and the "x"s represent wasted
space).  In addition to wasting precious varying components, this
layout complicated transform feedback, since the constituents of the
varying are expected to be output to the transform feedback buffer
contiguously (e.g. without gaps between the columns, in the case of a
matrix).

This change packs the constituents of each varying together so that
all wasted space is at the end.  For the mat4x3 example, this looks
like so:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 <-column1-> <-column2-> <-column3-> <-column4->  x   x   x   x   matrix

Note that matrix columns 2 and 3 now cross a boundary between varying
slots (a characteristic I call "double parking" of a varying).

We don't bother trying to eliminate the wasted space at the end of the
varying, since the patch that follows will take care of that.

Since compiler back-ends don't (yet) support this packed layout, the
lower_packed_varyings function is used to rewrite the shader into a
form where each varying occupies a full varying slot.  Later, if we
add native back-end support for varying packing, we can make this
lowering pass optional.

Reviewed-by: Eric Anholt <eric@anholt.net>

v2: Skip varying packing if ctx->Const.DisableVaryingPacking is true.
2012-12-14 10:51:18 -08:00
Paul Berry
4bb8661b1b gallium: Disable varying packing on hardware with <=8 texture indirections.
In practice this will disable varying packing on R300, R400, i915g,
and nv30.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-14 10:51:10 -08:00
Paul Berry
6ee500cfd2 mesa: Add an option so driver can opt out of varying packing.
On hardware that supports a limited number of texture indirections,
varying packing will comsume an extra texture indirection, since ALU
operations are needed in the fragment shader to unpack the varyings
before any texturing can be done.

This patch introduces a new driver option,
ctx->Const.DisableVaryingPacking, which can be used by a driver to opt
out of varying packing if the extra texture indirection is costly
enough to outweigh the advantages of packing varyings.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-14 10:49:32 -08:00
Paul Berry
1745a4d751 glsl: Add a lowering pass for packing varyings.
This lowering pass generates GLSL code that manually packs varyings
into vec4 slots, for the benefit of back-ends that don't support
packed varyings natively.

No functional change--the lowering pass is not yet used.

Reviewed-by: Eric Anholt <eric@anholt.net>

v2: Don't use ir_hierarchical_visitor--just loop over instructions
directly.  Also, make the names of the packed varyings include the
names of the original varyings that were packed into them.
2012-12-14 10:49:21 -08:00
Paul Berry
f3993107f0 glsl/linker: Sort varyings by packing class, then vector size.
This patch paves the way for varying packing by adding a sorting step
before varying assignment, which sorts the varyings into an order that
increases the likelihood of being able to find an efficient packing.

First, varyings are sorted into "packing classes" by considering
attributes that can't be mixed during varying packing--at the moment
this includes base type (float/int/uint/bool) and interpolation mode
(smooth/noperspective/flat/centroid), though later we will hopefully
be able to relax some of these restrictions.  The number of packing
classes places an upper limit on the amount of space that must be
wasted by varying packing, since in theory a shader might nave 4n+1
components worth of varyings in each of m packing classes, resulting
in 3m components worth of wasted space.

Then, within each packing class, varyings are sorted by vector size,
with vec4's coming first, then vec2's, then scalars, and then finally
vec3's.  The motivation for this order is that it ensures that the
only vectors that might be "double parked" (with part of the vector in
one varying slot and the remainder in another) are vec3's.

Note that the varyings aren't actually packed yet, merely placed in an
order that will facilitate packing.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 10:49:12 -08:00
Paul Berry
eb989e37cb glsl/linker: Subdivide the first phase of varying assignment.
This patch further subdivides the loop that assigns varying locations
into two phases: one phase to match up the varyings between shader
stages, and one phase to assign them varying locations.

In between the two phases the matched varyings are stored in a new
data structure called varying_matches.  This will free us to be able
to assign varying locations in any order, which will pave the way for
packing varyings.

Note that the new varying_matches::assign_locations() function returns
the number of varying slots that were used; this return value will be
used in a future patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 10:49:08 -08:00
Paul Berry
25ed3bef9b glsl/linker: Defer recording transform feedback locations.
This patch subdivides the loop that assigns varying locations into two
phases: one phase to match up varyings between shader stages (and
assign them varying locations), and a second phase to record the
varying assignments for use by transform feedback.

This paves the way for varying packing, which will require us to
further subdivide the first phase.

In addition, it lets us avoid a clumsy O(n^2) algorithm, since we can
now record the locations of all transform feedback varyings in a
single pass through the tfeedback_decls array, rather than have to
iterate through the array after assigning each varying.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 10:49:05 -08:00
Paul Berry
3e81c666db glsl: Create a field to store fractional varying locations.
Currently, the location of each varying is recorded in ir_variable as
a multiple of the size of a vec4.  In order to pack varyings, we need
to be able to record, e.g. that a vec2 is stored in the second half of
a varying slot rather than the first half.

This patch introduces a field ir_variable::location_frac, which
represents the offset within a vec4 where a varying's value is stored.
Varyings that are not subject to packing will always have a
location_frac value of zero.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:52 -08:00
Paul Berry
3c9c17db4a glsl/linker: Make separate ir_variable field to mean "unmatched".
Previously, the linker used a value of -1 in ir_variable::location to
denote a generic input or output of the shader that had not yet been
matched up to a variable in another pipeline stage.

This patch introduces a new ir_variable field,
is_unmatched_generic_inout, for that purpose.

In future patches, this will allow us to separate the process of
matching varyings between shader stages from the processes of
assigning locations to those varying.  That will in turn pave the way
for packing varyings.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:38 -08:00
Paul Berry
50895d443a glsl/linker: Always invalidate shader ins/outs, even in corner cases.
Previously, link_invalidate_variable_locations() was only called
during assign_attribute_or_color_locations() and
assign_varying_locations().  This meant that in the corner case when
there was only a vertex shader, and varyings were being captured by
transform feedback, link_invalidate_variable_locations() wasn't being
called for the varyings.

This patch migrates the calls to link_invalidate_variable_locations()
to link_shaders(), so that they will be called in all circumstances.
In addition, it modifies the call semantics so that
link_invalidate_variable_locations() need only be called once per
shader stage (rather than once for inputs and once for outputs).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:35 -08:00
Paul Berry
18392443d4 glsl/lower_clip_distance: Update symbol table.
This patch modifies the clip distance lowering pass so that the new
symbol it generates (glClipDistanceMESA) is added to the shader's
symbol table.

This will allow a later patch to modify the linker so that it finds
transform feedback varyings using the symbol table rather than having
to iterate through all the declarations in the shader.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:28 -08:00
Tapani Pälli
d249159fe6 android: build fix for libmesa_glsl_utils
hash_table.c compilation requires ralloc.h include path

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-14 10:01:45 -08:00
Brian Paul
a12a8c910f mesa: minor indentation fixes in texcompress_etc.c 2012-12-14 06:33:08 -07:00
Brian Paul
b29f2d5ff5 mesa: remove old swrast-based compressed texel fetch code 2012-12-14 06:33:08 -07:00
Brian Paul
7dc36a50de swrast: use new core Mesa compressed texel fetch functions 2012-12-14 06:33:08 -07:00
Brian Paul
faa95fd7fa mesa: reimplement _mesa_decompress_image() using new tex fetch code 2012-12-14 06:33:08 -07:00
Brian Paul
ccbe7db1e6 mesa: added _mesa_get_compressed_fetch_func() 2012-12-14 06:33:08 -07:00
Brian Paul
ad3e39bb6d mesa: add new texel fetch code for etc formats 2012-12-14 06:33:07 -07:00
Brian Paul
cd7baf5bf4 mesa: add new texel fetch code for rgtc formats 2012-12-14 06:33:07 -07:00
Brian Paul
141d299965 mesa: add new texel fetch code for fxt formats 2012-12-14 06:33:07 -07:00
Brian Paul
a774eaa57e mesa: add new texel fetch code for dxt formats 2012-12-14 06:33:07 -07:00
Brian Paul
2037a06da9 mesa: add compressed_fetch_func typedef
This is a first step in removing the swrast-related code in core
Mesa's texture compression files.
2012-12-14 06:33:07 -07:00
Brian Paul
90b7797a1d swrast: merge get_texel_fetch_func() and set_fetch_functions()
No real need for separate functions anymore.
2012-12-14 06:33:07 -07:00
Brian Paul
f4896cea04 swrast: make _mesa_get_texel_fetch_func() static
Not called from any other file.
2012-12-14 06:33:07 -07:00
Dave Airlie
9e41b0badb draw/llvmpipe: fix transform feedback position + enable other extensions
This builds on the previous draw/softpipe patch.

So llvmpipe does streamout calls after clip/viewport stages,
but we have the pre-clip position stored for later use, so
when we are doing transform feedback, and its the position vertex
grab the vertex from the stored pre clip position.

The perfect fix is too probably add a codegen transform feedback
stage in between shader and clip stages, but this is good enough
for now.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-14 11:34:40 +10:00
Dave Airlie
55d37eb40e draw: add support for later transform feedback extensions
This adds support to draw for the new features of transform feedback.

a) fix count_from_stream_output, using max_index+1 for now but it looks
like it should be valid as its derived from the vertex elements/vbo.

b) fix striding and dst offsets in output buffers - was just wrong before.

c) fix crash if tfb is suspended (so.num_targets == 0)

This also enables the new features on softpipe. It should be possible
to enable them on llvmpipe as well after this commit, but would need
to schedule piglit runs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-14 11:34:15 +10:00
Tom Stellard
4330cfec8b clover: Fix build since removal of pipe_surface::usage
by commit 25409c6da8
2012-12-13 20:04:34 +00:00
Maxence Le Dore
6d7d821e3d r600g/radeonsi: Silence warnings
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-12-13 19:40:28 +00:00
Tom Stellard
c68babfc3c clover: Add support for compiler flags
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-12-13 19:22:44 +00:00
Tom Stellard
7f71efcf7a clover: Don't erase build info of devices not being built
Every call to _cl_program::build() was erasing the binaries and logs for
every device associated with the program.  This is incorrect because
it is possible to build a program for only a subset of devices and so
any device not being build should not have this information erased.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-12-13 19:22:35 +00:00
Vincent Lejeune
c7f9fb37ea r600g: use load_ar checks with llvm output.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-12-13 19:22:10 +00:00
Thierry Reding
60e05d7388 build: Fix AX_PROG_{CC,CXX}_FOR_BUILD macros
Override the cross_compiling and ac_tool_prefix variables by reassigning
to them instead of redefining the macros. Redefining them will actually
cause the variable names to be replaced instead of their content.

Furthermore push the definition of CPPFLAGS before running the checks
for the build tools to avoid the host CPPFLAGS from leaking into the
build CPPFLAGS.

While at it drop the redefinition of AC_TRY_COMPILER which hasn't been
used since autoconf 2.50 and make sure that all definitions are properly
popped when done (LDFLAGS, ac_cv_prog_CPP, ac_cv_prog_CXXCPP).

Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
2012-12-13 10:58:11 -08:00
Roland Scheidegger
a460aea3f1 gallivm: fix texel fetch for array textures
Since we don't call lp_build_sample_common() in the texel fetch path we missed
the layer fixup code. If someone would have tried to do texelFetch with array
textures it would have crashed for sure.
Not really tested (can't run the piglit test being able to use texelFetch with
array samplers for now with llvmpipe).

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-13 19:17:09 +01:00
Paul Berry
6267853055 mesa: Fix computation of default vertex attrib stride for 2_10_10_10 formats.
Previously, if the client program didn't specify a stride when setting
up a vertex attribute, we used _mesa_sizeof_type() to compute the size
of the type, and multiplied it by the number of components.

This didn't work for the 2_10_10_10 formats, since _mesa_sizeof_type()
returns -1 for those types, resulting in all kinds of havoc, since it
was causing the hardware to be programmed with a negative stride
value.

This patch adds a new function _mesa_bytes_per_vertex_attrib(), which
is similar to the existing function _mesa_bytes_per_pixel(), but which
computes the size of a vertex attribute based on the type and the
number of formats.  For packed formats (currently only the 2_10_10_10
formats), it verifies that the number of components is correct and
returns the size of the packed format.  For unpacked formats, it
returns the size of the type times the number of components.

In addition, this patch adds an assertion so that if we ever forget to
update _mesa_bytes_per_vertex_attrib() when adding a new vertex
format, we'll see the problem quickly rather than having to debug a
subtle conformance test failure.

Fixes GLES3 conformance tests
vertex_type_2_10_10_10_rev_{conversion,divisor,stride_pointer}.test.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-13 10:09:03 -08:00
Matt Turner
11cea47246 mesa/uniform_query: Don't write to *params if there is an error
The GL 3.1 and ES 3.0 specs say of glGetActiveUniformsiv:
   "If an error occurs, nothing will be written to params."

So, make a pass through the indices and check that they're valid before
the pass that actually writes to params. Checking pname happens on the
first iteration of the second loop.

Fixes es3conform's getactiveuniformsiv_for_nonexistent_uniform_indices
test.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-13 09:53:28 -08:00
Matt Turner
6acabe33a3 mesa: print unsigned values with %u
Otherwise messages say silly things like
   glGetActiveUniformBlockiv(block index -1 >= 0)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-13 09:53:11 -08:00
Kenneth Graunke
200bb36778 i965: Fix disassembly of jump targets on Gen7.
Gen7 stores the JIP/UIP bits in different places.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-12 22:19:08 -08:00
Kenneth Graunke
c2eb9d3a0a i965: Make try_rewrite_rhs_to_dst compare VGRF size to regs written.
try_rewrite_rhs_to_dst is a quick optimization to avoid generating new
temporaries (and MOVs from those temporaries to the dest) for every
expression tree we visit.  By generating better code in simple cases, we
reduce the burden on later optimization passes like register coalescing.

Previously, we compared inst->regs_written() to lhs->vector_elements
to make sure the instruction generating our value wrote the same number
of components as our destination register.

However, this fails in some cases.  One example is texturing (which
produces a vec4) into gl_FragData[i].  Technically, gl_FragData[i] is
also a vec4.  However, the destination VGRF actually has size 4n (where
n is the size of the array).

split_virtual_grfs() can't split VGRFs that are used by SEND messages
which require contiguous destination registers (like texturing), and
register allocation needs all VGRFs to have sizes between 1 and 4.

Amnesia: The Dark Descent hits this case: a texturing instruction
(4 components) gets rewritten to the gl_FragData output register
(which was 4*3 = 12 components), causing the register allocator to
hit the "we rely on split_virtual_grfs" assertion.

This makes it possible to play Amnesia.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-12 14:44:37 -08:00
Emil Velikov
1223458764 configure.ac: Disable compiler optimizations when --enable-debug is set
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-12 14:48:06 -06:00
Brian Paul
e721a76e68 softpipe: remove unused corner0 variable 2012-12-12 08:51:19 -07:00
Brian Paul
8ef27e8fa9 llvmpipe: remove unneeded draw_flush() call
This is redundant since we're calling draw_bind_fragment_shader()
which already does a flush.

v2: the redundant flush in llvmpipe_set_constant_buffer() has
already been removed by commit 3427466e6d

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-12 08:45:45 -07:00
Marek Olšák
d225d076a9 r600g: suballocate memory for fetch shaders from a large buffer
Fetch shaders are usually destroyed at the context destruction by the state
tracker, so we can put them all in a large buffer without wasting memory.

This reduces the number of relocations sent to the kernel a little bit.

Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:12:31 +01:00
Marek Olšák
8df3855eed r600g: suballocate memory for the STRMOUT_BUFFER_FILLED_SIZE register
Instead of having a 4-byte buffer for each streamout target, we suballocate
each dword from a 4K buffer.

This further reduces the overall number of relocations.

Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:12:28 +01:00
Marek Olšák
cc2d908572 gallium/util: add a simple allocator for suballocating from a large buffer
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:12:24 +01:00
Marek Olšák
2478fcd87c r600g: use u_upload_mgr for allocating staging transfer buffers
u_upload_mgr suballocates memory from a large buffer and maps the allocated
range (unsychronized), which is perfect for short-lived staging buffers.

This reduces the number of relocations sent to the kernel.

Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:11:52 +01:00
Marek Olšák
448cd5ea60 winsys/radeon: don't use BIND flags, add a flag for the cache bufmgr instead 2012-12-12 13:09:54 +01:00
Marek Olšák
1d0bf69f83 st/dri: add a way to force MSAA on with an environment variable
There are 2 ways. I prefer the former:
  GALLIUM_MSAA=n
  __GL_FSAA_MODE=n

Tested with ETQW, which doesn't support MSAA on Linux. This is
the only way to get MSAA there.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
afa902a705 mesa: don't advertise ARB_texture_buffer_object in legacy contexts
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
0ac83a2001 mesa: disallow creation of GL 3.1 compatibility contexts
Death to driver-specific hacks!

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
25409c6da8 gallium: remove pipe_surface::usage
Not really used by anybody now.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
c1f704073b svga: stop using pipe_surface::usage
There are only 2 possible usages: render target and depth stencil.
Both can be derived from the surface format, so the flag is redundant.

And it's going away...

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
21b1ec69fc gallium/util: move util_try_blit_via_copy_region to u_surface.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
3a555637b2 gallium/cso: don't use the pipe_error return type where it's not needed
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
eae9674f18 gallium: manage render condition in cso_context and fix postprocessing w/ it
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
9ec6ffd85d st/mesa: remove a weird msaa hack
It doesn't work and it's not clear how it's supposed to work.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Dave Airlie
621259b3de softpipe: implement seamless cubemap support. (v1.1)
This adds seamless sampling for cubemap boundaries if requested.

The corner case averaging is messy but seems like it should be spec
compliant.

The face direction stuff is also a bit messy, I've no idea if that could
or should be simpler, or even if all my directions are fully correct!

v1.1: update comments, drop unneeded seamless calls for nearest, fix
if statement layout.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 10:35:05 +10:00
Dave Airlie
3392f2fbcf gallium: fix cap warnings for tbo cap.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 07:16:02 +10:00
Dave Airlie
5cdcd7251a glsl_to_tgsi: emit multi-level structs and arrays properly.
This follow the code from the i965 driver, and emits the structs
and arrays recursively.

This fixes an assert in the two UBO tests
fs-struct-copy-complicated and
vs-struct-copy-complicated

These tests now pass on softpipe, with no regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 06:57:38 +10:00
Brian Paul
2ee0b44252 llvmpipe: don't use user constant buffers
This fixes some use-after-free issues.  I haven't measured any real
performance difference with a handful of Mesa demos.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-11 12:48:07 -07:00
Brian Paul
3427466e6d llvmpipe: support pipe_resource-based constant buffers
Before this we only supported user-based constant buffers.

First, we basically plumb pipe_constant_buffer objects through llvmpipe
rather than pipe_resource objects.

Second, update llvmpipe_set_constant_buffer() and try_update_scene_state()
so they understand both resource- and user-based constant buffers.

The problem with user constant buffers is the potential for use-after-free,
as seen in some WebGL tests.  The next patch will flip the switch for
resource-based const buffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-11 12:48:06 -07:00
Brian Paul
4c6053dc51 util: add util_copy_constant_buffer() helper function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-11 12:48:06 -07:00
Eric Anholt
beafced21c i965/fs: Improve performance of shaders that start out with a discard.
I had tried this in the past, but ran into trouble with applications
that sample from undiscarded pixels in the same subspan.  To fix that
issue, only jump to the end for an entire subspan at a time.

Improves GLbenchmark 2.7 (1024x768) performance by 7.9 +/- 1.5% (n=8).

v2: Drop the br variable in the jump instruction -- if I ever do jumps
    pre-gen6, it'll be a different code block anyway since we don't have
    HALT until gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:13:15 -08:00
Eric Anholt
d5016495cc i965/fs: Rewrite discards to use a flag subreg to track discarded pixels.
This makes much more sense on gen6+, and will also prove useful for
early exit of shaders on discard.

v2: fix up a stale comment from before converting gen4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:13:08 -08:00
Eric Anholt
b278f65e1c i965/fs: Add an instruction flag for choosing the flag subregister.
We're going to redo discard handling to track discards in the other flag
subregister, saving instructions in the discard and allowing predicated
jumps out to the end of the shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:58 -08:00
Eric Anholt
2c69a9fb60 i965: Let brw_flag_reg() choose the flag reg and subreg.
We're about to start using the f0.1 subregister.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:54 -08:00
Eric Anholt
6a1490bc8f i965: Print the flag reg updated by conditional modifiers.
This makes our output more consistent with other disasm tools, and
will be necessary when we start using f0.1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:49 -08:00
Eric Anholt
b7fd4b3f94 i965: Add the new flag_reg_nr instruction field from IVB.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:47 -08:00
Eric Anholt
f606a42a3c i965: Correct the name and usage of the flag subregister number field.
We've been calling it a register number, it's actually the subregister,
and things will get confusing once we start using it if it isn't fixed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:41 -08:00
Eric Anholt
7d404a4bd8 i965: Remove bogus flag_reg_nr field from bits3.
There's a flag subreg nr field in bits2 next to src0.vertstride, but
there shouldn't be anything in bits3 next to src1.vertstride.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:11:44 -08:00
Tobias Droste
cb8300f5a9 st/egl/drm: only unref the udev device if needed
Fixes compiler warning:

drm/native_drm.c: In function ‘native_create_display’:
drm/native_drm.c:180:21: warning: ‘device’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drm/native_drm.c:157:24: note: ‘device’ was declared here

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-11 12:53:58 -05:00
José Fonseca
bc4bf3c840 softpipe: Use os_time_get_nano() everywhere. 2012-12-11 16:45:01 +00:00
Johannes Obermayr
b361bb3de4 clover: Install CL headers.
Note: This is a candidate for the stable branches.
2012-12-10 19:22:37 -05:00
Tom Stellard
ffe1794e0c gallivm: Lower TGSI_OPCODE_MUL to fmul by default
This fixes a number of crashes on r600g due to the fact that
lp_build_mul assumes vector types when optimizing mul to bit shifts.

This bug was uncovered by 0ad1fefd69
2012-12-10 19:22:37 -05:00
Dave Airlie
8000e7b4b6 llvmpipe: fix txq for 1d/2d arrays. (v3)
Noticed would fail, we were doing two things wrong

a) 1d arrays require the layers in height
b) minifying the layers field.

v2: don't change height code, fixup completely inside txq
as suggested by Roland.

v3: just add minify before texture array size

v1: Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-11 09:38:01 +10:00
Dave Airlie
41f4f094c4 llvmpipe: increase texture target width to reflect increase
Now that we've gone over 7.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-11 09:37:55 +10:00
Jordan Justen
0151237457 mesa syncobj: don't store a pointer to the set_entry
The set_entry pointer can become invalid if the set table
is re-hashed.

This likely will fix
https://bugs.freedesktop.org/show_bug.cgi?id=58012
(Regression since 56e95d3c)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-10 10:58:45 -08:00
Fabio Pedretti
8b6e782eb9 vega: remove unused variables
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-10 09:43:20 -07:00
Fabio Pedretti
eefd373876 nvc0: comment unused nvc0_validate_zcull function
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-10 09:43:18 -07:00
Fabio Pedretti
9b4926b64b nv50: remove unused OpClassStr array
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-10 09:43:17 -07:00
smoki
320d531373 r200: fix broken tcl lighting
command mistakenly used vector instead of scalar emit (the more or less
identical code in radeon is already correct).
Seems like it would be broken ever since kms probably.
Should fix bugs 22576, 26809.
2012-12-10 17:30:26 +01:00
Dave Airlie
17f5dc5730 st_glsl_to_tgsi: fix ubo bools.
This should fix the ubo boolean tests, along with the previous
ubo loading fix.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-10 14:25:49 +10:00
Dave Airlie
7a66c8acd3 st_glsl_to_tgsi: call ubo load pass earlier
This calls it in around the same place as the 965 driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-10 14:22:34 +10:00
Dave Airlie
af2d9affb1 glsl_to_tgsi: fix texture offset translation
I noticed the texelFetch offset test failed on 2D rect samplers
with GLSL 1.40. This is because I wrote the immediate->offset
translation wrong.

Fixed the translation to actually use the ureg info to set the
offsets up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-10 12:23:47 +10:00
Dave Airlie
157f5d043a drisw: fix up context and apis for software context
This ports over from the dri2 code to the drisw bits. It means 3.1
core contexts now work for softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-09 20:28:56 +10:00
Kenneth Graunke
bd87441ac0 i965: Add missing _NEW_BUFFERS dirty bit in Gen7 SBE state.
This is needed to compute render_to_fbo.  It even has the comment.

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-08 18:12:21 -08:00
Christoph Bumiller
5e98cefb5a st/mesa: set PIPE_BIND_SAMPLER_VIEW for TBOs in st_bufferobj_data 2012-12-08 22:47:00 +01:00
Christoph Bumiller
1f079f9e58 nvc0/ir: allow neg,abs modifiers on OP_SET with integer result 2012-12-08 22:47:00 +01:00
Christoph Bumiller
7c6584b996 nvc0/ir/emit: fix check for flags register use in logic ops 2012-12-08 22:46:37 +01:00
Brian Paul
4b73cdb864 draw: fix/improve dirty state validation
This patch does two things:

1. Constant buffer state changes were broken (but happened to work by
   dumb luck).  The problem is we weren't calling draw_do_flush() in
   draw_set_mapped_constant_buffer() when we changed that state.  All the
   other draw_set_foo() functions were calling draw_do_flush() already.

2. Use a simpler state validation step when we're changing light-weight
   parameter state such as constant buffers, viewport dims or clip planes.
   There's no need to revalidate the whole pipeline when changing state
   like that.  The new validation method is called bind_parameters()
   and is called instead of the prepare() method.  A new
   DRAW_FLUSH_PARAMETER_CHANGE flag is used to signal these light-weight
   state changes.  This results in a modest but measurable increase in
   FPS for many Mesa demos.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
c5f544e690 draw: add reminder comments about similar code in different files
When one function is changed, also look at the other.
Presently, there are some differences with respect to geometry
shaders and instanced drawing...

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
a506ccd89f draw: rearrange code in llvm_middle_end_prepare()
To clean it up and make it look more like the non-LLVM
fetch_pipeline_prepare() function.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
3e0fa487fb draw: fix comment typo
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
9b11344b25 draw: add comment on draw->pt.opt field
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
b46b44b0a9 draw: update a comment about index buffers
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
José Fonseca
122dfc5ee2 gallium/os: Fix nano->micro second concersion.
copy'n'paste: best friend, worst enemy..

Trivial.
2012-12-08 11:15:46 +00:00
Dave Airlie
1f688327e6 llvmpipe: fix missing tbo cap warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 03:46:56 +00:00
Dave Airlie
73ae865af8 mesa/st: add ARB_uniform_buffer_object support (v2)
this adds UBO support to the state tracker, it works with softpipe
as-is.

It uses UARL + CONST[x][ADDR[0].x] type constructs.

v2: don't disable UBOs if geom shaders don't exist (me)
rename upload to bind (calim)
fix 12 -> 13 comparison as comment (calim + brianp)
fix signed->unsigned (Brian)
remove assert (Brian)

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:38 +10:00
Dave Airlie
535e248c5f softpipe: enable GLSL 1.40
This enables GLSL 1.40 advertising by softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:38 +10:00
Dave Airlie
a6256f1e67 softpipe: add texture buffer object support
This adds TBO support to softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:38 +10:00
Dave Airlie
22439f24a2 st/mesa: add option to enable GLSL 1.40
Allow GLSL 1.40 to be enabled if the driver advertises it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:34 +10:00
Dave Airlie
915efe7f07 st/mesa: add texture buffer object support to state tracker (v1.1)
This adds the necessary changes to the st to allow texture buffer object
support if the driver advertises it.

v1.1: remove extra blank line and whitespace

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:33 +10:00
Dave Airlie
a0281c4a8c gallium: add new texture buffer object capability
this just adds the define to the header.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:33 +10:00
José Fonseca
0c2492ea4a mesa/meta: Move declaration before statements. 2012-12-08 01:05:52 +00:00
José Fonseca
eeff87cee3 mesa: Move declaration before statement.
For MSVC's sake.
2012-12-08 01:02:30 +00:00
Anuj Phogat
4e9d19717c intel: Enable ETC2 support on intel hardware
This patch enables support for ETC2 compressed textures on
all intel hardware. At present, ETC2 texture decoding is not
available on intel hardware. So, compressed ETC2 texture data
is decoded in software and stored in a suitable uncompressed
MESA_FORMAT at the time of glCompressedTexImage2D. Currently,
ETC2 formats are only exposed in OpenGL ES 3.0.

V2: Use single etc_wraps variable for both etc1 and etc2.
V3: Remove redundant code and use just one intel_miptree_map_etc()
    and intel_miptree_unmap_etc() function.
    Choose MESA_FORMAT_SIGNED_{R16, GR1616} for ETC2 signed-{r11, rg11}
    formats

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-07 16:29:49 -08:00
Anuj Phogat
e06dcbfdc2 mesa: Add decoding functions for GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
Data in GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored
in MESA_FORMAT_SARGB.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:49 -08:00
Anuj Phogat
883efbf6da mesa: Add decoding functions for GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
Data in GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored
in MESA_FORMAT_RGBA8888_REV.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:49 -08:00
Anuj Phogat
75211f4367 mesa: Add decoding functions for GL_COMPRESSED_SIGNED_RG11_EAC
Data in GL_COMPRESSED_SIGNED_RG11_EAC format is decoded and stored in
MESA_FORMAT_SIGNED_GR1616.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
7697f25667 mesa: Add decoding functions for GL_COMPRESSED_SIGNED_R11_EAC
Data in GL_COMPRESSED_SIGNED_R11_EAC format is decoded and stored in
MESA_FORMAT_SIGNED_R16.

v2:
16 bit signed data is converted to 16 bit unsigned data by
adding 2 ^ 15 and stored in an unsigned texture format.

v3:
1. Handle a corner case when base code word value is -128. As per
OpenGL ES 3.0 specification -128 is not an allowed value and should
be truncated to -127.
2. Converting a decoded 16 bit signed data to 16 bit unsigned data by
adding 2 ^ 15 gives us an output which matches the decompressed image
(.ppm) generated by ericsson's etcpack tool. ericsson is also doing this
conversion in their tool because .ppm image files don't support signed
data. But gles 3.0 specification doesn't suggest this conversion. We
need to keep the decoded data in signed format. Both signed format
tests in gles3 conformance pass with these changes.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
aa217090f5 mesa: Add decoding functions for GL_COMPRESSED_RG11_EAC
Data in GL_COMPRESSED_RG11_EAC format is decoded and stored in
MESA_FORMAT_RG1616.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
dc86cb3705 mesa: Add decoding functions for GL_COMPRESSED_R11_EAC
Data in GL_COMPRESSED_R11_EAC format is decoded and stored in
MESA_FORMAT_R16.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
5ea8cd0084 mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
Data in GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC format is decoded and stored
in MESA_FORMAT_SARGB8.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
62fc4b4ae1 mesa: Add decoding functions for GL_COMPRESSED_RGBA8_ETC2_EAC
Data in GL_COMPRESSED_RGBA8_ETC2_EAC format is decoded and stored
in MESA_FORMAT_RGBA8888_REV.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
965a24995d mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ETC2
Data in GL_COMPRESSED_SRGB8_ETC2 format is decoded and stored
in MESA_FORMAT_SARGB8.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
81911101ee mesa: Add decoding functions for GL_COMPRESSED_RGB8_ETC2
Data in GL_COMPRESSED_RGB8_ETC2 format is decoded and stored in
MESA_FORMAT_RGBX8888_REV.

v2: Use CLAMP macro and stdbool.h
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
38d523584c mesa: Make nonlinear_to_linear() function available outside file
This patch changes nonlinear_to_linear() function to non static inline
and makes it available outside format_unpack.c. Also, removes the
duplicate copies in other files.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
e519b8a9af mesa: Add new MESA_FORMATs for ETC2 compressed textures
It is required by OpenGL ES 3.0 to support ETC2 textures.
This patch adds new MESA_FORMATs for following etc2 texture
formats:
 GL_COMPRESSED_RGB8_ETC2
 GL_COMPRESSED_SRGB8_ETC2
 GL_COMPRESSED_RGBA8_ETC2_EAC
 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
 GL_COMPRESSED_R11_EAC
 GL_COMPRESSED_RG11_EAC
 GL_COMPRESSED_SIGNED_R11_EAC
 GL_COMPRESSED_SIGNED_RG11_EAC
 MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1
 MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1

Above formats are currently available in only gles 3.0.

v2: Add entries in texfetch_funcs[] array.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

v3 (Paul Berry <stereotype441@gmail.com>): comment out symbols that
are not implemented yet, so that this commit compiles on its own;
future commits will uncomment the symbols as they become available.
2012-12-07 16:29:47 -08:00
Kenneth Graunke
23b7103cee meta: Use #version 300 es for _mesa_glsl_Clear's integer shaders on ES3.
Fixes es3conform's color_buffer_float_clamp_(fixed|on|off) tests.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 16:29:45 -08:00
Kenneth Graunke
50e4a1df94 meta: Use #version 300 es in GenerateMipmap shaders on ES3.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 16:29:31 -08:00
Paul Berry
6cffdb1ca0 Set es_version to false when using FF fragment shading in meta ops
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 16:28:40 -08:00
Eric Anholt
1ddc021b2a mesa: Use the new hash table for the variable refcount visitor.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: open_hash_table => hash_table]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-07 14:46:18 -08:00
Jordan Justen
59284bc44a program/hash_table.c: rename to program/prog_hash_table.c
Removes a collision of the object file name for main/hash_table
and program/hash_table.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-07 14:46:18 -08:00
Matt Turner
970ec8dbc3 mesa: Ignore size and offset parameters for BindBufferRange when buffer is 0
The ES 3 conformance suite unbinds buffers (by binding buffer 0) and
passes zero for the size and offset, which the spec explicitly
disallows. Otherwise, this seems like a reasonable thing to do.

Khronos will be changing the spec to allow this (bug 9765). Fixes
es3conform's transform_feedback_init_defaults test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 14:11:13 -08:00
Christoph Bumiller
cfa752cd33 nv50,nvc0: fix shader eviction 2012-12-07 22:48:54 +01:00
Christoph Bumiller
f7599b2c32 nv50,nvc0: add support for cube map arrays
NOTE: nv50 support not enabled, someone with nva3/8 please fix.
2012-12-07 22:48:54 +01:00
Stefan Dösinger
ff5a9868c8 r300: Don't disable destination read if the src blend factor needs it
The read can remain disabled if the src alpha factor needs it because
the result would still be zero.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-12-07 17:48:16 +01:00
Michel Dänzer
ff574d653b gallium/egl-static: Fix unresolved symbol 'clock_gettime'.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-07 16:10:02 +01:00
José Fonseca
e7bbd9c243 gallivm: Rudimentary native integer support.
Just enough for draw module to work ok.

This improves "piglit attribs GL3", though something fishy is still
happening with certain unsigned integer values.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
José Fonseca
6e27e2e90e draw: Dump LLVM shader key.
Just like we do in llvmpipe for the fragment shader compilation key.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
José Fonseca
3b7ce72625 gallivm: Allow indirection from TEMP registers too.
The ADDR file is cumbersome for native integer capable drivers.  We
should consider deprecating it eventually, but this just adds support
for indirection from TEMP registers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
José Fonseca
1d35f77228 gallivm,llvmpipe,draw: Support multiple constant buffers.
Support 16 (defined in LP_MAX_TGSI_CONST_BUFFERS) as opposed to 32 (as
defined by PIPE_MAX_CONSTANT_BUFFERS) because that would make the jit
context become unnecessarily large.

v2: Bump limit from 4 to 16 to cover ARB_uniform_buffer_object needs,
per Dave Airlie.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
Marek Olšák
35840ab189 st/dri: implement MSAA for GLX/DRI2 framebuffers
All MSAA buffers are allocated privately and resolved into the DRI-provided
back and front buffers.

If an MSAA visual is chosen, the buffers st/mesa receives are all
multi-sample. st/mesa doesn't have access to the single-sample buffers
in that case.

This makes MSAA work in games like Nexuiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:29 +01:00
Marek Olšák
919f788b92 gallium: pass the current context to the flush_front state tracker function
I will later use the context to resolve an MSAA front buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:29 +01:00
Marek Olšák
888714feb6 st/dri: don't expose MSAA configs with accumulation buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
985649b596 st/dri: refactor dri_fill_in_modes
- We can use a single loop for adding new configs.
- The useless parameter depth_bits is removed.
- The maximum number of samples is bumped to 32.
- We can support Z16_UNORM and Z32_UNORM unconditionally since the zbuffers
  are private.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
39737e17e7 st/dri: always allocate private depth-stencil buffers
This disables DRI2 sharing of zbuffers. The window zbuffer is allocated just
like any other texture - through resource_create.

The idea of allocating a zbuffer through DRI2 isn't very useful with MSAA,
where a single-sample zbuffer is useless.

IIRC, the Intel driver does the same thing.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
976b832e9a st/mesa: implement CopyTexSubImage for MSAA framebuffers
Reviewed-by: Brian Paul <brianp@vmware.com>

Just use pipe->blit, which can do resolve, flipping, and format conversions.
The util_blit_pixels codepath is still there for the cases where we have to
force alpha to 1.

This also turns on acceleration for copying GL_DEPTH_STENCIL.
2012-12-07 14:19:28 +01:00
Marek Olšák
9f06966a7b gallium/u_blitter: fix conflict with u_memory.h
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
49f1104c44 r600g: transfers of MSAA color textures should do the resolve
so that ReadPixels and various fallbacks work.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
cbddb8f365 trace: dump pipe_resource::nr_samples
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
5fb2b1f4d4 glx/dri2: set the __DRI2_FLUSH_DRAWABLE flag where it should be set
Sorry, I accidentally omitted this.

It only broke MLAA.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Andreas Boll
520892688a build: Fix GLES linkage without libglapi
fixes a regression introduced with
fc9ea7c74d

NOTE: This is a candidate for the 9.0 branch.

Reported-by: Brian Paul <brianp@vmware.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-12-07 09:21:44 +01:00
Dave Airlie
5b2a3443fa llvmpipe: fix regression in gears speed.
This fixes the gears regression since transform feedback.

Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-07 08:35:08 +10:00
Kenneth Graunke
76f13f80e6 glsl: Add missing semicolon in the grammar
This may not be strictly necessary, but every other rule in the grammar ends
with a semicolon.  It also appears that this was supposed to be commited with
the original patch that changed this rule, but the wrong version of the patch
was accidentally pushed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-06 12:13:22 -08:00
Ian Romanick
62c0938639 glsl: Allow layout qualifiers in GLSL 3.00 ES
Note that while 'packed' is a reserved word in GLSL ES, row_major is not.
This means that we have to use the string-based matching for that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
486f955654 glsl: Create builtin function profiles for GLSL 3.00 ES.
Nearly all of the builtin functions in GLSL 3.00 ES are already
implemented in Mesa; this patch enables them.

A few functions are not implemented yet; those have been commented
out, with a FIXME comment to act as a reminder of what still needs to
be implemented.  Here is the complete list: packSnorm2x16,
unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16,
unpackHalf2x16.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
9a69f66353 glsl: add determinant() functions.
These functions are defined in GLSL 1.50 and GLES 3.00 ES.

The formulas have been extracted from the existing implementation of
inverse().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
4d6d22100a glsl: Make builtin function profiles for GLSL ES use "es" in the filename.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
8dec1bfedd glsl: Add builtin variables for GLSL 3.00 ES.
This patch also adds assertions so that when we add new GLSL versions,
we'll notice that we need to update the builtin variables.

[v2, idr]: s/Frab/Frag/  Noticed by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
d7949eefcb glsl: Populate built-in types correctly for GLSL 3.00 ES.
This patch implements all of the built-in types for GLSL 3.00 ES.
This is almost exactly the same as the set of built-in types for GLSL
1.30, except ate 1D samplers are skipped, and samplerCubeShadow is
added.

This patch also addes an assertion so that when we add new GLSL
versions, we'll notice that we need to update the types.

In review, Eric noted:

    "This change looks correct.  The overall interaction of profiles is
    getting ugly, though.  I'm imagining a restructure of the symbol
    table population so that there's a big list of types, and each
    #version has a nice list of strings of type names copy and pasted
    out of its spec."

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
5e10a5c5e4 glsl: Make {Min,Max}ProgramTexelOffset available to compiler.
These constants need to be made available to shaders in GLSL 3.00 ES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
15ba2a5825 glsl: Fix linker checks for GLSL ES 3.00.
This patch updates the following linker checks to do the right thing
in GLSL 3.00 ES:

- Failing to write to gl_Position is allowed in GLSL 1.40+ as well as
  GLSL 3.00 ES.

- It is an error to write to both gl_ClipVertex and gl_ClipDistance in
  GLSL 1.30+.  This does not apply to GLSL 3.00 ES.

- GLSL 3.00 ES uses the same varying counting rules as GLSL 1.00 ES.

- In GLSL 1.30 and GLSL 3.00 ES, "discard" terminates the shader.

- In GLSL 1.00 ES and GLSL 3.00 ES, both a fragment and a vertex
  shader must be present.

[v2, idr]: Fix minro typo in a comment.  Noticed by Ken.

[v3, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
91c92bb6fb glsl: Record in gl_shader_program whether the program uses GLSL ES.
Previously we recorded just the GLSL version (or the max version, if
GLSL 1.10 and GLSL 1.20 programs were linked together).

[v2, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
a9f34dc304 glsl: Clean up shading language mixing check for GLSL 3.00 ES.
Previously, we prohibited mixing of shading language versions if
min_version == 100 or max_version >= 130.  This was technically
correct (since desktop GLSL 1.30 and beyond prohibit mixing of shading
language versions, as does GLSL 1.00 ES), but it was confusing.  Also,
we asserted that all shading language versions were between 1.00 and
1.40, which was unnecessary (since the parser already checks shading
language versions) and doesn't work for GLSL 3.00 ES.

This patch changes the code to explicitly check that (a) ES shaders
aren't mixed with desktop shaders, (b) shaders aren't mixed between ES
versions, and (c) shaders aren't mixed between desktop GLSL versions
when at least one shader is GLSL 1.30 or greater.  Also, it removes
the unnecessary assertion.

[v2, idr]: Slightly tweak the is_es_prog detection to occur outside the loop
instead of doing something special on the first loop iteration.  Suggested by
Ken.

[v3, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
c150e876b4 glsl: Record in gl_shader whether the shader uses GLSL ES.
Previously we recorded just the GLSL version, with the knowledge that
100 means GLSL 1.00 ES.  With the advent of GLSL 3.00 ES, this is
going to get more complex, and eventually will probably become
ambiguous (GLSL 4.00 already exists, and GLSL 4.00 ES is likely to be
created some day).

To reduce confusion, this patch simply records whether the shader is
GLSL ES as an explicit boolean.

[v2, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
2b4aeddfb3 glsl/parser: Handle "#version 300 es" directive.
Note that GLSL 1.00 is selected using "#version 100", so "#version 100
es" is prohibited.

v2: Check for GLES3 before allowing '#version 300 es'

v3: Make sure a correct language_version is set in
_mesa_glsl_parse_state::process_version_directive.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
629b9edc99 glsl/parser: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.

No functional change.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
a03c2c7ab9 glsl/preprocessor: Handle "#version 300 es" directive.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
2152df51c0 glsl/preprocessor: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.

No functional change.

[mattst88] v2: Use intmax_t instead of int for version argument. Would
otherwise write garbage after #version since PRIiMAX was reading 64-bits
instead of 32.

[idr] v3: A later commit fixes the caller of
_glcpp_parser_handle_version_declaration to pass the correct number of
parameters.  Fix it in the patch that changes the interface instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
d4a24745b8 glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.
This patch turns on the following features for GLSL ES 3.00:

- Array constructors, whole array assignment, and array comparisons.
- Second and third operands of ?: may be arrays.
- Use of "in" and "out" qualifiers on globals.
- Bitwise and modulus operators.
- Integral vertex shader inputs.
- Range-checking of literal integers.
- array.length method.
- Function calls may be constant expressions.
- Integral varyings must be qualified with "flat".
- Interpolation and centroid qualifiers may not be applied to vertex
  shader inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
534ec62152 glsl: parse GLSL ES 3.00 keywords correctly.
GLSL ES 3.00 adds the following keywords over GLSL 1.00: uint,
uvec[2-4], matNxM, centroid, flat, smooth, various samplers, layout,
switch, default, and case.

Additionally, it reserves a large number of keywords, some of which
were already reserved in versions of desktop GL that Mesa supports,
some of which are new to Mesa.

A few of the reserved keywords in GLSL ES 3.00 are keywords that are
supported in all other versions of GLSL: attribute, varying,
sampler1D, sampler1DShador, sampler2DRect, and sampler2DRectShadow.

This patch updates the lexer to handle all of the new keywords
correctly when the language being parsed is GLSL 3.00 ES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
948e5dda67 glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.
This patch expands the lexer KEYWORD macro to take two additional
arguments: the GLSL ES versions in which the given keyword was first
reserved, and supported, respectively.  This will allow us to
trivially add support for GLSL 3.00 ES keywords, even though the set
of GLSL 3.00 ES keywords is neither a subset or a superset of the
keywords corresponding to any desktop GLSL version.

The new KEYWORD macro makes use of the
_mesa_glsl_parse_state::is_version() function, so it accepts 0 as
meaning "unsupported" (rather than 999, which we used previously).

Note that a few keywords ("packed" and "row_major") are supported
*either* when GLSL 1.40 is in use or when ARB_uniform_buffer_obj
support is enabled.  Previously, we handled these by cleverly taking
advantage of the fact that the KEYWORD macro didn't parenthesize its
arguments in the usual way.  Now they are handled more
straightforwardly, with a new macro, KEYWORD_WITH_ALT.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
0d9bba6e43 glsl: Make use of new _mesa_glsl_parse_state::check_version() function.
Previous to this patch, we were not very consistent about the errors
we generate when a shader tried to use a feature that is prohibited in
the current GLSL version.  Some error messages failed to mention the
GLSL version currently in use (or did so inaccurately), and some error
messages failed to mention the first GLSL version in which the given
feature is allowed.

This patch reworks all of the error checks to use the check_version()
function, which produces error messages in a standard form
(approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION
($REQUIRED_GLSL_VERSION required).").

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
e3ded7fe62 glsl: Make use of new _mesa_glsl_parse_state::is_version() function.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
5d0fd3270f glsl: Add GLSL version query functions.
With the advent of GLSL 3.00 ES, the version checks we perform in the
GLSL compiler (to determine which language features are present) will
become more complicated.  To reduce the complexity, this patch adds
functions check_version() and is_version() to _mesa_glsl_parse_state.
These functions take two version numbers: a desktop GLSL version and a
GLSL ES version, and return a boolean indicating whether the GLSL
version being compiled is at least the required version.  So, for
example, is_version(130, 300) returns true if the GLSL version being
compiled is at least desktop GLSL 1.30 or GLSL 3.00.

The check_version() function additionally produces an error message if
the version check fails, informing the user of which GLSL version(s)
support the given feature.

[v2, idr]: Add PRINTFLIKE annotation to the new method.  The numbering of th
parameters is correct because GCC is silly.

[v3, idr]: Fix copy-and-paste error in the comment before
_mesa_glsl_parse_state::is_version.  Noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
dc9f9d8e66 glsl: Compute version_string on the fly.
Fixes a bug where version_string would be left uninitialized if no
GLSL "#version" directive was used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
d9bfaa104e glsl: Make a function to express a GLSL version ir human-readable form.
This will be useful in generating more helpful error messages,
especially with the addition of GLSL 3.00 ES support.

[v2, idr]: Rename ctx parameter to mem_ctx

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
53e572f15c glsl: Simplify symbol table version checking.
Previously, we stored the GLSL language version in the
glsl_symbol_table struct.  But this was unnecessary--all
glsl_symbol_table needs to know is whether functions and variables
have separate namespaces (they do in GLSL 1.10 only).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
9a93ba3068 mesa: Add ARB_ES3_compatibility flag.
Adding this now makes it easier to develop and test GLES3 features, since we
can do initial development and testing using desktop GL.  Later GLSL compiler
patches check for either ctx->Extensions.ARB_ES3_compatibility or
_mesa_is_gles3 to allow certain features (i.e., "#version 300 es").

[v2, idr]: Just edits to the commit message.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Michel Dänzer
e0f2ffc3d9 radeonsi: Fix cube texture coordinates.
8 more piglits.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-06 20:35:18 +01:00
Michel Dänzer
aac2154729 radeon/llvm: Export prepare_cube_coords helper to driver.
To be used by radeonsi.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-06 20:18:40 +01:00
Brian Paul
7745596ceb mesa: use rand() instead of random()
As Vinson Lee did in commit bb284669f8
in hash_table.c

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-06 11:55:02 -07:00
Jordan Justen
56e95d3ca2 mesa: validate that sync objects were created by mesa
Previously, the user could send in a pointer that was not created
by mesa. When we dereferenced that pointer, there would be an
exception.

Now we keep a set of pointers and verify that the pointer
exists in that set before dereferencing it.

Note: This fixes several crashing gles3conform tests.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00
Jordan Justen
e12d9f0c6d main/syncobj: return GL_INVALID_VALUE for invalid sync objects
Note: The GL/GLES3 web man pages don't seem to properly
document glWaitSync's error when the sync object is invalid.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00
Eric Anholt
82c9d98ab9 mesa: add set support (stores a set of pointers)
From: git://people.freedesktop.org/~anholt/hash_table

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: minor rework for mesa]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00
José Fonseca
db9a1052d1 llvmpipe: Fix statement before declaration. 2012-12-06 17:23:11 +00:00
José Fonseca
b79194401a util: Add util_copy_box helper.
Must users of util_copy_rect() need or should deal with volumes.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
José Fonseca
4da4e8ee2a gallium/util: Move the util_copy/fill_rect into u_surface.
u_rect.h said these should move to a different file, and u_surface seems
a better home.

Leave #include "util/u_surface.h" to avoid having to touch thousand of
files.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
José Fonseca
d296326e06 gallium/os: Cleanup up os_time_get/os_time_get_nano.
- Re-implement os_time_get in terms of os_time_get_nano() for consistency
- Use CLOCK_MONOTONIC as recommended
- Only use clock_gettime on Linux for now.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
José Fonseca
7e14293556 gallium/os: Fix os_time_sleep() on Windows for small durations.
Prevents undetermined sleeps.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
Stefan Dösinger
d8069b7603 meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER
Fixes clears in Wine on r200.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-06 11:37:24 -05:00
Stefan Dösinger
f6a4e1bc1e radeon: Initialize swrast before setting limits
NOTE: This is a candidate for stable release branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-06 11:37:24 -05:00
Stefan Dösinger
654a945f4d r200: Initialize swrast before setting limits
Otherwise the driver announces 4096 vertex shader constants and other
way too high limits.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-06 11:37:24 -05:00
Matthew Waters
ac24d17258 mesa: fix compiler warnings when including GL/gl.h with other gl headers
GL/gl.h provides some definitions (GL_FALSE, GL_ONE, etc) that have
the same value as other gl headers but are represented differently
(0 vs 0x0 and 1 vs 0x1).
This causes compiler warnings about redefining such definitions when
including GL/gl.h with other gl headers.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57802

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:08:52 -07:00
José Fonseca
5e99cd9159 gallivm: Fix lerping of (un)signed normalized numbers.
Several issues actually:

- Fix a regression in unsigned normalized in the rescaling
  [0, 255] to [0, 256]

- Ensure we use signed shifts where appropriate (instead of
  unsigned shifts)

- Refactor the code slightly -- move all the logic inside
  lp_build_lerp_simple().

This change, plus an adjustment in the tolerance of signed normalized
results in piglit fbo-blending-formats fixes bug 57903

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 15:58:40 +00:00
José Fonseca
33ffca713a gallivm: Fix lp_build_print_value of smaller integer types.
They need to be converted to the native integer type to prevent garbage
in higher order bits from being printed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 15:58:40 +00:00
Brian Paul
5396582f5e llvmpipe: remove unused variable 2012-12-06 08:34:08 -07:00
Brian Paul
52b02cc676 draw: remove some dead constant buffer code
Remove the draw_vs_set_constants() and draw_gs_set_constants()
functions and the draw->vs.aligned_constants,
draw->vs.aligned_constant_storage and draw->vs.const_storage_size
fields.  None of it was used.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-06 07:48:53 -07:00
Chad Versace
45a01cba90 android: Fix build of libmesa_program
Commit 4097308 fixed the build in a questionable way. It worked at the
time, but, as Ian pointed out, the fix would likely fail at a future
commit due to the indeterminism of parallel builds. And that's exactly
what happened; the fix no longer works. `mm -j4` on Fedora 17 fails for
me.

The problem is that there is no rule for program_parse.tab.h. To fix that,
this patch adds a rule that makes program_parse.tab.c depend on
program_parse.tab.h. Technically, the c file does not depend on the
h file. However, because the two files are generated together by a single
invocation of Bison, any rule that forces execution of Bison is
sufficient.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-05 23:06:16 -08:00
Dave Airlie
77b26564c3 llvmpipe: EXT_transform_feedback support (v1.1)
I'd written most of this ages ago, but never finished it off.

This passes 115/130 piglit tests so far. I'll look into the
others as time permits.

v1.1: fix calloc return check as suggested by Jose.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-06 14:48:10 +10:00
Eric Anholt
71f06344a0 i965: Add a debug flag for counting cycles spent in each compiled shader.
This can be used for two purposes: Using hand-coded shaders to determine
per-instruction timings, or figuring out which shader to optimize in a
whole application.

Note that this doesn't cover the instructions that set up the message to
the URB/FB write -- we'd need to convert the MRF usage in these
instructions to GRFs so that our offsets/times don't overwrite our
shader outputs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)

v2: Check the timestamp reset flag in the VS, which is apparently
    getting set fairly regularly in the range we watch, resulting in
    negative numbers getting added to our 32-bit counter, and thus large
    values added to our uint64_t.
v3: Rebase on reladdr changes, removing a new safety check that proved
    impossible to satisfy.  Add a comment to the AOP defs from Ken's
    review, and put them in a slightly more sensible spot.
v4: Check timestamp reset in the FS as well.
2012-12-05 14:29:44 -08:00
Eric Anholt
ef2fbf67d4 i965: Add a flag for instructions with normal writemasking disabled.
For getting values from the new timestamp register, the channels we
load have nothing to do with the pixels dispatched.
2012-12-05 14:29:44 -08:00
Vincent Lejeune
00d77e9fe4 r600g: use default action for min/max opcode in tgsi to llvm
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:31:55 +01:00
Vincent Lejeune
2d97f77b9f gallivm: Have a default emit function for min/max opcode
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:31:18 +01:00
Vincent Lejeune
2a03f28e54 r600g: use default action for fdiv/rcp opcode
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:31:02 +01:00
Vincent Lejeune
0a2f58f6ed gallivm: have a default emit function for fdiv/rcp
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:30:39 +01:00
Vincent Lejeune
0ad1fefd69 r600g: Use default mul/mad function for tgsi-to-llvm
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:30:16 +01:00
Vincent Lejeune
e9f090e8b2 glsl: add new variable declaration in function body in lower_output_read
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
2012-12-05 18:23:42 +01:00
Brian Paul
d2c7fe5389 draw: set precalc_flat flag for AA lines too
Fixes flat shading for AA lines.  demos/src/trivial/line-smooth is a
test case which hits this.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-05 08:05:00 -07:00
Chris Forbes
484a8dcfa8 mesa: expose ARB_texture_cube_map_array in core contexts as well
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2012-12-05 16:52:37 +10:00
Vinson Lee
129a580062 scons: Require drm to build gallium/state_trackers/egl/x11/x11_screen.c.
x11_screen.c includes xf86drm.h, which comes from libdrm-dev.

This patch fixes this build error.

  Compiling src/gallium/state_trackers/egl/x11/x11_screen.c ...
src/gallium/state_trackers/egl/x11/x11_screen.c:30:21: fatal error: xf86drm.h: No such file or directory

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-04 22:21:04 -08:00
Eric Anholt
a64c1eb9b1 i965/fs: Add support for uniform array access with a variable index.
Serious Sam 3 had a shader hitting this path, but it's used rarely so it
didn't show a significant performance difference (n=7).  It does reduce
compile time massively, though -- one shader goes from 14s compile time
and 11723 instructions generated to .44s and 499 instructions.

Note that some shaders lose 16-wide mode because we don't support
16-wide and pull constants at the moment (generally, things looping over
a few-element array where the loop isn't getting unrolled).  Given that
those shaders are being generated with 15-20% fewer instructions, it
probably outweighs the loss of 16-wide.
2012-12-04 17:11:11 -08:00
Eric Anholt
67d9e7b581 i965/fs: Conditionalize constant-index UBO load code and add comments.
I wanted to separate this step for easier reviewing when I add the
variable-index case next.
2012-12-04 16:59:59 -08:00
Eric Anholt
f22a909a08 i965/fs: Restrict optimization that would fail for gen7's SENDs from GRFs
v2: Fix SNB math bug in register_coalesce() where I was looking at the
    instruction to be removed, not the instruction to be copy propagated
    into.
2012-12-04 16:58:46 -08:00
Eric Anholt
9156d0cba1 i965/fs: Allow source mods on gen7+ math.
This gen6 restriction was removed in gen7 as the mathbox merge to act
more like a normal instruction was finished in the hardware.
2012-12-04 16:27:54 -08:00
Eric Anholt
d8214e4384 i965/fs: Add instruction emit for varying-index reads of uniforms.
The gen7 send-from-GRF path is sufficiently different from the perspective of
IR generation and optimization that I just made it a separate opcode.

v2: fix whitespace, rebase on Ken's recent refactor.
2012-12-04 16:27:53 -08:00
Eric Anholt
29340d02dc i965/fs: Rename the existing pull constant load opcode.
We're going to use another send message for handling loads with a varying
per-fragment array index.
2012-12-04 16:27:53 -08:00
Eric Anholt
78e9c57a3e i965: Add a header_present flag for setting up dp read messages.
As of gen7, we can skip the header on some messages, and this can make
optimization on those messages much nicer when you've got GRFs instead of MRFs
as the source.
2012-12-04 16:27:53 -08:00
Eric Anholt
8f05b2f2b0 i965/gen7: Add some safety checks for send messages from GRFs. 2012-12-04 16:27:53 -08:00
José Fonseca
fb6d901ad2 gallivm: Re-add the kludge for lp_build_lerp of fixed point types.
I removed it in commit 7d44d354bd but
texture sample code still relies on it.

Not sure how to this cleanly, so put it pack for now.
2012-12-04 21:18:18 +00:00
José Fonseca
ed4dfaa164 scons: Link against librt
Fixes missing clock_gettime symbol.
2012-12-04 19:37:21 +00:00
José Fonseca
de76101672 util/u_debug: Cleanup/fix debug_dump_image.
- Handle other formats.
- Prevent CRLF on Windows.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
a416a4a91d translate: Fix the fetch function assertions.
fetch_rgba_float is NULL for integer formats, and vice-versa.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
4da0cb83ab util/u_draw: Skip rendering instead of aborting when excessive number of instances is found.
This is a temporary hack. I believe the only way of properly fixing this
is to check buffer overflow just before fetching based on addresses,
instead of number of vertices/instances. This change simply allows tests
that stress buffer overflows to complete without asserting, and should
not affect valid rendering.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
7da3a947c7 draw: Properly limit vertex buffer fetches on draw arrays.
We need to clamp vertex buffer fetch based on its size, not based on the
user specified max index hint.

This matches draw_pt_fetch_run() above.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
d1864273f2 draw: Use symbolic primitive names in debug output.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
32e899ab8b draw: Consider the geometry shader when choosing the vertex size.
A single vertex size is chosen for the whole pipeline. So the number of
geometry shader outputs must also be taken in consideration.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
b636204ae8 tgsi: Allow TXF from buffers.
There is more work necessary to properly support buffers in shaders, but
this gets things a bit further along.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
c0e4ee9b27 util/surface: Always use the surface format when clearing.
Not the texture format, as they might differ.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
64f9916314 tgsi: Increase maximum number of temps to 4096.
To match Shader Model 4 limits, as specified in
http://msdn.microsoft.com/en-us/library/windows/desktop/ff471378.aspx

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
294d8a71ef llvmpipe: Fix alignment.
My understanding and actual implementation of how the pixels are being
fetch differed.

This fixes bug 57863.

Trivial.
2012-12-04 19:33:04 +00:00
José Fonseca
7d44d354bd gallivm: Generalize lp_build_mul and lp_build_lerp for signed normalized types.
This fixes fdo bug 57755 and most of the failures of piglit fbo-blending-formats
GL_EXT_texture_snorm.

GL_INTENSITY_SNORM is still failing, but problem is probably elsewhere,
as GL_R8_SNORM works fine.
2012-12-04 19:32:50 +00:00
Dave Airlie
ec83535c83 automake/gallium: attempt to fix -lrt
fix non-automake bits in pipe-load to.

Should fix:
http://bugs.freedesktop.org/57852

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-04 18:02:07 +10:00
Dave Airlie
a853301fb7 u_cache: fix dereference before NULL check 2012-12-04 17:55:52 +10:00
Ian Romanick
bdba4b30de intel: Always enable GL_ARB_framebuffer_object
Now that _mesa_BindFramebuffer does the right thing in ES contexts when the
gl_extensions::ARB_framebuffer_object bit is set, the Intel driver doesn't
need this hack.

No piglit or GLES2 conformance regressions observed on IVB, and this
patch (and the previous) fix es3conform's framebuffer_srgb_draw and
transform_feedback_misc tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 21:26:48 -08:00
Ian Romanick
a13f9dfbb8 mesa: Only require Gen'ed name for glBind{Framebuffer,Renderbuffer} on desktop
Desktop OpenGL implementations that support either
GL_ARB_framebuffer_object or OpenGL 3.0 must require names from
glGenFramebuffers for glBindFramebuffer.  We have enforced this rule for
quite some time.  However, OpenGL ES 1.0, 2.0, and 3.0 implementations
are required to allow user-defined names (e.g., not from
glGenFramebuffers{OES,}).

The Intel drivers have hacked around this by not enabling
GL_ARB_framebuffer_object in an ES context.  Instead, just pick the
correct behavior in _mesa_BindFramebuffer based on the context API.

Chad pointed out in a review e-mail:

    "I'd like to point out, though, that glBindFramebufferEXT and
    glBindRenderbufferEXT are still broken on desktop GL because they
    don't accept user-genned names. But that fix belongs to a different
    series."

Currently glBindFramebufferEXT is an alias for glBindFramebuffer.
Unalising two functions presents some difficulty, so we'll have to
revisit this eventually.

v2: Perform same check in _mesa_BindRenderbuffer too.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
2012-12-03 21:24:54 -08:00
Brian Paul
4d2f04cd6c mesa: fix uint64 printing in syncobj.c
To silence printf format warnings.

v2: insert "0x" prefix

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-03 20:55:17 -07:00
Kenneth Graunke
32c6db3978 mesa: Disable GL_NV_primitive_restart extension in core contexts.
The NV formulation of primitive restart is turned on/off with
glEnableClientState/glDisableClientState.  These two functions don't
exist in core contexts, which mean that GL_NV_primitive_restart is
essentially useless...even broken.

However, leaving it on causes oglconform's primitive-restart-nv tests to
run in OpenGL 3.1 contexts, which results in them all failing.  This
patch causes 29 subtests to go from "fail" to "not run".

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-03 17:59:28 -08:00
Kenneth Graunke
3ac97c6ccc i965: Allow INTEL_DEBUG=fs as a synonym for INTEL_DEBUG=wm.
I keep accidentally trying to use it.  "fs" is a sensible name for
fragment shader debugging, and "wm" is...not.  It's also more symmetric
with "vs".

Leave INTEL_DEBUG=wm because old habits die hard.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-03 17:57:43 -08:00
Johannes Obermayr
21694b8eac gallium/auxiliary: Add -fno-rtti to CXXFLAGS on LLVM >= 3.2.
Also remove the recently added and overloaded LLVM_CXXFLAGS from CXXFLAGS.

Note: This is a candidate for the stable branches.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-12-03 19:07:43 -05:00
Stefan Dösinger
e866bd1ade r300g: Give CLIP_DISABLE another try
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-12-04 00:07:13 +01:00
Eric Anholt
b126228f12 i965: Include codegen time in the INTEL_DEBUG=perf stall detection.
In the VS case, we were missing the entire compile time in the stall
detection!

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:50 -08:00
Eric Anholt
0f06864ba5 i965: Don't leak the IR annotation into later instructions.
After walking our IR instructions (Mesa or GLSL), we don't want to also
mark the start of the FB/URB writes or whatever as being that IR.  This
can end up being misleading when the end of the IR visit got copy
propagated out to a later instruction in the URB writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:46 -08:00
Eric Anholt
1db9a72351 i965/vp: Fix crashes with INTEL_DEBUG=vs.
The VP generation doesn't set up the output reg strings, so if you
didn't happen to get these values as 0 on the stack, you'd lose.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:43 -08:00
Eric Anholt
0e5f94a552 i965/vs: Fix uninitialized shader pointer used in debug output.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:34 -08:00
Adrian Marius Negreanu
409730843f android: fix bison warning of conflicting outputs to file
Bison -o parameter expects a .c file.
The corresponding .h filename is obtained
by removing the extension of the initial .c.

This was breaking compilation on Ubuntu 12.04

libmesa_dricore_intermediates/libmesa_dricore.a(program_parse.tab.o): In
function `_mesa_parse_arb_program':
external/mesa/src/mesa/program/program_parse.y:2682: multiple definition
of `_mesa_parse_arb_program'
libmesa_dricore_intermediates/libmesa_dricore.a(lex.yy.o):external/mesa/src/mesa/program/program_parse.y:2682:
first defined here

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-03 12:12:28 -08:00
Brian Paul
a4311054c7 st/mesa: add null pointer check in st_renderbuffer_delete()
In my testing I haven't found any cases where we get a null context
pointer, but it might still be possible.  Check for null just to be safe.

Note: This is a candidate for the stable branches.
2012-12-03 11:30:42 -07:00
Brian Paul
c6d74bfaf6 st/glx: accept GLX_SAMPLE_BUFFERS/SAMPLES_ARB == 0
Only fail if GLX_SAMPLE_BUFFERS_ARB or GLX_SAMPLES_ARB are non-zero.
We were already doing this in the older swrast/glx code.

This fixes a piglit/waffle problem where we'd always fail to get a
visual/config and report the test as "skip".

Note: This is a candidate for the stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 11:10:09 -07:00
Brian Paul
006918c0db mesa: remove warning message in _mesa_reference_renderbuffer_()
We were warning when there was no current context and we're about
to delete a renderbuffer, but that happens fairly often and isn't
really a problem.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57754

Note: This is a candidate for the stable branches.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-03 11:10:09 -07:00
James Benton
16f0d70ffe llvmpipe: Implement PIPE_QUERY_TIMESTAMP and PIPE_QUERY_TIME_ELAPSED.
This required an update for the query storage in llvmpipe, there
can now be an active query per query type, so an occlusion query
can run at the same time as a time elapsed query.

Based on PIPE_QUERY_TIME_ELAPSED patch from Dave Airlie.

v2: fix up piglits for timers (also from Dave Airlie)

a) if we don't render anything the result is 0, so just
return the current time

b) add missing screen get_timestamp callback.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-12-03 17:21:57 +00:00
Roland Scheidegger
041966801e gallivm: fix srgb format fetch
we need to rely on util code for fetching those, just like before
9f06061d50.
Fixes bugs 57699 and 57756.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-03 14:10:36 +00:00
José Fonseca
6a2f2300a8 llvmpipe: Refactor convert_to/from_blend_type to convert in place.
This fixes the "Source and destination overlap in memcpy" valgrind
warnings.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-12-03 14:02:43 +00:00
José Fonseca
03aa3fd54b llvmpipe: Improve color buffer loads/stores alignment.
Tell LLVM the exact alignment we can guarantee, based on the fs block
dimensions, pixel format, and the alignment of the resource base pointer
and stride.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-12-03 14:02:43 +00:00
José Fonseca
0bc6ec238b llvmpipe: Recompute the fs shader key when framebuffer varies.
The fs shader now depends on the color buffer formats. The shader key was
extended to accommodate this, but llvmpipe_update_derived needs to be
updated to check the framebuffer dirty flag.

This fixes bug 57674.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-03 14:02:43 +00:00
Marek Olšák
54ff536823 r300g: increment num_z_clears only if we have Hyper-Z 2012-12-02 22:22:39 +01:00
Marek Olšák
838b19609f r300g: add blacklist for apps that shouldn't steal hyperz access 2012-12-02 22:18:11 +01:00
Marek Olšák
12dcbd5954 r300g: enable Hyper-Z by default on r500
I fixed the only known bugs on r500 with 0222b2bd41.
Now there are no piglit regressions with Hyper-Z and all apps I tested seem
to work.

To summarize how it works:
- Only one process can use it at a time. This is a hardware limitation.
- The first process to clear a zbuffer gets the exclusive access to use
  Hyper-Z.
- Compositors don't use any zbuffer, so they won't steal it, but some web
  browsers do, so make sure there's no web browser running if you want your
  game to use Hyper-Z.
- There's no need to restart an app which couldn't get the access to Hyper-Z.
  Just quit the app which took it, the driver can turn it on for the other app
  in the middle of rendering.
- If an app gets the access to Hyper-Z, it prints "radeon: Acquired Hyper-Z"
  to stdout.

r300-r400:
  Hyper-Z will be enabled by default on r300-r400 once sufficient testing is
  done with piglit and Lightsmark at least.
  Be sure to set the env var RADEON_HYPERZ and run piglit with parameters: -c 0
2012-12-02 18:07:26 +01:00
Marek Olšák
0222b2bd41 r300g: clear the ZB cache before clearing ZMASK or HIZ
This fixes wrong rendering in Lightsmark and
the piglit/depthstencil-render-miplevels.

I think I fixed Hyper-Z. So far every app seems to work like a charm.
2012-12-02 07:07:33 +01:00
Marek Olšák
62cba629c0 Revert "r300g: fix occlusion queries when depth test is disabled or zbuffer is missing"
It broke Hyper-Z terribly.
2012-12-02 07:07:33 +01:00
Chad Versace
e5f1f8d52e dri: Fix i965 build
The following commit broke the i965 build:

    commit 4a486f8bf2
    Author: Marek Olšák <maraeo@gmail.com>
    Date:   Fri Nov 23 18:31:42 2012 +0100

    glx/dri2: add and use new driver hook flush_with_flags

That commit added a forward declaration of enum __DRI2throttleReason to
dri_interface.h. C++ 98 does not allow forward declarations of enums.

The fix: Move the enum's definition to earlier in the file.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-01 17:08:41 -08:00
Marek Olšák
3039addf93 st/dri: implement new driver hook flush_with_flags
v2: added documentation for dri_flush as per Brian's request
2012-12-02 00:19:02 +01:00
Marek Olšák
4003961fbf st/mesa: make st_flush do what glFlush does 2012-12-02 00:19:02 +01:00
Marek Olšák
4a486f8bf2 glx/dri2: add and use new driver hook flush_with_flags 2012-12-02 00:19:00 +01:00
Marek Olšák
5b7e9b7360 glx: move the glFlush call one layer down 2012-12-02 00:15:00 +01:00
Marek Olšák
8ad9d42b33 r300g: refuse to create too large textures 2012-12-01 22:41:39 +01:00
Marek Olšák
e694ea09f5 r300g: fix memory leaks in texture_create error paths 2012-12-01 22:38:36 +01:00
Marek Olšák
3e3a586236 r300g: fix revoking hyperz access
The bug was uncovered by 67c8e96f5a.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57763
2012-12-01 21:43:17 +01:00
Roland Scheidegger
587bd16d0d gallivm: drop border wrap clamping code
The border clamping code is unnecessary, since we don't care if a wrapped
coord value is -1 or <-1 (same for length vs. >length), in either case the
border handling code will mask out the offset and replace the texel value with
the border color.
Note that technically this is not entirely correct. Omitting clamping on the
float coords means that flt->int conversion may result in undefined values for
values of very large magnitude.
However there's no reason we should honor this here since:
a) we don't care for that for ordinary wrap modes in the aos code when
   converting coords and the problem is worse there (as we've got only
   effectively 24 instead of 32bits)
b) at least in some cases the clamping was done already in int space hence
   doing nothing to fix that problem.
c) with sse2 flt->int conversion with such values results in 0x80000000 which
   is just perfect (for clamp to border - not so much for the ordinary clamp to
   edge).

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-01 17:05:48 +01:00
Marek Olšák
224d0e4a3f r300g: handle map flag DISCARD_WHOLE_RESOURCE
This should improve performance in apps which trigger this codepath.
(e.g. Wine does)
2012-12-01 14:33:11 +01:00
Vinson Lee
da7029dcb4 radeon: Fix memory leak in radeonCreateScreen2.
Fixes a memory leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-30 19:34:31 -08:00
Brian Paul
a17750b688 nouveau: Fix build.
Fixes nouveau build failure introduced at
c73245882c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57746
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-30 19:11:21 -08:00
Dave Airlie
f3476ec8fa glsl: fix uninitialised variable from constructor
Coverity pointed out this uninitialised class member.

Note: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:27:16 +10:00
Dave Airlie
906670a790 glsl: initialise killed_all field.
coverity pointed out this field was being used uninitialised.

Note: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:27:16 +10:00
Dave Airlie
d128ae347a svga: remove pointless assert on unsigned >= 0
all unsigneds are >= 0 :-)

There may be an argument for leaving this in, in case someone
changes min_lod to an integer, so feel free to apply or drop.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:25:15 +10:00
Dave Airlie
e85c9a4d28 glsl: fix cut-n-paste error in error handling. (v2)
Reported by coverity scan.

v2: fix second case

Note: This is a candidate for stable branches.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:24:16 +10:00
Dave Airlie
67c8e96f5a r300g: fix comparison of hyperz flush time.
I haven't confirmed this is doing the correct thing, but at
least this might make someone review it!

Reported by internal RH coverity scan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-01 11:23:48 +10:00
Dave Airlie
a0ec9185eb dri_glx: fix use after free report
the critical error would use driverName.

Found by internal RH coverity scan.

Note: This is a candidate for stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:20:36 +10:00
Carl Worth
a47a0200a7 Revert "glcpp: Rewrite line-continuation support to act globally."
This reverts commit 962a1c07b4.

Further testing revealed that this commit can cause the pre-processor to enter
infinite loops. For now, simply revert this code until a cleaner,
better-tested version is available.
2012-11-30 17:17:56 -08:00
Carl Worth
962a1c07b4 glcpp: Rewrite line-continuation support to act globally.
Previously, we were only supporting line-continuation backslash characters
within lines of pre-processor directives, (as per the specification). With
OpenGL 4.2 and GLES3, line continuations are now supported anywhere within a
shader.

While changing this, also fix a bug where the preprocessor was ignoring
line continuation characters when a line ended in multiple backslash
characters.

The new code is also more efficient than the old. Previously, we would
perform a ralloc copy at each newline. We now perform copies only at each
occurrence of a line-continuation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-30 15:08:38 -08:00
Ander Conselvan de Oliveira
60a11e295b egl/wayland: Dispatch the event queue before get_buffers
When a client frame callback is executed and the client starts rendering
again, the egl event queue might not have been dispatched so that the
buffer release event for the previous frame hasn't been processed. In
that case a third buffer is allocated, even though it would be possible
to reuse the buffer that was just released.

The wl_display_dispatch_queue_pending() entry point is available from
wayland-client 1.0.2, so require that in configure.ac.  Also, just
let the pkg-config macro throw its own error, which will show what version
we were looking for and failed to find.

Note: This is a candidate for stable branches.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-11-30 17:05:50 -05:00
Kristian Høgsberg
89ba4368fd egl/wayland: Add invalidate back in eglSwapBuffers()
Commit ca3ed3e024 fixed the problem where
eglMakeCurrent would trigger a getbuffer callback that then breaks the
following wl_egl_window_resize() call.  However, we still need to
invalidate buffers in eglSwapBuffers, since in wayland we always swap
buffers, so the dri driver needs to come out and ask us for the next buffer
after each swapbuffer.

Note: this is a candidate for stable branches.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-11-30 17:04:22 -05:00
Kenneth Graunke
8d0bb74a11 i965/fs: Add fs_reg::is_zero() and is_one(); use for opt_algebraic().
These helper macros save you from writing nasty expressions like:

   if ((inst->src[1].type == BRW_REGISTER_TYPE_F &&
         inst->src[1].imm.f == 1.0) ||
        ((inst->src[1].type == BRW_REGISTER_TYPE_D ||
          inst->src[1].type == BRW_REGISTER_TYPE_UD) &&
         inst->src[1].imm.u == 1)) {

Instead, you simply get to write inst->src[1].is_one().  Simple.
Also, this makes the FS backend match the VS backend (which has these).

This patch also converts opt_algebraic to use the new helper functions.
As a consequence, it will now also optimize integer-typed expressions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-30 13:15:39 -08:00
Brian Paul
4cedb65a43 st/mesa: fix context use-after-free problem in st_renderbuffer_delete()
The use-after-free happened when the renderbuffer was shared by multiple
contexts and we tried to delete the renderbuffer using a context which
was previously deleted.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:07 -07:00
Brian Paul
51223784d6 util: added pipe_surface_release() function
To fix a pipe_context::surface_destroy() use-after-free problem.
We previously added pipe_sampler_view_release() for similar reasons.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:07 -07:00
Brian Paul
c73245882c mesa: pass context parameter to gl_renderbuffer::Delete()
We sometimes need a rendering context when deleting renderbuffers.
Pass it explicitly instead of trying to grab a current context
(which might be NULL).  The next patch will make use of this.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:06 -07:00
Ander Conselvan de Oliveira
ca3ed3e024 egl/wayland: Don't invalidate drawable on swap buffers
We used to invalidate the drawable after a call to eglSwapBuffers(),
so that a wl_egl_window_resize() would take effect for the next frame.
However, that leads to calling dri2_get_buffers() when eglMakeCurrent()
is called with the current context and surface, and a later call to
wl_egl_window_resize() would not take effect until the next buffer
swap.

Instead, add a callback from wl_egl_window_resize() back to the wayland
egl platform, and invalidate the drawable only when it is resized.

This solves a bug on wayland clients when going back to windowed mode
from fullscreen when clicking a pop up menu, where the window size
after this would be the fullscreen size.

Note: this is a candidate for stable branches.
CC: wayland-devel@lists.freedesktop.org
2012-11-30 11:08:04 -05:00
Kristian Høgsberg
b5c53245af egl: Only enable GLX backend if X11 EGL platform is enabled
We don't want to compile in a bunch of X11 dependencies in libEGL if
we can't run EGL on X11.
2012-11-30 11:08:03 -05:00
José Fonseca
e7177e362e llvmpipe: Remove remnants of lp_tile_soa from Makefile.
Completely forgot about updating Makefile when removing it. Stephane
already fixed the make build, but there were a few mentions of
lp_tile_soa left in the tree.
2012-11-30 07:07:38 +00:00
Eric Anholt
2f7915bdb9 i965/fp: Fix segfault on gen4 TXB instructions.
The gen4 simd16 workaround looks at ir->type to determine how much
storage to allocate for the simd16 value.  In fragment programs,
texturing only ever returns float vec4s (unlike GLSL, which can also
have scalar floats or vector integers), so this is the right type.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-29 22:34:28 -08:00
Vinson Lee
f126f34c1d llvmpipe: Fix incorrect sizeof.
Fixes sizeof not portable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29 21:08:48 -08:00
Stéphane Marchesin
4430d44eac llvmpipe: Fix build break from 75da95c50
The Makefile looks for a file which is gone (lp_tile_soa.c)

http://bugs.freedesktop.org/show_bug.cgi?id=57713
2012-11-29 19:54:34 -08:00
Anuj Phogat
9ab896243c mesa: Fix GL_LUMINANCE handling for textures in glGetTexImage
We need to rebase colors (ex: set G=B=0) when getting GL_LUMINANCE
textures in following cases:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

A similar fix was pushed by Brian Paul for uncompressed textures
in commit: f5d0ced.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47220

Observed no regressions in piglit and ogles2conform due to this fix.
This patch will cause failures in intel oglconform pxconv-gettex,
pxstore-gettex and pxtrans-gettex test cases. The cause of failures
is a bug in test cases. Expected luminance value is calculted
incorrectly in test cases: L = R+G+B.

V2: Set G = 0 when getting a RG texture but returning luminance.

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2012-11-29 14:05:25 -08:00
Kenneth Graunke
53ba40c156 Revert "meta: Don't try to glOrtho when the draw buffer isn't initialized."
This reverts commit 9947470655.
Apparently it caused a lot of Piglit regressions.
2012-11-29 13:49:07 -08:00
Vincent Lejeune
3fcb3fbf22 r600g: mirror simplification of if/break opcodes
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-29 22:15:18 +01:00
Vincent Lejeune
5fda2990aa r600g: separate resource_id and sampler_id tex info in tgsi-to-llvm
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-29 22:15:18 +01:00
Carl Worth
9ff6b52886 glcpp: Update README for new support of __LINE__ and __FILE__.
Drop these from the known limitations list since support was recently added
for these.

Also, fix a typo while in the area, (and the oddly missing final newline).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:02 -08:00
Carl Worth
89cd6df034 glcpp: Add test involving token pasting of INTEGER tokens.
This test file is very similar to test 113-line-and-file-macros but uses token
pasting for cleaner quiz answers (without spaces between the digits). This
test passes thanks to the recent addition of support for pasting INTEGER
tokens, (but would have failed without that).

(Note that this test is distinct from test 059-token-pasting-integer which
pastes integers parsed from the source. Those are parsed to INTEGER_STRING
tokens and are already pasted correctly as verified by that test. The only way
to generate the INTEGER tokens which currently fail to paste is with an
internal define such as __LINE__ that results in an integer.)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:02 -08:00
Carl Worth
522d1ccd77 glcpp: Add support for pasting of INTEGER tokens.
By generalizing the current code designed to paste string tokens of various
types.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:02 -08:00
Carl Worth
e1597f0a81 glcpp: Flag invalid pastes for integer followed by non-digits
As recently tested in the additions to the invalid paste test, it is illegal
to paste a non-digit sequence onto the end of an integer.

The 082-invalid-paste test should now pass again.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
c86eb0cd65 glcpp: Extend the invalid-paste test
The current code lets a few invalid pastes through, such as an string pasted
onto the end of an integer. Extend the invalid-paste test to catch some of
these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
01b83171c9 glcpp: More factoring-out of common code to simplify things.
This time creating a new _token_list_create_with_one_integer function
modeled after the existing _token_list_create_with_one_space function
(both implemented with new _token_list_create_with_one_ival).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
ea34ac499d glcpp: Factor out a tiny bit of repeated code.
This function is getting a little long too read. Simplify it by pulling
up one assignment from every condition.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
907a10378e glcpp: Add support for __LINE__ and __FILE__ macros
These tokens are easy to expand by just looking at the current, tracked
location values, (and no need to look anything up in the hash table).

Add a test which verifies __LINE__ with several values, (and verifies __FILE__
for the single value of 0). Our testing framework isn't sophisticated enough
here to have a test with multiple file inputs.

This commit fixes part of es3conform's preprocess16_frag test.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Paul Berry
dbd6135bc1 mesa: Rename API_OPENGL to API_OPENGL_COMPAT.
This should help avoid confusion now that we're using the gl_api enum
to distinguishing between core and compatibility API's.  The
corresponding enum value for core API's is API_OPENGL_CORE.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-29 11:33:15 -08:00
Marek Olšák
3e163a137b gallium/postprocess: share pipe_context and cso_context with the state tracker
Using one context instead of two is more efficient and
we can skip another context flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29 20:31:41 +01:00
Marek Olšák
135fe907a0 mesa: move some helper functions from fboobject.c to glformats.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29 20:31:41 +01:00
Tapani Pälli
0fda2e9147 android: include api_exec.c in generated files list
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-29 09:14:27 -08:00
José Fonseca
9c9c18a395 gallivm: Fix lp_build_float_to_half.
The current implementation was close by not fully correct: several
operations that should be done in floating point were being done in
integer.

Fixes piglit fbo-clear-formats GL_ARB_texture_float

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 16:52:42 +00:00
Roland Scheidegger
b5918d8f1d gallivm: fix a trivial txq issue for 2d shadow and cube shadow samplers
untested (couldn't get the piglit test to run even with version overrides)
but seemed blatantly wrong.
In any case it would only affect an error case which when it would happen
probably all hope is lost anyway.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29 15:31:46 +01:00
Roland Scheidegger
6d50148742 llvmpipe: support array textures
This adds array (1d,2d) texture support to llvmpipe.
Though probably should do something about 1d array textures requiring gobs
of memory (this issue is not strictly limited to arrays but it is probably
worse there).
Initial code by Jakob Bornecrantz <jakob@vmware.com>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29 15:30:19 +01:00
Roland Scheidegger
95e03914d8 gallivm: support array textures
Support 1d and 2d array textures (including shadow samplers),
and (as a side effect mostly) also shadow cube samplers.
Seems to pass the relevant piglit tests both for sampling and rendering
to (though some require version overrides).
Since we don't support render target indices rendering to array textures
is still restricted to a single layer at a time.
Also, the min/max layer in the sampler view (which is unnecessary for GL)
is ignored (always use all layers).

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29 15:28:25 +01:00
José Fonseca
88e92f5bcd llvmpipe: Remove lp_build_blend_soa()
No longer used/necessary, as we always blend in AoS now.

Trivial.
2012-11-29 14:08:43 +00:00
José Fonseca
75da95c50a llvmpipe: Eliminate color buffer swizzling.
Now dead code.

Also had to remove the show_tiles/show_subtiles because now the color
buffers are always stored in their native format, so there is no longer
an easy way to paint the tile sizes.

Depth-stencil buffers are still swizzled.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:43 +00:00
José Fonseca
6916387e53 llvmpipe: Only advertise unswizzled formats.
Update llvmpipe_is_format_supported and llvmpipe_is_format_unswizzled
so that only the formats that we can render without swizzling are
advertised.

We can still render all D3D10 required formats except
PIPE_FORMAT_R11G11B10_FLOAT, which needs to be implemented in a future
opportunity.

Removal of rendertarget swizzling will be done in a subsequent change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:42 +00:00
José Fonseca
9f06061d50 util/u_format: Kill util_format_is_array().
It is buggy (it was giving wrong results for some of the formats with
padding), and util_format_description::is_array already does precisely
what's intended.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:42 +00:00
José Fonseca
a47674ee89 util/u_format: Tighten the meaning of is_array bit to exclude mixed type formats.
This is what we want in practice.

The only change is in PIPE_FORMAT_R8SG8SB8UX8U_NORM, which no longer is
considered an array format.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:42 +00:00
Adhemerval Zanella
64e9ec634b util/u_format: Fix format manipulation for big-endian
This patch fixes various format manipulation for big-endian
architectures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:23 +00:00
Adhemerval Zanella
e25abacc18 gallivm: Fix format manipulation for big-endian
This patch fixes various format manipulation for big-endian
architectures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:18 +00:00
Adhemerval Zanella
b772d784b2 gallivm: Add byte-swap construct calls
This patch adds two more functions in type conversions header:
* lp_build_bswap: construct a call to llvm.bswap intrinsic for an
  element
* lp_build_bswap_vec: byte swap every element in a vector base on the
  input and output types.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:14 +00:00
Adhemerval Zanella
86902b5134 gallivm: Fix vector constant for shuffle
This patch fixes the vector constant generation used for vector shuffle
for big-endian machines.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:10 +00:00
Adhemerval Zanella
29ba79b2c9 gallivm: clear Altivec NJ bit
This patch enforces the clear of NJ bit in VSCR Altivec register so
denormal numbers are handles as expected by IEEE standards.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:52:05 +00:00
Adhemerval Zanella
43ce9efdbf gallivm: Altivec floating-point rounding
This patch adds Altivec intrinsics for float vector types. It changes
the SSE specific definitions to a platform neutral and adds the calls
to Altivec intrinsic builder.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:52:00 +00:00
Adhemerval Zanella
dd5c580816 gallivm: Altivec vector add/sub intrisics
This patch add correct vector addition and substraction intrisics when
using Altivec with PPC. Current code uses default path and LLVM backend
ends up issuing carry-out arithmetic instruction while it is expected
saturated ones.

It also includes a fix for PowerPC where char are unsigned by default,
resulting in bogus values for vector shifting.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:51:53 +00:00
Adhemerval Zanella
2ea7d3dabd gallivm: Altivec vector max/min intrisics
This patch adds the PPC Altivec instrics max/min instruction for
supported Altivec vector types (16xi8, 8xi16, 4xi32, 4xf32).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:51:46 +00:00
Adhemerval Zanella
31c63b058e gallivm: Altivec pack/unpack intrisics
This patch adds PPC Altivec support for pack/unpack operations using Altivec
supported vector type (8xi8, 16xi16, 4xi32, 4xf32).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:51:41 +00:00
Michel Dänzer
8b6aec6533 radeonsi: Bitcast result of packf16 intrinsic to float for export intrinsic.
Fixes 7 piglit tests, and prevents many more from crashing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-and-Tested-by: Christian König <christian.koenig@amd.com>
2012-11-29 10:08:53 +01:00
Kenneth Graunke
c102360800 i965/vs: Move struct brw_compile (p) entirely inside vec4_generator.
The brw_compile structure contains the brw_instruction store and the
brw_eu_emit.c state tracking fields.  These are only useful for the
final assembly generation pass; the earlier compilation stages doesn't
need them.

This also means that the code generator for future hardware won't have
access to the brw_compile structure, which is extremely desirable
because it prevents accidental generation of Gen4-7 code.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:16:01 -08:00
Kenneth Graunke
eda9726ef5 i965/vs: Split final assembly code generation out of vec4_visitor.
Compiling shaders requires several main steps:

   1. Generating VS IR from either GLSL IR or Mesa IR
   2. Optimizing the IR
   3. Register allocation
   4. Generating assembly code

This patch splits out step 4 into a separate class named "vec4_generator."

There are several reasons for doing so:

   1. Future hardware has a different instruction encoding.  Splitting
      this out will allow us to replace vec4_generator (which relies
      heavily on the brw_eu_emit.c code and struct brw_instruction) with
      a new code generator that writes the new format.

   2. It reduces the size of the vec4_visitor monolith.  (Arguably, a lot
      more should be split out, but that's left for "future work.")

   3. Separate namespaces allow us to make helper functions for
      generating instructions in both classes: ADD() can exist in
      vec4_visitor and create IR, while ADD() in vec4_generator() can
      create brw_instructions.  (Patches for this upcoming.)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:58 -08:00
Kenneth Graunke
db6231fece i965/vs: Abort on unsupported opcodes rather than failing.
Final code generation should never fail.  This is a bug, and there
should be no user-triggerable cases where this could occur.

Also, we're not going to have a fail() method after the split.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:57 -08:00
Kenneth Graunke
8af8a26480 i965/vs: Move uses of brw_compile from do_vs_prog to brw_vs_emit.
The brw_compile structure is closely tied to the Gen4-7 hardware
encoding.  However, do_vs_prog is very generic: it just calls out to
get a compiled program and then uploads it.

This isn't ultimately where we want it, but it's a step in the right
direction: it's now closer to the code generator.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:55 -08:00
Kenneth Graunke
746fc346ea i965/vs: Rework memory contexts for shader compilation data.
During compilation, we allocate a bunch of things: the IR needs to last
at least until code generation...and then the program store needs to
last until after we upload the program.

For simplicity's sake, just keep it all around until we upload the
program.  After that, it can all be freed.

This will also save a lot of headaches during the upcoming refactoring.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:53 -08:00
Kenneth Graunke
031146736c i965/vs: Pass the brw_context pointer into brw_compute_vue_map().
We used to steal it out of the brw_compile struct, but that won't be
initialized in time soon (and is eventually going away).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:51 -08:00
Kenneth Graunke
403bb1d306 i965/vs: Pass the brw_context pointer into vec4_visitor and do_vs_prog.
We used to steal it out of the brw_compile struct...but vec4_visitor
isn't going to have one of those in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:50 -08:00
Kenneth Graunke
dd50c88386 i965/vs: Move some functions from brw_vec4_emit.cpp to brw_vec4.cpp.
This leaves only the final code generation stage in brw_vec4_emit.cpp,
moving the payload setup, run(), and brw_vs_emit functions to brw_vec4.cpp.

The fragment shader backend puts these functions in brw_fs.cpp, so this
patch also helps with consistency.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:26 -08:00
Kenneth Graunke
9947470655 meta: Don't try to glOrtho when the draw buffer isn't initialized.
I ran across this while running a glGenerateMipmap() test.

_meta_GenerateMipmap sets MESA_META_TRANSFORM, which causes
_mesa_meta_begin to try and set a default orthographic projection.

Unfortunately, if the drawbuffer isn't set up, ctx->DrawBuffer->Width
and Height are 0, which just causes an GL_INVALID_VALUE error.

Fixes oglconform's fbo/mipmap.automatic, mipmap.manual, and
mipmap.manualIterateTexTargets.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-28 18:12:07 -08:00
Jason Wood
8d1ee38a4c docs: Mark some features in GL3.txt as done for r600
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-11-29 01:07:26 +01:00
Marek Olšák
aa46cc2879 st/mesa: allow forward-compatible contexts and set Const.ContextFlags
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-29 01:07:26 +01:00
Marek Olšák
249f86e3f8 st/mesa: add support for GL core profiles
The rest of the plumbing was in place already.

I have tested this by turning on all GL 3.1 features.
The drivers not supporting GL 3.1 will fail to create a core profile
as they should.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-29 01:07:26 +01:00
Marek Olšák
f9429e30aa configure.ac: remove -fomit-frame-pointer from LLVM flags
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Marek Olšák
3d59cde92e configure.ac: look for whole words in LLVM flags, not prefixes
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Marek Olšák
9b67a347f6 configure.ac: consolidate stripping unwanted LLVM flags
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Marek Olšák
a84a8da4f8 configure.ac: print LLVM flags
to see what we're mixing with ours

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Brian Paul
0904973e39 util: add more memory debugging features
Add a DEBUG_FREED_MEMORY option to help catch use-after-free errors.
Add debug_memory_check() function which can be periodically called to
check that all known blocks are good.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-28 15:03:29 -07:00
José Fonseca
1cead8845b llvmpipe: Implement logic ops for the AoS path.
It was forgotten in the previous patch series, but it is trivial to
implement, based on the SoA path.

This fixes glean logicOp failures.
2012-11-28 20:45:18 +00:00
José Fonseca
547efc76df llvmpipe: Don't use dynamically sized arrays.
Unfortunately for MSVC arrays with a constant variable size are still
considered dynamically sized.
2012-11-28 19:58:47 +00:00
Eric Anholt
c8ed9f6262 i965/gen4-5: Fix segfaults with stencil-only depth/stencil setups.
Fixes a ton of piglit regressions since the depthstencil fixes for gen6+.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57309
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-28 11:26:41 -08:00
Eric Anholt
b9b033d8e4 i965/fs: Don't generate saturates over existing variable values.
Fixes a crash in http://workshop.chromeexperiments.com/stars/ on i965,
and the new piglit test glsl-fs-clamp-5.
We were trying to emit a saturating move into a uniform, which the code
generator appropriately choked on.  This was broken in the change in
32ae8d3b32.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57166
NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-28 11:26:34 -08:00
Eric Anholt
154ef07aa7 i965/fs: Add some minimal backend-IR dumping.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-28 11:26:33 -08:00
James Benton
960ab06da0 llvmpipe: Update llvmpipe_is_format_unswizzled to reflect latest changes.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
66fdf626bb llvmpipe: Enable vertex color clamping.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
fa1b481c09 llvmpipe: Unswizzled rendering.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
1d3789bccb gallivm: Updated lp_build_const_mask_aos to input number of channels.
Also updated lp_build_const_mask_aos_swizzled to reflect this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
d03d29a044 util: Updated util_format_is_array to be more accurate.
Will allow formats with padding, e.g. RGBX.
Will now allow swizzled formats as long as the alpha is channel 3.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
e66ec7c46b gallivm: Added support for float to half-float conversion in lp_build_conv.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
d7a8390a82 gallivm: Changed lp_build_pad_vector to correctly handle scalar argument.
Removed the lp_type argument as it was unnecessary.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
71c6fe76c0 gallivm: Add a function to generate lp_type for a format.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
cd548836a1 gallivm: Add support for unorm16 in lp_build_mul.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:20 +00:00
Matt Turner
c3a465ae98 glcpp: Support #elif(expression) with no intervening space.
And add test cases to ensure that this works
	- 110 verifies that glcpp rejects #elif<digits> which glcpp
	  previously accepted.
	- 111 verifies that glcpp accepts #if followed immediately by
	  (, +, -, !, or ~.
	- 112 does the same as 111 but for #elif.

See 17f9beb6 for #if change.
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-11-28 10:27:02 -08:00
Matt Turner
aed466192a glcpp: Reject #version and #line not followed by whitespace
Fixes part of es3conform's preprocess16_frag test.
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-11-28 10:26:53 -08:00
Marek Olšák
91ca053714 mesa: fix BlitFramebuffer between linear and sRGB formats
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-28 18:48:22 +01:00
Roland Scheidegger
406b76ca32 gallivm: fix multiple lods with different min/mag filter and wide vectors
broken since 529fe420ba,
I forgot some code, only added the comment...
Fixes bug 57644.
2012-11-28 18:07:27 +01:00
Michel Dänzer
6e33b55ee1 radeonsi: Reinstate assertions against invalid colour/depth formats.
radeonsi now supports Z16 and doesn't fail these assertions anymore.

This partially reverts commit 7bba4879bb, but
leaves the error messages in place to allow diagnosing such problems even with
non-debugging builds.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-11-28 15:48:50 +01:00
Michel Dänzer
a8d46d0173 radeonsi: Re-enable Z16 depth buffers.
8 more piglits.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-11-28 13:53:54 +01:00
Marek Olšák
726fe54cbc radeonsi: remove redundant parameter in r600_init_surface
[ Cherry-picked from r600g commit f5ac60152b ]
2012-11-28 13:35:17 +01:00
Michel Dänzer
fa83d52961 radeonsi: Use explicit stencil mipmap level offsets.
Extracted from r600g commit 428e37c2da.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:17 +01:00
Marek Olšák
39b56afaa2 radeonsi: correct texture memory size for Z32F_S8X24
[ Cherry-picked from r600g commit ea72351a91 ]
2012-11-28 13:35:17 +01:00
Michel Dänzer
20f651d003 radeonsi: Depth/stencil fixes.
Adapted from r600g commit 018e3f75d6.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:17 +01:00
Michel Dänzer
1a616c1009 radeonsi: Flesh out support for depth/stencil exports from the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:16 +01:00
Michel Dänzer
49003a5cb6 radeonsi: Fix sampler views for depth textures.
Consistently reference the flushed depth texture in the sampler view, not the
original one.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:16 +01:00
Jerome Glisse
3c024624fd radeonsi: Fix z/stencil texture creation.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>

[ Cherry-picked from r600g commit b4f0ab0b22 ]
2012-11-28 13:35:16 +01:00
Vinson Lee
ffc318a97a scons: Build ws_xlib on Mac OS X.
Fixes this SCons build error on Mac OS X if X11 is found.

NameError: name 'ws_xlib' is not defined:
  File "SConstruct", line 144:
    duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/SConscript", line 34:
    SConscript('gallium/SConscript')
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/gallium/SConscript", line 135:
    'targets/libgl-xlib/SConscript',
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/gallium/targets/graw-xlib/SConscript", line 9:
    ws_xlib,

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 23:13:57 -08:00
Johannes Obermayr
53636fdf93 configure.ac: Remove -O., -g and -Wall from LLVM_C{PP,XX}FLAGS.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-11-28 00:19:17 +01:00
Brian Paul
f75acabb96 vbo: move another line of code after declarations
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-11-27 15:34:56 -07:00
Brian Paul
8765c0d20f vbo: move code after declarations to fix MSVC errors
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-27 14:28:56 -07:00
Brian Paul
f94e672b47 vbo: minor whitespace fix 2012-11-27 13:56:52 -07:00
Brian Paul
a547e532fc mesa: remove '(void) k' lines
Serves no purpose as the k parameter is used later in the code.
2012-11-27 13:56:52 -07:00
Kenneth Graunke
7a414fea87 mesa/vbo: Check for invalid types in various packed vertex functions.
According to the ARB_vertex_type_2_10_10_10_rev specification:
"The error INVALID_ENUM is generated by VertexP*, NormalP*,
 TexCoordP*, MultiTexCoordP*, ColorP*, or SecondaryColorP if <type>
 is not UNSIGNED_INT_2_10_10_10_REV or INT_2_10_10_10_REV."

Fixes 7 subcases of oglconform's packed-vertex test.

v2: Add "gl" prefix to error messages (pointed out by Brian).
    Also rebase atop the ctx plumbing.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 12:36:33 -08:00
Kenneth Graunke
6a529e2b48 mesa/vbo: Support the ES 3.0 signed normalized scaling rules.
Traditionally, OpenGL has had two separate equations for converting from
signed normalized fixed-point data to floating point data.  One was used
primarily for vertex data, while the other was primarily for texturing
and framebuffer data.

However, ES 3.0 and GL 4.2 change this, declaring there's only one
equation to be used in all cases.  Unfortunately, it's the other one.

v2: Correctly convert 0b10 to -1.0, as pointed out by Chris Forbes.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2012-11-27 12:36:33 -08:00
Kenneth Graunke
c8d8d5db72 mesa/vbo: Plumb ctx through to the conv_i(10|2)_to_norm_float functions.
The rules for converting these values actually depend on the current
context API and version.  The next patch will implement those changes.

v2: Mark ctx as const, as suggested by Brian.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2012-11-27 12:36:33 -08:00
Matt Turner
13f9012ad3 mesa: Set transform feedback's default buffer mode to INTERLEAVED_ATTRIBS
Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 10:40:50 -08:00
Matt Turner
7c2060f0f0 mesa: Return 0 for XFB_VARYING_MAX_LENGTH if no varyings
v2: Perform this count the same way as elsewhere in this file, per
    Brian Paul's review.

Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 10:40:49 -08:00
Andreas Boll
f65741721b gallium/tests/trivial: updates for transfer functions changes
Fixes build error with configure option --enable-gallium-tests
introduced in 369e468889

Compile tested only.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-11-27 19:00:48 +01:00
Andreas Boll
cba639f2a1 gallium/tests/trivial: updates for CSO interface changes
Fixes build error with configure option --enable-gallium-tests
introduced in ea6f035ae9

Cc: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-11-27 19:00:48 +01:00
Andreas Boll
1553f5ce83 gallium/tests/trivial: updates for util_draw_vertex_buffer changes
Fixes build error with configure option --enable-gallium-tests
introduced in e73bf3b805

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-11-27 19:00:48 +01:00
James Benton
9bd4856b5c util: Modified u_rect to default to memcpy.
Previously this function would assert if the format didn't fit an expected 4 channel format size.

Now will work with any format type with any amount of channels.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 16:24:42 +00:00
James Benton
65016646e3 util/format: Fix bug in float to non-float conversion in u_format_pack.py.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 16:24:02 +00:00
James Benton
978df710f2 gallivm: Fix bug in lp_build_one which would incorrectly return a vector for length 1.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 16:23:04 +00:00
Kenneth Graunke
9bc9895c4a glsl: Support unsigned integer constants in layout qualifiers.
Fixes es3conform's explicit_attrib_location_integer_constants.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-26 21:02:45 -08:00
Kenneth Graunke
9136723214 i965/fs: Move struct brw_compile (p) entirely inside fs_generator.
The brw_compile structure contains the brw_instruction store and the
brw_eu_emit.c state tracking fields.  These are only useful for the
final assembly generation pass; the earlier compilation stages doesn't
need them.

This also means that the code generator for future hardware won't have
access to the brw_compile structure, which is extremely desirable
because it prevents accidental generation of Gen4-7 code.

v2: rzalloc p, as suggested by Eric.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
ea681a0d64 i965/fs: Split final assembly code generation out of fs_visitor.
Compiling shaders requires several main steps:

   1. Generating FS IR from either GLSL IR or Mesa IR
   2. Optimizing the IR
   3. Register allocation
   4. Generating assembly code

This patch splits out step 4 into a separate class named "fs_generator."

There are several reasons for doing so:

   1. Future hardware has a different instruction encoding.  Splitting
      this out will allow us to replace fs_generator (which relies
      heavily on the brw_eu_emit.c code and struct brw_instruction) with
      a new code generator that writes the new format.

   2. It reduces the size of the fs_visitor monolith.  (Arguably, a lot
      more should be split out, but that's left for "future work.")

   3. Separate namespaces allow us to make helper functions for
      generating instructions in both classes: ADD() can exist in
      fs_visitor and create IR, while ADD() in fs_generator() can
      create brw_instructions.  (Patches for this upcoming.)

Furthermore, this patch changes the order of operations slightly.
Rather than doing steps 1-4 for SIMD8, then 1-4 for SIMD16, we now:

   - Do steps 1-3 for SIMD8, then repeat 1-3 for SIMD16
   - Generate final assembly code for both modes together

This is because the frontend work can be done independently, but final
assembly generation needs to pack both into a single program store to
feed the GPU.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
dd1fd30047 i965/fs: Abort on unsupported opcodes rather than failing.
Final code generation should never fail.  This is a bug, and there
should be no user-triggerable cases where this could occur.

Also, we're not going to have a fail() method in a moment.

v2: Just abort() rather than assert, to cover the NDEBUG case
    (suggested by Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
cd0acb1abe i965: Make it possible to create a cfg_t without a backend_visitor.
All we really need is a memory context and the instruction list; passing
a backend_visitor is just convenient at times.

This will be necessary two patches from now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
4d09fe938e i965/fs: Move uses of brw_compile from do_wm_prog to brw_wm_fs_emit.
The brw_compile structure is closely tied to the Gen4-7 hardware
encoding.  However, do_wm_prog is very generic: it just calls out to
get a compiled program and then uploads it.

This isn't ultimately where we want it, but it's a step in the right
direction: it's now closer to the code generator.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
3417b2f2b2 i965/fs: Pass the brw_context pointer into fs_visitor explicitly.
We used to steal it out of the brw_compile struct...but fs_visitor
isn't going to have one of those in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
1f74002a98 i965/fs: Move brw_wm_compile::fp to fs_visitor.
Also change it from a brw_fragment_program to a gl_fragment_program,
since that seems to be what everything wants anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
7b0d30eb87 i965/fs: Remove struct brw_shader * parameter to fs_visitor constructor.
We can easily recover it from prog, and this makes it clear that we
aren't passing additional information in.

v2: Use an if-statement rather than the ?: operator (suggested by Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
a303df86de i965/fs: Move brw_wm_compile::dispatch_width into fs_visitor.
Also, rather than having brw_wm_fs_emit poke at it directly, make it a
parameter to the fs_visitor constructor.

All other changes generated by search and replace (with occasional
whitespace fixup).

v2: Make dispatch_width const (as suggested by Paul); fix doxygen
    mistake (pointed out by Eric); update for rebase.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
47a6a7b51b i965/fs: Move brw_wm_lookup_iz() to fs_visitor::setup_payload_gen4().
This necessitates compiling brw_wm_iz.c as C++.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
2429c9d347 i965/fs: Move brw_wm_payload_setup() to fs_visitor::setup_payload_gen6()
Now that we only have the one backend, there's no real point in keeping
this separate.  Moving it should allow some future simplifications.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
ce96f6db90 i965/fs: Remove brw_wm_compile::computes_depth field.
Everybody determines this by checking if fp's OutputsWritten field
contains the FRAG_RESULT_DEPTH bit.  Rather than having payload setup
check this and set the computes_depth flag, we can just do the check in
the only place that actually used it: emit_fb_writes().

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Roland Scheidegger
529fe420ba gallivm: use the new mip per quad handling in texture fetch path
No longer have to split fetching into quads dynamically if mip levels
are not the same for all quads (aos sampling still always splits due
to performance reasons).
Instead handle multiple mip levels further down, minification etc. takes
this into account.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 03:30:55 +01:00
Roland Scheidegger
0b6554ba6f gallivm,llvmpipe: handle TXF (texelFetch) instruction, including offsets
This also adds some code to handle per-quad lods for more than 4-wide fetches,
because otherwise I'd have to integrate the texelFetch function into
the splitting stuff... (but it is not used yet outside texelFetch).
passes piglit fs-texelFetch-2D, fails fs-texelFetchOffset-2D due to I believe
a test error (results are undefined for out-of-bounds fetches, we return
whatever is at offset 0, whereas the test expects [0,0,0,1]).
Texel offsets are only handled by texelFetch for now, though the interface
can handle it for everything.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 03:26:49 +01:00
Chris Forbes
93c689a2df i965: Enable ARB_vertex_type_2_10_10_10_rev on Gen4+.
v2 (Kayden): Move the enable into an existing intel->gen >= 4 block
(as suggested by Ian).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:48:29 -08:00
Chris Forbes
4a64efc01b i965: emit w/a for packed attribute formats in VS
Implements BGRA swizzle, sign recovery, and normalization
as required by ARB_vertex_type_10_10_10_2_rev.

V2: Ported to the new VS backend, since that's all that's left;
	fixed normalization.

V3: Moved fixups out of the GLSL-only path, so it works for FF/VP too.

V4 (Kayden): Rework ES3 normalization, don't heap allocate registers;
	tidy comments.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:35:10 -08:00
Chris Forbes
352ae51efd i965: set attribute w/a bits for packed formats
Flag the need for various workarounds to be applied by
the vertex shader.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:35:00 -08:00
Chris Forbes
c3c680950d i965: Generalize GL_FIXED VS w/a support
Next few patches build on this to add other workarounds
for packed formats.

V2: rename BRW_ATTRIB_WA_COMPONENTS to BRW_ATTRIB_WA_COMPONENT_MASK;
V3 (Kayden): remove separate bit for ES3 signed normalization

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:34:28 -08:00
Chris Forbes
23f4411c41 i965: support 2_10_10_10 formats in get_surface_type.
Always use R10G10B10A2_UINT; Most of the other formats we'd like
don't actually work on the hardware. Will emit w/a for scaling,
sign recovery and BGRA swizzle in the VS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:34:23 -08:00
Chris Forbes
f9a08f7f0f i965: implement get_size for 2_10_10_10 formats
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:34:20 -08:00
Chris Forbes
894fe54ec9 i965/vs: add support for emitting SHL, SHR, ASR
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 14:02:30 -08:00
Matt Turner
8f3570efc7 mesa: Use correct glGetTransformFeedbackVarying name in error msg
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-26 10:08:05 -08:00
Andreas Boll
0f5e2ce854 build: use git ls-files for adding all Makefile.in into the release tarball
Until we have proper 'make dist' this is an improvement of the current
situation, because each time some old Makefiles got converted to automake
we had to update the tarballs target.

NOTE: This is a candidate for the 9.0 branch.

Cc: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-11-26 19:03:21 +01:00
Eric Anholt
97747ac88f i965: Fix hangs with FP KIL instructions pre-gen6.
We can't support IF statements in 16-wide on these.  To get back to 16-wide
for these shaders, we need to support predicate on discard instructions in the
backend IR, which is something we've sort of got on the list to do anyway.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55828
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-25 20:22:02 -08:00
Eric Anholt
59bfd66a61 i965/gen4: Fix memory leak each time compile_gs_prog() is called.
Commit 774fb90db3 introduced a ralloc context to
each user of struct brw_compile, but for this one a NULL context was used,
causing the later ralloc_free(mem_ctx) to not do anything.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55175
NOTE: This is a candidate for the stable branches.
2012-11-25 18:25:26 -08:00
Eric Anholt
244db0855c i965/gen4: Fix LOD bias texturing since my fixed reg classes change.
We have a special case where non-shadow comparison with LOD requires using a
SIMD16 vec4 in an 8-wide shader, which appears in the register allocator as a
size 8 vgrf.

Fixes assertions in various piglit tests and webgl conformance.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56521
2012-11-25 18:25:26 -08:00
Marek Olšák
cff4c948ed r600g: fix broken streamout if streamout_begin caused a context flush
This fixes graphics corruption in the case where the DISCARD_RANGE flag
is used to map a buffer.

NOTE: This is a candidate for the stable branches.
2012-11-23 00:42:02 +01:00
Marek Olšák
d172fa825b r600g: fix ARB_map_buffer_alignment with unaligned offsets and staging buffers 2012-11-22 22:40:06 +01:00
Vinson Lee
f884005771 scons: Append x11 library path if linking x11 library.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-21 22:34:20 -08:00
Kenneth Graunke
bf75a1f092 mesa/vbo: Fix scaling issue in 2-bit signed normalized packing.
Since a signed 2-bit integer can only represent -1, 0, or 1, it is
tempting to simply to convert it directly to a float.  This maps it
onto the correct range of [-1.0, 1.0].  However, it gives different
values compared to the usual equation:

(2.0 *  1.0 + 1.0) * (1.0 / 3.0) = +1.0           (same)
(2.0 *  0.0 + 1.0) * (1.0 / 3.0) = +0.33333333... (different)
(2.0 * -1.0 + 1.0) * (1.0 / 3.0) = -0.33333333... (different)

According to the GL_ARB_vertex_type_2_10_10_10_rev extension, signed
normalization is performed using equation 2.2 from the GL 3.2
specification, which is:

   f = (2c + 1)/(2^b - 1).                                (2.2)

Comments below that equation state: "In general, this representation is
used for signed normalized fixed-point parameters in GL commands, such
as vertex attribute values."  Which is what we're doing here.

The 3.2 specification goes on to declare an alternate formula:

   f = max{c/(2^(b-1) - 1), -1.0}                         (2.3)

which is closer to the existing code, and maps the end points to exactly
-1.0 and 1.0.  Comments below the equation state: "In general, this
representation is used for signed normalized fixed-point texture or
framebuffer values."  Which is *not* what we're doing here.

It then states: "Everywhere that signed normalized fixed-point
values are converted, the equation used is specified."  This is the real
clincher: the extension explicitly specifies that we must use equation
2.2, not 2.3.  So we need to do (2x + 1) / 3.

This matches the behavior expected by oglconform's packed-vertex test,
and is correct for desktop GL (pre-4.2).  It's not correct for ES 3.0,
but a future patch will correct that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-11-21 20:32:54 -08:00
Kenneth Graunke
e9967aba61 mesa/vbo: Fix scaling issue in 10-bit signed normalized packing.
For the 10-bit components, the divisor was incorrect.  A 10-bit signed
integer can represent -2^9 through 2^9 - 1, which leads to the following
ranges:

       (float)value.x          -> [ -512,  511]
2.0F * (float)value.x          -> [-1024, 1022]
2.0F * (float)value.x + 1.0F   -> [-1023, 1023]

So dividing by 511 would incorrectly scale it to approximately:
[-2.001956947, 2.001956947].  To correctly scale to [-1.0, 1.0], we need
to divide by 1023.

This correctly implements the desktop GL rules.  ES 3.0 has different
rules, but those will be implemented in a separate patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-11-21 20:29:38 -08:00
Alex Deucher
e2df37f69a radeonsi: add a new SI pci id
Note: this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-21 18:49:00 -05:00
Vinson Lee
10f214e5b2 i915: Fix wrong sizeof argument in i915_update_tex_unit.
The bug was found by Coverity.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-21 15:02:35 -08:00
Andreas Boll
59b3d3ad6e Add .dirstamp to toplevel .gitignore 2012-11-21 18:25:10 +01:00
Andreas Boll
f7e2e864c8 gallium/tests: update .gitignore files 2012-11-21 18:24:30 +01:00
Eric Anholt
d82b873a50 i965/fs: Add helper functions for IF and CMP and use them.
v2: Rebase on gen6-if fix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-20 13:38:38 -08:00
Eric Anholt
32d6809bb5 i965/fs: Add helper functions for generating ALU ops, like in the VS.
This gives us checking of our arguments (no more passing 1 operand to
BRW_OPCODE_MUL!), at the cost of a couple of extra parens.

v2: Rebase on gen6-if fix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-20 12:55:08 -08:00
Eric Anholt
1665af3066 i965/gen4: Fix crash with fragment programs and texture rectangle.
This was a regression in the brw_fs_fp.cpp change.  We just need to return
something good enough to get the IR generation to the end without crashing,
but ir->type isn't initialized and we wanted something of the coordinate's
type anyway.

Fixes around 30 piglit cases on my ilk system in drawpixels and framebuffer
blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-19 22:33:44 -08:00
Eric Anholt
d411bbd5bd i965: Disable the GB clip test when a limited viewport is set.
The theory of the guardband is that you extend the clip volume to avoid
expensive clipping computation, and just let fragments outside the viewport
get clipped by the drawable's bounds.  But if a smaller-than-window-size
viewport is set, and we don't also happen to have a scissor set, then
rendering could incorrectly extend outside of the viewport when it should have
been clipped to the viewport.

Fixes the new piglit triangle-guardband-viewport test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
2012-11-19 22:33:44 -08:00
Eric Anholt
23e7b81f2d i965: Use fewer temporary variables in clip setup.
When you're comparing to the spec, you're trying to immediately see what
numbered dword of the packet your bit ends up in.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
2012-11-19 22:33:43 -08:00
Eric Anholt
afc5a26b5c Revert "i965/fs: Fix conversions float->bool, int->bool"
This reverts commit cf0bbb30f6.  It
was just papering over the bug fixed in the previous commit.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-19 22:33:43 -08:00
Eric Anholt
0482998ccc i965/fs: Fix the gen6-specific if handling for 80ecb8f15b
Fixes oglconform shad-compiler advanced.TestLessThani.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
NOTE: This is a candidate for the 9.0 branch.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-19 22:33:43 -08:00
Chad Versace
c9f5126b15 intel: Use designated initializers for DRI extension structs
All Intel code is compiled with -std=c99. There is no excuse to not use
designated initializers.

As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep.  I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:09:55 -08:00
Chad Versace
62332f4125 dri: Use designated initializers for DRI extension structs
The dri directory is compiled with -std=c99. There is no excuse to not use
designated initializers.

As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep.  I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:09:55 -08:00
Eric Anholt
fdd6d146d9 i965: Use the separate stencil buffer's offsets for stencil setup.
For a packed depth/stencil buffer on separate stencil hardware, the
separate depth miptree is set up with alignment of 4,4 and the separate
stencil miptree is setup with alignment of 8,8.  We can't just use the
irb->draw_{x,y} offsets for stencil, since that is the offset in the
depth miptree.

Fixes 12 piglit depthstencil testcases on ivb.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
52ee1a7269 i965: Move all the depth/stencil/hiz offset logic into the workaround.
Given that we have the mask information here (assuming the rebase is to
the same tiling, which is safe), we can just save a set of miptrees and
offsets and the global intra-tile offset in the context and cut out a
bunch of logic.  This will also save emitting the next fix I need to do
twice.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
9ec6a54ba9 i965: When rebasing depth or stencil, update x/y before deciding the other.
Fixes a theoretical problem where we had an aligned depth buffer and a
misaligned stencil buffer with a matching tile offset, so we would fail
to rebase depth even after the needed tile offset changed due to the
rebase of stencil.

It should also fix double-rebase of a misaligned packed depth/stencil
renderbuffer, which may have been a performance issue.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
be9e664307 intel: Push face/level -> slice handling to the caller of get_image_offset().
We were always passing 0 for one of the two fields, and the code just used
whichever one wasn't 0.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
c1fabea1c5 i965: Add some checks for array textures in unsupported paths.
I noticed these in the next patch where these paths were using the Face
of a teximage but didn't have array handling.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
923c4b3f4a i965: Add a little bit more debug info for validate blits.
The kind of data you're copying is definitely an interesting variable.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
e5671040c5 intel: Remove dead function prototype.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
1f35ec585f i965: Remove stale comment about wrapped_depth.
I removed that code almost a year ago.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Kenneth Graunke
1f74a5b3cc mesa: Mark GetBufferParameteri64v as implemented.
Apparently this was accidentally marked as unimplemented, and thus not
put in the dispatch table.

Fixes 7 es3conform tests:
- copy_buffer_parameters
- copy_buffer_data
- copy_buffer_usage
- pixel_buffer_object_bind
- pixel_buffer_object_parameteriv
- pixel_buffer_object_texture_read
- pixel_buffer_object_usage

v2: Also update the DispatchSanity test for this change.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:49:04 -08:00
Kenneth Graunke
bbda7d65a9 mesa: Require gen'd names in glBeginQuery on ES 3.0.
Only legacy OpenGL allows the use of non-gen'd names.  Core profiles
and ES 3 both require the use of glGenQueries().

Note that BeginQuery doesn't exist in ES 1 or ES 2.

Fixes es3conform's occlusion_query_invalid_beginquery test.

Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:49:00 -08:00
Kenneth Graunke
c6ed42a89e mesa: Support EXT_framebuffer_blit targets in ES 3.0 as well.
GL_READ_FRAMEBUFFER and GL_DRAW_FRAMEBUFFER are valid targets in ES 3.

Fixes 23 es3conform framebuffer_blit tests.  Two more go from fail to
crash, but that appears to be because they actually run now.

Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:48:56 -08:00
Kenneth Graunke
f399a707c8 mesa: Fix error code for glTexParameteri of TEXTURE_MAX_LEVEL.
Calling glTexParameteri() with pname GL_TEXTURE_MAX_LEVEL and either a
target of GL_TEXTURE_RECTANGLE or a negative value previously generated
GL_INVALID_OPERATION.  However, GL_INVALID_VALUE seems more appropriate.

Fixes oglconform's api-error/negative.glTexParameter and es3conform's
sgis_texture_lod_basic_error.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:48:52 -08:00
Kenneth Graunke
4e907018b2 i965/vs: Don't lose attribute type when converting ATTR to FIXED_HW_REG.
The new brw_reg always had type BRW_REGISTER_TYPE_F, rather than
inheriting the original type of the ATTR file register.

In the past, this hasn't been a problem since we only execute this code
when fixing up GL_FIXED attributes, which always have float types.
However, we'll soon be using it for ARB_vertex_type_10_10_10_2 support,
which uses D and UD types.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-19 11:38:58 -08:00
Chad Versace
5cf8536690 egl/dri2: Set error code when dri2CreateContextAttribs fails
When dri2CreateContextContextAttribs failed, eglCreateContext returned
NULL yet set the error code to EGL_SUCCESS! The problem was that
eglCreateContext ignored the error code returned by
driCreateContextAttribs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56706
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 08:18:22 -08:00
Chad Versace
243cf7a924 i965: Validate requested GLES context version in brwCreateContext
For GLES1 and GLES2, brwCreateContext neglected to validate the requested
context version received from the DRI layer. If DRI requested an OpenGL
ES2 context with version 3.9, we provided it one.

Before this fix, the switch statement that validated the requested GL
context flavor was an ugly #ifdef copy-paste mess. Instead of reproducing
the copy-past-mess for GLES1 and GLES2, I first refactored it.  Now the
switch statement is readable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 08:17:32 -08:00
Maarten Lankhorst
ddb901fbf4 automake: strip LLVM_CXXFLAGS and LLVM_CPPFLAGS too
It seems that -NDEBUG and other flags might still be leaked through
those variables, so strip those off there as well.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2012-11-19 09:43:29 +01:00
Kenneth Graunke
5cea027341 i965/fs: Properly patch special values during VGRF compaction.
In addition to registers used by instructions, fs_visitor maintains
direct references to certain "special" values used for inputs/outputs.

When I added VGRF compaction, I overlooked these, believing that these
direct references weren't used once instructions were generated.  That
was wrong.  For example, pixel_x/y are used in virtual_grf_interferes(),
which is called by optimization passes and register allocation.

This patch treats all of them as used and patches them after compacting.
While it's not strictly necessary to patch all of them (as some aren't
used after emitting code), it seems safer to simply fix them all.

Fixes oglconform's textureswizzle/advanced.shader.targets, piglit's
glsl-fs-lots-of-tex, and glean's texCombine on pre-Gen6 hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56790
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-17 14:37:16 -08:00
Eric Anholt
3c368bb307 i965/gen4: Respect the VERTEX_PROGRAM_TWO_SIDE vertex program/shader flag.
Fixes piglit "vertex-program-two-side enabled front back" and 4 others.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-17 12:55:54 -08:00
Eric Anholt
94e82b2e6c mesa: Fix linker-assigned varying component counting since 8fb1e4a462
The goal of that change was to skip counting things that aren't actually
outputs from the VS to the FS.  However, explicit_location isn't set in
the case of linker-assigned locations (the common case), so basically
varying component counting got disabled.  At this stage of the linker,
we've already ensured that var->location is set, so we can just look at
it without worrying.

Fixes i965 assertion failure with the new
piglit glsl-max-varyings --exceed-limits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51545
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
5c99697f74 mesa: Fix segfault on reading from a missing color read buffer.
The diff looks funny, but it's moving the integer vs non-integer check
below the _mesa_source_buffer_exists() check that ensures
_ColorReadBuffer is non-null, so we get a GL_INVALID_OPERATION instead
of a segfault.  This looks like it had regressed in the
_mesa_error_check_format_and_type() changes, which removed the first of
the two duplicated checks for the source buffer.  Fixes segfault in the
new piglit ARB_framebuffer_object/negative-readpixels-no-rb.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45877
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
df3361df01 intel: Use core mesa support for determining lastLevel.
We had similar issues with using depth in determining the lastLevel of array
textures.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
02652eaa25 mesa: Also handle GL_TEXTURE_EXTENRAL_OES in max num levels.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
a43b107403 i965/fs: Unify the param pointer allocation for FP/non-FP.
Now that we're using the new backend, we may actually put things into push
constants if you have too many uniform values uploaded.  Also, correctly
account for texture rectangle params and drop the old special case for the
0.0/1.0 params from the old backend.
2012-11-17 12:39:27 -08:00
Maarten Lankhorst
c64adedc5f st/vdpau: Fix vlVdpVideoSurfaceSize for interlaced buffers
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2012-11-17 13:25:08 +01:00
Andreas Boll
a204e26495 docs: import release notes for 9.0.1, add news item 2012-11-17 09:02:03 +01:00
Vinson Lee
acc1e59013 util: Only use open coded snprintf for MSVC.
MinGW has snprintf.

The patch fixes these warnings with the MinGW SCons build.

src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype for ‘util_vsnprintf’ [-Wmissing-prototypes]
src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype for ‘util_snprintf’ [-Wmissing-prototypes]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Brian Paul <brianp@vmware.com>
2012-11-16 23:18:23 -08:00
Tom Stellard
b36b6fdb32 clover: Fix build with clang 3.2 2012-11-16 17:07:56 -05:00
Tom Stellard
71877143b6 r300/compiler: Avoid generating MOV instructions for invalid IMM swizzles v2
If an instruction reads from a constant register that contains
immediates using an invalid swizzle, we can avoid generating MOV
instructions to fix up the swizzle by loading the immediates into a
different constant register that can be read using a valid swizzle.

This only affects r300 and r400 cards.

For example:

CONST[1] = {    -3.5000     3.5000     2.5000     1.5000 }

MAD temp[4].xy, const[0].xy__, const[1].xz__, input[0].xy__;

========== Before this change would be lowered to: =========

CONST[1] = {    -3.5000     3.5000     2.5000     1.5000 }

MOV temp[0].x, const[1].x___;
MOV temp[0].y, const[1]._z__;
MAD temp[4].xy, const[0].xy__, temp[0].xy__, input[0].xy__;

========== After this change is lowered to:  ===============

CONST[1] = {    -3.5000     3.5000     2.5000     1.5000 }
CONST[2] = {     0.0000    -3.5000     2.5000     0.0000 }

MAD temp[4].xy, const[0].xy__, const[2].yz__, input[0].xy__;

============================================================

This change reduces one of the Lightsmark shaders from 133 to 91
instructions.

v2:
  - Fix crash caused by swizzles with only inline constants.
2012-11-16 17:07:11 -05:00
Alex Deucher
26463b8996 radeonsi: clean up some magic numbers
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-16 13:02:42 -05:00
Alex Deucher
ce17964fe5 radeonsi: emit PA_SC_RASTER_CONFIG
Use per asic golden values.

Programming this register doesn't seem to be strictly
necessary on SI, but programming it wrong leads to
rendering issues or reduced performance so just
go ahead and program the golden values explicitly
to avoid any potential problems down the road.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-16 13:02:42 -05:00
Maarten Lankhorst
4f0537e645 [PATCH] makefiles: use configured name for -ldrm* where possible
For precise lts support I had to do some magic with the library names, which works fine
as long as the libraries from pkg-config are used.

The parts with src/gallium/targets/va-*/Makefile will not apply on the master branch,
but do apply to the 9.0 branch.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-11-16 18:50:57 +01:00
Andreas Boll
6346214f05 docs: add note about removal of OpenVMS support 2012-11-16 10:01:47 +01:00
Matt Turner
1f82bf12ed Remove OpenVMS support
Not maintained since 2008. Doubtful that it's worked in quite a while.

Also see commit 32ac8cb05 which removed VMS stuff from Makefile in 2009.

Cc: Jouk Jansen <j.jansen@tudelft.nl>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-11-16 10:01:46 +01:00
Andreas Boll
900f5eb7a8 build: add missing Makefile.in files to tarballs target
Those are recently introduced on master.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-16 10:01:26 +01:00
Andreas Boll
4a38926601 build: fix make tarballs target
fixes regression introduced in 9078441072

Targets for making lex.yy.c program_parse.tab.c and program_parse.tab.h
got moved into its own Makefile

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-16 10:01:06 +01:00
Matt Turner
5c78ad84f4 gles2: Update gl2ext.h to revision 19436
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
88ec004381 gles2: Update gl2.h to revision 16803
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
e565260b30 gles: Update glext.h to revision 19260
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
aec36a10dd egl: Update eglext.h to revision 19571
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
47d862517e mesa: return INVALID_VALUE from WaitSync if timeout != GL_TIMEOUT_IGNORED
This was added in version 22 of the GL_ARB_sync spec.

Fixes gles3conform's sync_error_waitsync_timeout test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
32cc20d9f5 mesa: return INVALID_VALUE from WaitSync if flags != 0
Fixes gles3conform's sync_error_waitsync_flags test.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
5b0012f5c2 mesa: return INVALID_VALUE from ClientWaitSync if flags contains an unsupported flag
Fixes gles3conform's sync_error_clientwaitsync_flags test.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
ae1f09babb mesa: return INVALID_VALUE from VertexAttribDivisor if index out of range
All the other range checks on index already return the proper error,
INVALID_VALUE.

Fixes gles3conform's instanced_arrays_invalid test.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
e21debbf75 glcpp: Don't define macros for extensions that aren't in ES
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Alex Deucher
7bba4879bb radeonsi: remove new asserts and replace with warnings
Fixes piglit regressions.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-15 15:46:02 -05:00
Kenneth Graunke
d010e70a07 i965/fs: Don't calculate_live_intervals() in opt_algebraic().
There's no point: opt_algebraic() doesn't use any liveness information.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:50 -08:00
Kenneth Graunke
b02492fd33 i965: Remove duplicate brw_opcodes table in favor of opcode_descs.
brw_optimize.c's brw_opcodes table was a copy of brw_disasm.c's
opcode_descs table, but with an additional field: is_arith.  Now that
I've deleted that, the two are identical.  Keep the one in brw_disasm.c.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:47 -08:00
Kenneth Graunke
a405717b88 i965/vs: Remove dead vec4_visitor::src_reg_for_float prototype.
No such function exists.  src_reg's constructor does that.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:45 -08:00
Kenneth Graunke
eec5669bc9 i965/fs: Remove bblock field of fs_visitor.
All users of basic block analysis simply create their own local
variables.  Nobody uses the visitor-wide field.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:43 -08:00
Kenneth Graunke
e7668609a7 i965: Remove brw_instruction_info::is_arith().
Nobody uses it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:40 -08:00
Kenneth Graunke
c4b99c1857 i965: Remove some dead code optimization passes.
The old brw_remove_grf_to_mrf_moves() pass is obsolete and replaced by
fs_visitor::compute_to_mrf().

The old brw_remove_duplicate_mrf_moves() pass is obsolete and replaced
by fs_visitor::remove_duplicate_mrf_writes().

The remaining pass, brw_set_dp4_dependency_control(), is currently
unused, but could be, so I'm leaving it for now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:38 -08:00
Kenneth Graunke
1484faa0f4 i965: Remove unused BRW_PACKCOLOR8888 macro.
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:36 -08:00
Kenneth Graunke
80b3af5b6d i965: Remove brw_shader_program wrapper struct.
At this point, it's just gl_shader_program.  Nobody even uses it; even
the program that creates them only returns gl_shader_program pointers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:34 -08:00
Kenneth Graunke
eb18e3d32a i965: Remove unused struct brw_vs_ouput_sizes.
With a name like that, it can't be used.  Sure enough, it's not.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:24 -08:00
José Fonseca
35e28b4583 util/u_debug: Fix DEBUG_NAMED_VALUE.
"#__symbol" doesn't work with nested macro expansions, at least not on gcc.
2012-11-15 17:38:03 +00:00
Roland Scheidegger
94f9ea03a1 draw: fix crashes with out-of-bounds indices
The passthrough pipeline needs to check index values (which might be passed
through) as they can be invalid (which causes crashes and various assertion
failures if the clip code runs). Obviously, rendering won't be well-defined,
but those bogus indices might come directly from apps.
There were already debug printfs which reported the out-of-bounds indices but
we really ought to not crash.
While checking at that point doesn't seem like the most efficient solution,
it seems there isn't really another appropriate function to do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-15 17:37:06 +00:00
Alex Deucher
3893593732 radeonsi: cleanup si_db()
Clean up a few magic numbers and rework the code a bit.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15 12:11:28 -05:00
Alex Deucher
565c29f221 radeonsi: assert the CB format is valid (v2)
Assert the the CB format is valid and default to
the INVALID hw format rather than ~0U when the format
doesn't match for non-debug builds.

v2: use INVALID hw format rather than ~0U

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15 12:10:48 -05:00
Alex Deucher
34d487b64d radeonsi: assert that the DB format is valid (v2)
Assert that the DB format is valid and default to
the INVALID hw format rather than ~0U when the format
doesn't match for non-debug builds.

v2: use INVALID hw format rather than ~0U

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15 12:08:17 -05:00
Dmitry Cherkassov
fd1196c412 gallium: fix some function comments in p_context.h
Signed-off-by: Dmitry Cherkassov <dcherkassov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-15 07:54:38 -07:00
Andreas Boll
8a9f0fdeab build: add missing files to tarballs target
fixes errors ./configure and make was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-14 23:13:34 +01:00
Andreas Boll
bc08f26485 build: add missing Makefile.in files to tarballs target
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-14 23:13:14 +01:00
Andreas Boll
a0a90ea920 build: add config.sub and config.guess to tarballs target
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-14 23:12:58 +01:00
Andreas Boll
ca8988673b mesa: use .cherry-ignore in the get-pick-list.sh script
NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-14 20:45:33 +01:00
Paul Berry
b85a8cd208 mesa: Add .gitignore for hashtable collision unit test.
This test was introduced in commit
35fd61bd99.
2012-11-14 11:23:51 -08:00
Michel Dänzer
73d9703a93 radeonsi: Set STENCILOPVAL fields to 1.
This is necessary for backwards compatibility with pre-SI for stencil.

Fixes a number of stencil related piglit tests, and real apps using stencil.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-14 16:08:34 +01:00
Michel Dänzer
91c1d4472f radeonsi: Bump SI_PM4_MAX_DW.
Fixes assertion failure with Mesa demo glsl/samplers.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-14 12:08:25 +01:00
Michel Dänzer
56ae9be957 radeonsi: Handle TGSI TXL opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-14 12:08:19 +01:00
Michel Dänzer
3e20513b8f radeonsi: Handle TGSI TXB opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-14 12:08:10 +01:00
Vinson Lee
ca5840afb0 mesa: Include compiler.h in hash_table.h.
Include the header for the inline symbol. MSVC does not have the inline
keyword for C.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-13 21:19:50 -08:00
Marek Olšák
186579e724 r600g: use LINEAR_ALIGNED tiling for 1D array textures and if height0 <= 3
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 17:17:05 +01:00
Tom Stellard
2e6b81ff7a auxillary: Append LLVM_CXXFLAGS to CXXFLAGS 2012-11-13 15:13:07 +00:00
Marek Olšák
e3813ecfa3 r300g: don't call buffer_unmap in draw functions
It's been a no-op anyway.
2012-11-13 15:53:17 +01:00
Marek Olšák
7a8affb6a1 r300g: fix crash since the set_vertex_buffers(start_slot) change 2012-11-13 15:53:16 +01:00
Marek Olšák
d4780fddb1 r600g: untiled window-system buffers should be LINEAR_ALIGNED
though I guess the DDX allocates them as LINEAR_GENERAL

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 15:00:37 +01:00
Marek Olšák
c9e5309223 r600g: use LINEAR_ALIGNED tiling for 1D textures
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 15:00:37 +01:00
Marek Olšák
ac4f61b232 r600g: use LINEAR_ALIGNED tiling for staging textures, reorder the code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 15:00:37 +01:00
Kenneth Graunke
fe2ef4b810 i965/vs: Fix user clip plane setup on Gen4-5.
On Gen6-7, we don't compact clip planes, and nr_userclip_plane_consts
is the last bit set, so iterating from i = 0..nr_userclip_plane_consts
covers all active clip planes and is the right thing to do.
works and is the right thing to do.

However, that doesn't work at all on Gen4-5.  Since we don't compact
clip planes, we skip over ones which aren't active (via the continue
statement).  We also set set nr_userclip_plane_consts to the number of
active clip planes, which means that we end the loop after checking that
many bits.  If the set of clip planes wasn't contiguous, this means we'd
fail to find the last few.

By changing the iteration to MAX_CLIP_PLANES, we correctly find all of
the active clip planes.

Fixes regressions since 66c8473e02 (replacing the old VS backend) in
Piglit's spec/glsl-1.20/execution/clipping/fixed-clip-enables and
oglconform's mustpass(basic.clip) and userclip(basic.allCases).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56791
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-13 01:27:33 -08:00
Kenneth Graunke
3262857843 i965/vs: Simplify the Gen6-7 part of setup_uniform_clipplane_values().
There's no compaction, so we can drop that code and simply use 'i'.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-13 01:27:31 -08:00
Kenneth Graunke
0ad4360ca1 i965/vs: Split setup_uniform_clipplane_values() into Gen4-5/6-7 parts.
Since Gen4-5 compacts clip planes and Gen6-7 doesn't, it makes sense to
split them into separate code paths.  This patch simply copies the code
to both halves; the next commits will simplify it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-13 01:27:15 -08:00
Vinson Lee
bb284669f8 mesa: Replace random with standard C rand.
BSD random is not available on some compilers.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-12 22:15:42 -08:00
Brian Paul
9b67460223 automake: Remove empty file variable.
Fixes SCons build regression introduced with commit
a665cf1226.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-11-12 21:29:34 -08:00
Eric Anholt
3a5ad21cd3 mesa: Fix gallium build since 6991c2922f
Looks like I screwed up and didn't test gallium again after tweaking the
Makefile.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57044
2012-11-12 19:35:31 -08:00
Eric Anholt
6991c2922f mesa: Convert the hash table for GL object ids to the open-addressing hash.
The previous 1023-entry chaining hash table never resized, so it was very
inefficient when there were many objects live.  While one could have an even
more efficient implementation than this (keep an array for genned names with
packed IDs, or take advantage of the fact that key == hash or key ==
*(uint32_t *)data to store less data), this is fairly fast, and I want a nice
replacement hash table for other parts of Mesa, too.

It improves Minecraft performance 12.3% +/- 1.4% (n=9), dropping hash lookups
from 8% of the profile to 0.5%.

I also tested cairo-gl, which should be a pessimal workload for this hash
table: around 247000 FBOs created and destroyed, only around 65 live at any
time, and few lookups of them between creation and destruction.  No
statistically significant performance difference at n=76 (mean 20.3/20.4
seconds, sd 2.8/3.2 seconds).  If I remove the >20 seconds outliers that
appear to be due to thermal throttling, there's possibly a .97% +/- 0.31%
performance win (n=61/59).  The choice of cutoff for outliers feels a lot like
cooking the data, but I've gone through this process 3 times for minor
iterations of the code with the same conclusion each time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-12 15:52:43 -08:00
Eric Anholt
35fd61bd99 mesa: Import a copy of the open-addressing hash table code I wrote.
Mesa's chaining hash table for object names is slow, and this should be much
faster.  I namespaced the functions under _mesa_*, to avoid visibility
troubles that we may have had before with hash_table_* functions.

v2: Move .c file to main/, const a few things, clean up loop conditions,
    add/extend some comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-12 15:52:42 -08:00
Eric Anholt
1e8dd15311 automake: Remove libdricore clip.c workaround lib.
sparc/clip.c got moved to sparc/sparc-clip.c to avoid doing this workaround in
the parent directory.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-12 15:52:42 -08:00
Eric Anholt
9078441072 automake,android: Build program/ into a helper lib (v2)
While simplifying mesa/Makefile.am, the more important feature of this commit
is allowing a file with the same name to appear in both main/ and program/.

v2: [chadv] Add changes to Android makefiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com> (v2)
2012-11-12 15:52:42 -08:00
Chad Versace
0ef8535747 android: Moves rules for libmesa_st_mesa to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for libmesa_st_mesa.a from Android.mk to
Android.libmesa_st_mesa.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Chad Versace
7071ffb464 android: Moves rules for libmesa_dricore to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for libmesa_dricore.a from Android.mk to
Android.libmesa_dricore.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Chad Versace
5f935af675 android: Moves rules for mesa_gen_matypes to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for host executable mesa_gen_matypes from
Android.mk to Android.mesa_gen_matypes.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Chad Versace
f2b638a997 android: Moves rules for libmesa_glsl_utils to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for the host and target libmesa_glsl_utils.a
from Android.mk to Android.libmesa_glsl_utils.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Eric Anholt
a665cf1226 automake: Merge *_CXX_FILES variables in the glsl build.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:42 -08:00
Eric Anholt
34d4216e64 automake: Merge per-type *_FILES variables in intel drivers.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:42 -08:00
Eric Anholt
e9e8e194e2 automake: Merge separated *_CXX_FILES variables to *_FILES in core mesa.
They were always used with the corresponding *_FILES variables now that
automake handles rule generation.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:41 -08:00
Eric Anholt
be655ec617 automake: Remove dead *_OBJECTS variables from the old build system.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:41 -08:00
Eric Anholt
906d832db5 automake: Fix a comment typo.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:41 -08:00
Marek Olšák
f5ac60152b r600g: remove redundant parameter in r600_init_surface 2012-11-13 00:34:35 +01:00
Marek Olšák
e7dde5c8fb st/mesa: fix computation of last_level in GenerateMipmap
Array textures were broken.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:31 +01:00
Marek Olšák
6dd839f23a st/mesa: fix computation of last_level during texture creation
Array textures were broken.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:31 +01:00
Marek Olšák
c06258dd02 st/mesa: fix guessing the base level size
It was pretty broken with array textures, where the array size (height or
depth depending on the target) shouldn't be magnified.

The guessing also doesn't fail with 1D and cube textures.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:31 +01:00
Marek Olšák
985f2aec4a mesa: fix error checking of TexStorage(levels) for array and rect textures
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:30 +01:00
Marek Olšák
12a4fd7e45 mesa: use MaxNumlevels in _mesa_test_texobj_completeness
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:30 +01:00
Marek Olšák
8111342e81 mesa: add MaxNumLevels to gl_texture_image, remove MaxLog2
MaxLog2 led to bugs, because it didn't work well with 1D and 3D textures.

NOTE: This is a candidate for the stable branches.

v2: correct the comment at MaxNumlevels

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:36:56 +01:00
Roland Scheidegger
26097c4855 gallivm,draw,llvmpipe: use base ptr + mip offsets instead of mip pointers
This might have a slight overhead but handling mip offsets more like
the width (and image) strides should make some things easier (mip level
being just part of the offset calculation) later.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-12 21:02:59 +01:00
Roland Scheidegger
8257bb963f llvmpipe: always allocate whole miptrees not individual levels
This is preparation work for using mip level offsets + base_ptr for texture
sampling instead of per-mip pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-12 21:02:59 +01:00
Kenneth Graunke
df3cecab7d i965: Add comments for each of the surface state table's columns.
I can never remember what "AB" means, and having to constantly consult
the docs is annoying.  Just add comments to the top which explain each
of the abbreviations.
2012-11-12 11:24:38 -08:00
Paul Berry
21e23fbe21 glapi: Stop handling XML annotation exec="{es,check,loopback}".
Previously, we used these XML annotations to make the code generation
scripts aware of any instances where the Mesa implementation of a
function had a prefix other than "_mesa_".  Now that all of the mesa
implementation functions have been renamed to match the XML, we only
need to handle exec="skip", exec="dynamic", and the default case of
exec="mesa".

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:58 -08:00
Paul Berry
55b81ff56b glapi: Remove handling of mesa_name XML attribute.
Previously, we used the mesa_name XML attribute to make the code
generation scripts aware of any instances where the Mesa
implementation of a function had a different function name suffix than
the primary name in the XML.  Now that all of the Mesa implementation
functions have been renamed to match the XML, this attribute is no
longer necessary.

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Paul Berry
bb3db388d8 mesa: Fix const correctness of API implementation functions.
This patch changes the use of const in the type signatures of
_mesa_ShaderSource() and _mesa_TransformFeedbackVaryings(), to match
the type signatures in the GL spec.  This avoids warnings when
building the code-generated api_exec.c file.

Note: previously we avoided the build warnings because these functions
were being type-checked against ShaderSourceARB and
TransformFeedbackVaryingsEXT; those functions are semantically
equivalent, but have fewer const qualifiers in their type signatures.

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Paul Berry
1a1db1746d mesa: Standardize names of OpenGL functions.
This patch adjusts the aliasing pattern in the GL API description XML,
and the functions that implement the GL API within Mesa, to
consistently follow these naming conventions:

- When several function names are aliases of each other, the primary
  name is the one with no extension suffix (or the name with the
  suffix "ARB", if no unsuffixed name is available).  (By "primary
  name", I mean the name that all the other functions point to using
  the XML "alias" attribute).

- The name of the mesa implementation of each function is the same as
  the primary name, with the prefix "_mesa_".

This patch renames the following mesa functions:
  _check_GetTexGenxvOES => _mesa_GetTexGenxvOES
  _check_TexGenxOES => _mesa_TexGenxOES
  _check_TexGenxvOES => _mesa_TexGenxvOES
  _es_AlphaFuncx => _mesa_AlphaFuncx
  _es_ClearColorx => _mesa_ClearColorx
  _es_ClearDepthx => _mesa_ClearDepthx
  _es_ClipPlanef => _mesa_ClipPlanef
  _es_ClipPlanex => _mesa_ClipPlanex
  _es_Color4x => _mesa_Color4x
  _es_DepthRangex => _mesa_DepthRangex
  _es_DrawTexxOES => _mesa_DrawTexxOES
  _es_DrawTexxvOES => _mesa_DrawTexxvOES
  _es_Fogx => _mesa_Fogx
  _es_Fogxv => _mesa_Fogxv
  _es_Frustumf => _mesa_Frustumf
  _es_Frustumx => _mesa_Frustumx
  _es_GetClipPlanef => _mesa_GetClipPlanef
  _es_GetClipPlanex => _mesa_GetClipPlanex
  _es_GetLightxv => _mesa_GetLightxv
  _es_GetMaterialxv => _mesa_GetMaterialxv
  _es_GetTexEnvxv => _mesa_GetTexEnvxv
  _es_GetTexParameterxv => _mesa_GetTexParameterxv
  _es_LightModelx => _mesa_LightModelx
  _es_LightModelxv => _mesa_LightModelxv
  _es_Lightx => _mesa_Lightx
  _es_Lightxv => _mesa_Lightxv
  _es_LineWidthx => _mesa_LineWidthx
  _es_LoadMatrixx => _mesa_LoadMatrixx
  _es_Materialx => _mesa_Materialx
  _es_Materialxv => _mesa_Materialxv
  _es_MultMatrixx => _mesa_MultMatrixx
  _es_MultiTexCoord4x => _mesa_MultiTexCoord4x
  _es_Normal3x => _mesa_Normal3x
  _es_Orthof => _mesa_Orthof
  _es_Orthox => _mesa_Orthox
  _es_PointParameterx => _mesa_PointParameterx
  _es_PointParameterxv => _mesa_PointParameterxv
  _es_PointSizex => _mesa_PointSizex
  _es_PolygonOffsetx => _mesa_PolygonOffsetx
  _es_QueryMatrixxOES => _mesa_QueryMatrixxOES
  _es_Rotatex => _mesa_Rotatex
  _es_SampleCoveragex => _mesa_SampleCoveragex
  _es_Scalex => _mesa_Scalex
  _es_TexEnvx => _mesa_TexEnvx
  _es_TexEnvxv => _mesa_TexEnvxv
  _es_TexParameterx => _mesa_TexParameterx
  _es_TexParameterxv => _mesa_TexParameterxv
  _es_Translatex => _mesa_Translatex
  _mesa_ActiveTextureARB => _mesa_ActiveTexture
  _mesa_BeginQueryARB => _mesa_BeginQuery
  _mesa_BindAttribLocationARB => _mesa_BindAttribLocation
  _mesa_BindBufferARB => _mesa_BindBuffer
  _mesa_BindFramebufferEXT => _mesa_BindFramebuffer
  _mesa_BindProgram => _mesa_BindProgramARB
  _mesa_BindRenderbufferEXT => _mesa_BindRenderbuffer
  _mesa_BlendEquationSeparateEXT => _mesa_BlendEquationSeparate
  _mesa_BlendEquationSeparatei => _mesa_BlendEquationSeparateiARB
  _mesa_BlendEquationi => _mesa_BlendEquationiARB
  _mesa_BlendFuncSeparateEXT => _mesa_BlendFuncSeparate
  _mesa_BlendFuncSeparatei => _mesa_BlendFuncSeparateiARB
  _mesa_BlendFunci => _mesa_BlendFunciARB
  _mesa_BlitFramebufferEXT => _mesa_BlitFramebuffer
  _mesa_BufferDataARB => _mesa_BufferData
  _mesa_BufferSubDataARB => _mesa_BufferSubData
  _mesa_CheckFramebufferStatusEXT => _mesa_CheckFramebufferStatus
  _mesa_ClampColorARB => _mesa_ClampColor
  _mesa_ClientActiveTextureARB => _mesa_ClientActiveTexture
  _mesa_ColorMaskIndexed => _mesa_ColorMaski
  _mesa_CompileShaderARB => _mesa_CompileShader
  _mesa_CompressedTexImage1DARB => _mesa_CompressedTexImage1D
  _mesa_CompressedTexImage2DARB => _mesa_CompressedTexImage2D
  _mesa_CompressedTexImage3DARB => _mesa_CompressedTexImage3D
  _mesa_CompressedTexSubImage1DARB => _mesa_CompressedTexSubImage1D
  _mesa_CompressedTexSubImage2DARB => _mesa_CompressedTexSubImage2D
  _mesa_CompressedTexSubImage3DARB => _mesa_CompressedTexSubImage3D
  _mesa_DeleteBuffersARB => _mesa_DeleteBuffers
  _mesa_DeleteFramebuffersEXT => _mesa_DeleteFramebuffers
  _mesa_DeletePrograms => _mesa_DeleteProgramsARB
  _mesa_DeleteQueriesARB => _mesa_DeleteQueries
  _mesa_DeleteRenderbuffersEXT => _mesa_DeleteRenderbuffers
  _mesa_DeleteVertexArraysAPPLE => _mesa_DeleteVertexArrays
  _mesa_DisableIndexed => _mesa_Disablei
  _mesa_DisableVertexAttribArrayARB => _mesa_DisableVertexAttribArray
  _mesa_DrawBuffersARB => _mesa_DrawBuffers
  _mesa_DrawTexf => _mesa_DrawTexfOES
  _mesa_DrawTexfv => _mesa_DrawTexfvOES
  _mesa_DrawTexi => _mesa_DrawTexiOES
  _mesa_DrawTexiv => _mesa_DrawTexivOES
  _mesa_DrawTexs => _mesa_DrawTexsOES
  _mesa_DrawTexsv => _mesa_DrawTexsvOES
  _mesa_EnableIndexed => _mesa_Enablei
  _mesa_EnableVertexAttribArrayARB => _mesa_EnableVertexAttribArray
  _mesa_EndQueryARB => _mesa_EndQuery
  _mesa_FogCoordPointerEXT => _mesa_FogCoordPointer
  _mesa_FramebufferRenderbufferEXT => _mesa_FramebufferRenderbuffer
  _mesa_FramebufferTexture1DEXT => _mesa_FramebufferTexture1D
  _mesa_FramebufferTexture2DEXT => _mesa_FramebufferTexture2D
  _mesa_FramebufferTexture3DEXT => _mesa_FramebufferTexture3D
  _mesa_FramebufferTextureLayerEXT => _mesa_FramebufferTextureLayer
  _mesa_GenBuffersARB => _mesa_GenBuffers
  _mesa_GenFramebuffersEXT => _mesa_GenFramebuffers
  _mesa_GenPrograms => _mesa_GenProgramsARB
  _mesa_GenQueriesARB => _mesa_GenQueries
  _mesa_GenRenderbuffersEXT => _mesa_GenRenderbuffers
  _mesa_GenerateMipmapEXT => _mesa_GenerateMipmap
  _mesa_GetActiveAttribARB => _mesa_GetActiveAttrib
  _mesa_GetActiveUniformARB => _mesa_GetActiveUniform
  _mesa_GetAttribLocationARB => _mesa_GetAttribLocation
  _mesa_GetBooleanIndexedv => _mesa_GetBooleani_v
  _mesa_GetBufferParameterivARB => _mesa_GetBufferParameteriv
  _mesa_GetBufferPointervARB => _mesa_GetBufferPointerv
  _mesa_GetBufferSubDataARB => _mesa_GetBufferSubData
  _mesa_GetCompressedTexImageARB => _mesa_GetCompressedTexImage
  _mesa_GetFramebufferAttachmentParameterivEXT => _mesa_GetFramebufferAttachmentParameteriv
  _mesa_GetIntegerIndexedv => _mesa_GetIntegeri_v
  _mesa_GetQueryObjecti64vEXT => _mesa_GetQueryObjecti64v
  _mesa_GetQueryObjectivARB => _mesa_GetQueryObjectiv
  _mesa_GetQueryObjectui64vEXT => _mesa_GetQueryObjectui64v
  _mesa_GetQueryObjectuivARB => _mesa_GetQueryObjectuiv
  _mesa_GetQueryivARB => _mesa_GetQueryiv
  _mesa_GetRenderbufferParameterivEXT => _mesa_GetRenderbufferParameteriv
  _mesa_GetShaderSourceARB => _mesa_GetShaderSource
  _mesa_GetUniformLocationARB => _mesa_GetUniformLocation
  _mesa_GetUniformfvARB => _mesa_GetUniformfv
  _mesa_GetUniformivARB => _mesa_GetUniformiv
  _mesa_GetVertexAttribPointervARB => _mesa_GetVertexAttribPointerv
  _mesa_GetVertexAttribdvARB => _mesa_GetVertexAttribdv
  _mesa_GetVertexAttribfvARB => _mesa_GetVertexAttribfv
  _mesa_GetVertexAttribivARB => _mesa_GetVertexAttribiv
  _mesa_IsBufferARB => _mesa_IsBuffer
  _mesa_IsEnabledIndexed => _mesa_IsEnabledi
  _mesa_IsFramebufferEXT => _mesa_IsFramebuffer
  _mesa_IsQueryARB => _mesa_IsQuery
  _mesa_IsRenderbufferEXT => _mesa_IsRenderbuffer
  _mesa_IsVertexArrayAPPLE => _mesa_IsVertexArray
  _mesa_LinkProgramARB => _mesa_LinkProgram
  _mesa_LoadTransposeMatrixdARB => _mesa_LoadTransposeMatrixd
  _mesa_LoadTransposeMatrixfARB => _mesa_LoadTransposeMatrixf
  _mesa_MapBufferARB => _mesa_MapBuffer
  _mesa_MultTransposeMatrixdARB => _mesa_MultTransposeMatrixd
  _mesa_MultTransposeMatrixfARB => _mesa_MultTransposeMatrixf
  _mesa_MultiDrawArraysEXT => _mesa_MultiDrawArrays
  _mesa_PointSizePointer => _mesa_PointSizePointerOES
  _mesa_ProvokingVertexEXT => _mesa_ProvokingVertex
  _mesa_RenderbufferStorageEXT => _mesa_RenderbufferStorage
  _mesa_SampleCoverageARB => _mesa_SampleCoverage
  _mesa_SecondaryColorPointerEXT => _mesa_SecondaryColorPointer
  _mesa_ShaderSourceARB => _mesa_ShaderSource
  _mesa_Uniform1fARB => _mesa_Uniform1f
  _mesa_Uniform1fvARB => _mesa_Uniform1fv
  _mesa_Uniform1iARB => _mesa_Uniform1i
  _mesa_Uniform1ivARB => _mesa_Uniform1iv
  _mesa_Uniform2fARB => _mesa_Uniform2f
  _mesa_Uniform2fvARB => _mesa_Uniform2fv
  _mesa_Uniform2iARB => _mesa_Uniform2i
  _mesa_Uniform2ivARB => _mesa_Uniform2iv
  _mesa_Uniform3fARB => _mesa_Uniform3f
  _mesa_Uniform3fvARB => _mesa_Uniform3fv
  _mesa_Uniform3iARB => _mesa_Uniform3i
  _mesa_Uniform3ivARB => _mesa_Uniform3iv
  _mesa_Uniform4fARB => _mesa_Uniform4f
  _mesa_Uniform4fvARB => _mesa_Uniform4fv
  _mesa_Uniform4iARB => _mesa_Uniform4i
  _mesa_Uniform4ivARB => _mesa_Uniform4iv
  _mesa_UniformMatrix2fvARB => _mesa_UniformMatrix2fv
  _mesa_UniformMatrix3fvARB => _mesa_UniformMatrix3fv
  _mesa_UniformMatrix4fvARB => _mesa_UniformMatrix4fv
  _mesa_UnmapBufferARB => _mesa_UnmapBuffer
  _mesa_UseProgramObjectARB => _mesa_UseProgram
  _mesa_ValidateProgramARB => _mesa_ValidateProgram
  _mesa_VertexAttribPointerARB => _mesa_VertexAttribPointer
  _mesa_WindowPos2dMESA => _mesa_WindowPos2d
  _mesa_WindowPos2dvMESA => _mesa_WindowPos2dv
  _mesa_WindowPos2fMESA => _mesa_WindowPos2f
  _mesa_WindowPos2fvMESA => _mesa_WindowPos2fv
  _mesa_WindowPos2iMESA => _mesa_WindowPos2i
  _mesa_WindowPos2ivMESA => _mesa_WindowPos2iv
  _mesa_WindowPos2sMESA => _mesa_WindowPos2s
  _mesa_WindowPos2svMESA => _mesa_WindowPos2sv
  _mesa_WindowPos3dMESA => _mesa_WindowPos3d
  _mesa_WindowPos3dvMESA => _mesa_WindowPos3dv
  _mesa_WindowPos3fMESA => _mesa_WindowPos3f
  _mesa_WindowPos3fvMESA => _mesa_WindowPos3fv
  _mesa_WindowPos3iMESA => _mesa_WindowPos3i
  _mesa_WindowPos3ivMESA => _mesa_WindowPos3iv
  _mesa_WindowPos3sMESA => _mesa_WindowPos3s
  _mesa_WindowPos3svMESA => _mesa_WindowPos3sv
  loopback_Color3b_f => _mesa_Color3b
  loopback_Color3bv_f => _mesa_Color3bv
  loopback_Color3d_f => _mesa_Color3d
  loopback_Color3dv_f => _mesa_Color3dv
  loopback_Color3i_f => _mesa_Color3i
  loopback_Color3iv_f => _mesa_Color3iv
  loopback_Color3s_f => _mesa_Color3s
  loopback_Color3sv_f => _mesa_Color3sv
  loopback_Color3ub_f => _mesa_Color3ub
  loopback_Color3ubv_f => _mesa_Color3ubv
  loopback_Color3ui_f => _mesa_Color3ui
  loopback_Color3uiv_f => _mesa_Color3uiv
  loopback_Color3us_f => _mesa_Color3us
  loopback_Color3usv_f => _mesa_Color3usv
  loopback_Color4b_f => _mesa_Color4b
  loopback_Color4bv_f => _mesa_Color4bv
  loopback_Color4d_f => _mesa_Color4d
  loopback_Color4dv_f => _mesa_Color4dv
  loopback_Color4i_f => _mesa_Color4i
  loopback_Color4iv_f => _mesa_Color4iv
  loopback_Color4s_f => _mesa_Color4s
  loopback_Color4sv_f => _mesa_Color4sv
  loopback_Color4ub_f => _mesa_Color4ub
  loopback_Color4ubv_f => _mesa_Color4ubv
  loopback_Color4ui_f => _mesa_Color4ui
  loopback_Color4uiv_f => _mesa_Color4uiv
  loopback_Color4us_f => _mesa_Color4us
  loopback_Color4usv_f => _mesa_Color4usv
  loopback_EdgeFlagv => _mesa_EdgeFlagv
  loopback_EvalCoord1d => _mesa_EvalCoord1d
  loopback_EvalCoord1dv => _mesa_EvalCoord1dv
  loopback_EvalCoord1fv => _mesa_EvalCoord1fv
  loopback_EvalCoord2d => _mesa_EvalCoord2d
  loopback_EvalCoord2dv => _mesa_EvalCoord2dv
  loopback_EvalCoord2fv => _mesa_EvalCoord2fv
  loopback_FogCoorddEXT => _mesa_FogCoordd
  loopback_FogCoorddvEXT => _mesa_FogCoorddv
  loopback_Indexd => _mesa_Indexd
  loopback_Indexdv => _mesa_Indexdv
  loopback_Indexi => _mesa_Indexi
  loopback_Indexiv => _mesa_Indexiv
  loopback_Indexs => _mesa_Indexs
  loopback_Indexsv => _mesa_Indexsv
  loopback_Indexub => _mesa_Indexub
  loopback_Indexubv => _mesa_Indexubv
  loopback_Materialf => _mesa_Materialf
  loopback_Materiali => _mesa_Materiali
  loopback_Materialiv => _mesa_Materialiv
  loopback_MultiTexCoord1dARB => _mesa_MultiTexCoord1d
  loopback_MultiTexCoord1dvARB => _mesa_MultiTexCoord1dv
  loopback_MultiTexCoord1iARB => _mesa_MultiTexCoord1i
  loopback_MultiTexCoord1ivARB => _mesa_MultiTexCoord1iv
  loopback_MultiTexCoord1sARB => _mesa_MultiTexCoord1s
  loopback_MultiTexCoord1svARB => _mesa_MultiTexCoord1sv
  loopback_MultiTexCoord2dARB => _mesa_MultiTexCoord2d
  loopback_MultiTexCoord2dvARB => _mesa_MultiTexCoord2dv
  loopback_MultiTexCoord2iARB => _mesa_MultiTexCoord2i
  loopback_MultiTexCoord2ivARB => _mesa_MultiTexCoord2iv
  loopback_MultiTexCoord2sARB => _mesa_MultiTexCoord2s
  loopback_MultiTexCoord2svARB => _mesa_MultiTexCoord2sv
  loopback_MultiTexCoord3dARB => _mesa_MultiTexCoord3d
  loopback_MultiTexCoord3dvARB => _mesa_MultiTexCoord3dv
  loopback_MultiTexCoord3iARB => _mesa_MultiTexCoord3i
  loopback_MultiTexCoord3ivARB => _mesa_MultiTexCoord3iv
  loopback_MultiTexCoord3sARB => _mesa_MultiTexCoord3s
  loopback_MultiTexCoord3svARB => _mesa_MultiTexCoord3sv
  loopback_MultiTexCoord4dARB => _mesa_MultiTexCoord4d
  loopback_MultiTexCoord4dvARB => _mesa_MultiTexCoord4dv
  loopback_MultiTexCoord4iARB => _mesa_MultiTexCoord4i
  loopback_MultiTexCoord4ivARB => _mesa_MultiTexCoord4iv
  loopback_MultiTexCoord4sARB => _mesa_MultiTexCoord4s
  loopback_MultiTexCoord4svARB => _mesa_MultiTexCoord4sv
  loopback_Normal3b => _mesa_Normal3b
  loopback_Normal3bv => _mesa_Normal3bv
  loopback_Normal3d => _mesa_Normal3d
  loopback_Normal3dv => _mesa_Normal3dv
  loopback_Normal3i => _mesa_Normal3i
  loopback_Normal3iv => _mesa_Normal3iv
  loopback_Normal3s => _mesa_Normal3s
  loopback_Normal3sv => _mesa_Normal3sv
  loopback_Rectd => _mesa_Rectd
  loopback_Rectdv => _mesa_Rectdv
  loopback_Rectfv => _mesa_Rectfv
  loopback_Recti => _mesa_Recti
  loopback_Rectiv => _mesa_Rectiv
  loopback_Rects => _mesa_Rects
  loopback_Rectsv => _mesa_Rectsv
  loopback_SecondaryColor3bEXT_f => _mesa_SecondaryColor3b
  loopback_SecondaryColor3bvEXT_f => _mesa_SecondaryColor3bv
  loopback_SecondaryColor3dEXT_f => _mesa_SecondaryColor3d
  loopback_SecondaryColor3dvEXT_f => _mesa_SecondaryColor3dv
  loopback_SecondaryColor3iEXT_f => _mesa_SecondaryColor3i
  loopback_SecondaryColor3ivEXT_f => _mesa_SecondaryColor3iv
  loopback_SecondaryColor3sEXT_f => _mesa_SecondaryColor3s
  loopback_SecondaryColor3svEXT_f => _mesa_SecondaryColor3sv
  loopback_SecondaryColor3ubEXT_f => _mesa_SecondaryColor3ub
  loopback_SecondaryColor3ubvEXT_f => _mesa_SecondaryColor3ubv
  loopback_SecondaryColor3uiEXT_f => _mesa_SecondaryColor3ui
  loopback_SecondaryColor3uivEXT_f => _mesa_SecondaryColor3uiv
  loopback_SecondaryColor3usEXT_f => _mesa_SecondaryColor3us
  loopback_SecondaryColor3usvEXT_f => _mesa_SecondaryColor3usv
  loopback_TexCoord1d => _mesa_TexCoord1d
  loopback_TexCoord1dv => _mesa_TexCoord1dv
  loopback_TexCoord1i => _mesa_TexCoord1i
  loopback_TexCoord1iv => _mesa_TexCoord1iv
  loopback_TexCoord1s => _mesa_TexCoord1s
  loopback_TexCoord1sv => _mesa_TexCoord1sv
  loopback_TexCoord2d => _mesa_TexCoord2d
  loopback_TexCoord2dv => _mesa_TexCoord2dv
  loopback_TexCoord2i => _mesa_TexCoord2i
  loopback_TexCoord2iv => _mesa_TexCoord2iv
  loopback_TexCoord2s => _mesa_TexCoord2s
  loopback_TexCoord2sv => _mesa_TexCoord2sv
  loopback_TexCoord3d => _mesa_TexCoord3d
  loopback_TexCoord3dv => _mesa_TexCoord3dv
  loopback_TexCoord3i => _mesa_TexCoord3i
  loopback_TexCoord3iv => _mesa_TexCoord3iv
  loopback_TexCoord3s => _mesa_TexCoord3s
  loopback_TexCoord3sv => _mesa_TexCoord3sv
  loopback_TexCoord4d => _mesa_TexCoord4d
  loopback_TexCoord4dv => _mesa_TexCoord4dv
  loopback_TexCoord4i => _mesa_TexCoord4i
  loopback_TexCoord4iv => _mesa_TexCoord4iv
  loopback_TexCoord4s => _mesa_TexCoord4s
  loopback_TexCoord4sv => _mesa_TexCoord4sv
  loopback_Vertex2d => _mesa_Vertex2d
  loopback_Vertex2dv => _mesa_Vertex2dv
  loopback_Vertex2i => _mesa_Vertex2i
  loopback_Vertex2iv => _mesa_Vertex2iv
  loopback_Vertex2s => _mesa_Vertex2s
  loopback_Vertex2sv => _mesa_Vertex2sv
  loopback_Vertex3d => _mesa_Vertex3d
  loopback_Vertex3dv => _mesa_Vertex3dv
  loopback_Vertex3i => _mesa_Vertex3i
  loopback_Vertex3iv => _mesa_Vertex3iv
  loopback_Vertex3s => _mesa_Vertex3s
  loopback_Vertex3sv => _mesa_Vertex3sv
  loopback_Vertex4d => _mesa_Vertex4d
  loopback_Vertex4dv => _mesa_Vertex4dv
  loopback_Vertex4i => _mesa_Vertex4i
  loopback_Vertex4iv => _mesa_Vertex4iv
  loopback_Vertex4s => _mesa_Vertex4s
  loopback_Vertex4sv => _mesa_Vertex4sv
  loopback_VertexAttrib1dARB => _mesa_VertexAttrib1d
  loopback_VertexAttrib1dNV => _mesa_VertexAttrib1dNV
  loopback_VertexAttrib1dvARB => _mesa_VertexAttrib1dv
  loopback_VertexAttrib1dvNV => _mesa_VertexAttrib1dvNV
  loopback_VertexAttrib1sARB => _mesa_VertexAttrib1s
  loopback_VertexAttrib1sNV => _mesa_VertexAttrib1sNV
  loopback_VertexAttrib1svARB => _mesa_VertexAttrib1sv
  loopback_VertexAttrib1svNV => _mesa_VertexAttrib1svNV
  loopback_VertexAttrib2dARB => _mesa_VertexAttrib2d
  loopback_VertexAttrib2dNV => _mesa_VertexAttrib2dNV
  loopback_VertexAttrib2dvARB => _mesa_VertexAttrib2dv
  loopback_VertexAttrib2dvNV => _mesa_VertexAttrib2dvNV
  loopback_VertexAttrib2sARB => _mesa_VertexAttrib2s
  loopback_VertexAttrib2sNV => _mesa_VertexAttrib2sNV
  loopback_VertexAttrib2svARB => _mesa_VertexAttrib2sv
  loopback_VertexAttrib2svNV => _mesa_VertexAttrib2svNV
  loopback_VertexAttrib3dARB => _mesa_VertexAttrib3d
  loopback_VertexAttrib3dNV => _mesa_VertexAttrib3dNV
  loopback_VertexAttrib3dvARB => _mesa_VertexAttrib3dv
  loopback_VertexAttrib3dvNV => _mesa_VertexAttrib3dvNV
  loopback_VertexAttrib3sARB => _mesa_VertexAttrib3s
  loopback_VertexAttrib3sNV => _mesa_VertexAttrib3sNV
  loopback_VertexAttrib3svARB => _mesa_VertexAttrib3sv
  loopback_VertexAttrib3svNV => _mesa_VertexAttrib3svNV
  loopback_VertexAttrib4NbvARB => _mesa_VertexAttrib4Nbv
  loopback_VertexAttrib4NivARB => _mesa_VertexAttrib4Niv
  loopback_VertexAttrib4NsvARB => _mesa_VertexAttrib4Nsv
  loopback_VertexAttrib4NubARB => _mesa_VertexAttrib4Nub
  loopback_VertexAttrib4NubvARB => _mesa_VertexAttrib4Nubv
  loopback_VertexAttrib4NuivARB => _mesa_VertexAttrib4Nuiv
  loopback_VertexAttrib4NusvARB => _mesa_VertexAttrib4Nusv
  loopback_VertexAttrib4bvARB => _mesa_VertexAttrib4bv
  loopback_VertexAttrib4dARB => _mesa_VertexAttrib4d
  loopback_VertexAttrib4dNV => _mesa_VertexAttrib4dNV
  loopback_VertexAttrib4dvARB => _mesa_VertexAttrib4dv
  loopback_VertexAttrib4dvNV => _mesa_VertexAttrib4dvNV
  loopback_VertexAttrib4ivARB => _mesa_VertexAttrib4iv
  loopback_VertexAttrib4sARB => _mesa_VertexAttrib4s
  loopback_VertexAttrib4sNV => _mesa_VertexAttrib4sNV
  loopback_VertexAttrib4svARB => _mesa_VertexAttrib4sv
  loopback_VertexAttrib4svNV => _mesa_VertexAttrib4svNV
  loopback_VertexAttrib4ubNV => _mesa_VertexAttrib4ubNV
  loopback_VertexAttrib4ubvARB => _mesa_VertexAttrib4ubv
  loopback_VertexAttrib4ubvNV => _mesa_VertexAttrib4ubvNV
  loopback_VertexAttrib4uivARB => _mesa_VertexAttrib4uiv
  loopback_VertexAttrib4usvARB => _mesa_VertexAttrib4usv
  loopback_VertexAttribI1iv => _mesa_VertexAttribI1iv
  loopback_VertexAttribI1uiv => _mesa_VertexAttribI1uiv
  loopback_VertexAttribI4bv => _mesa_VertexAttribI4bv
  loopback_VertexAttribI4sv => _mesa_VertexAttribI4sv
  loopback_VertexAttribI4ubv => _mesa_VertexAttribI4ubv
  loopback_VertexAttribI4usv => _mesa_VertexAttribI4usv
  loopback_VertexAttribs1dvNV => _mesa_VertexAttribs1dvNV
  loopback_VertexAttribs1fvNV => _mesa_VertexAttribs1fvNV
  loopback_VertexAttribs1svNV => _mesa_VertexAttribs1svNV
  loopback_VertexAttribs2dvNV => _mesa_VertexAttribs2dvNV
  loopback_VertexAttribs2fvNV => _mesa_VertexAttribs2fvNV
  loopback_VertexAttribs2svNV => _mesa_VertexAttribs2svNV
  loopback_VertexAttribs3dvNV => _mesa_VertexAttribs3dvNV
  loopback_VertexAttribs3fvNV => _mesa_VertexAttribs3fvNV
  loopback_VertexAttribs3svNV => _mesa_VertexAttribs3svNV
  loopback_VertexAttribs4dvNV => _mesa_VertexAttribs4dvNV
  loopback_VertexAttribs4fvNV => _mesa_VertexAttribs4fvNV
  loopback_VertexAttribs4svNV => _mesa_VertexAttribs4svNV
  loopback_VertexAttribs4ubvNV => _mesa_VertexAttribs4ubvNV

And changes the primary name assignment in the XML as follows:
  ActiveTextureARB => ActiveTexture
  AlphaFuncxOES => AlphaFuncx
  BeginConditionalRenderNV => BeginConditionalRender
  BeginQueryARB => BeginQuery
  BeginTransformFeedbackEXT => BeginTransformFeedback
  BindAttribLocationARB => BindAttribLocation
  BindBufferARB => BindBuffer
  BindBufferBaseEXT => BindBufferBase
  BindBufferRangeEXT => BindBufferRange
  BindFragDataLocationEXT => BindFragDataLocation
  BindFramebufferEXT => BindFramebuffer
  BindProgramNV => BindProgramARB
  BindRenderbufferEXT => BindRenderbuffer
  BlendEquationSeparateEXT => BlendEquationSeparate
  BlendFuncSeparateEXT => BlendFuncSeparate
  BlitFramebufferEXT => BlitFramebuffer
  BufferDataARB => BufferData
  BufferSubDataARB => BufferSubData
  CheckFramebufferStatusEXT => CheckFramebufferStatus
  ClampColorARB => ClampColor
  ClearColorxOES => ClearColorx
  ClearDepthxOES => ClearDepthx
  ClientActiveTextureARB => ClientActiveTexture
  ClipPlanefOES => ClipPlanef
  ClipPlanexOES => ClipPlanex
  Color4xOES => Color4x
  ColorMaskIndexedEXT => ColorMaski
  CompileShaderARB => CompileShader
  CompressedTexImage1DARB => CompressedTexImage1D
  CompressedTexImage2DARB => CompressedTexImage2D
  CompressedTexImage3DARB => CompressedTexImage3D
  CompressedTexSubImage1DARB => CompressedTexSubImage1D
  CompressedTexSubImage2DARB => CompressedTexSubImage2D
  CompressedTexSubImage3DARB => CompressedTexSubImage3D
  DeleteBuffersARB => DeleteBuffers
  DeleteFramebuffersEXT => DeleteFramebuffers
  DeleteProgramsNV => DeleteProgramsARB
  DeleteQueriesARB => DeleteQueries
  DeleteRenderbuffersEXT => DeleteRenderbuffers
  DeleteVertexArraysAPPLE => DeleteVertexArrays
  DepthRangexOES => DepthRangex
  DisableIndexedEXT => Disablei
  DisableVertexAttribArrayARB => DisableVertexAttribArray
  DrawBuffersARB => DrawBuffers
  EnableIndexedEXT => Enablei
  EnableVertexAttribArrayARB => EnableVertexAttribArray
  EndConditionalRenderNV => EndConditionalRender
  EndQueryARB => EndQuery
  EndTransformFeedbackEXT => EndTransformFeedback
  FogCoordPointerEXT => FogCoordPointer
  FogCoorddEXT => FogCoordd
  FogCoorddvEXT => FogCoorddv
  FogxOES => Fogx
  FogxvOES => Fogxv
  FramebufferRenderbufferEXT => FramebufferRenderbuffer
  FramebufferTexture1DEXT => FramebufferTexture1D
  FramebufferTexture2DEXT => FramebufferTexture2D
  FramebufferTexture3DEXT => FramebufferTexture3D
  FramebufferTextureLayerEXT => FramebufferTextureLayer
  FrustumfOES => Frustumf
  FrustumxOES => Frustumx
  GenBuffersARB => GenBuffers
  GenFramebuffersEXT => GenFramebuffers
  GenProgramsNV => GenProgramsARB
  GenQueriesARB => GenQueries
  GenRenderbuffersEXT => GenRenderbuffers
  GenerateMipmapEXT => GenerateMipmap
  GetActiveAttribARB => GetActiveAttrib
  GetActiveUniformARB => GetActiveUniform
  GetAttribLocationARB => GetAttribLocation
  GetBooleanIndexedvEXT => GetBooleani_v
  GetBufferParameterivARB => GetBufferParameteriv
  GetBufferPointervARB => GetBufferPointerv
  GetBufferSubDataARB => GetBufferSubData
  GetClipPlanefOES => GetClipPlanef
  GetClipPlanexOES => GetClipPlanex
  GetCompressedTexImageARB => GetCompressedTexImage
  GetFixedvOES => GetFixedv
  GetFragDataLocationEXT => GetFragDataLocation
  GetFramebufferAttachmentParameterivEXT => GetFramebufferAttachmentParameteriv
  GetIntegerIndexedvEXT => GetIntegeri_v
  GetLightxvOES => GetLightxv
  GetMaterialxvOES => GetMaterialxv
  GetQueryObjecti64vEXT => GetQueryObjecti64v
  GetQueryObjectivARB => GetQueryObjectiv
  GetQueryObjectui64vEXT => GetQueryObjectui64v
  GetQueryObjectuivARB => GetQueryObjectuiv
  GetQueryivARB => GetQueryiv
  GetRenderbufferParameterivEXT => GetRenderbufferParameteriv
  GetShaderSourceARB => GetShaderSource
  GetTexEnvxvOES => GetTexEnvxv
  GetTexParameterIivEXT => GetTexParameterIiv
  GetTexParameterIuivEXT => GetTexParameterIuiv
  GetTexParameterxvOES => GetTexParameterxv
  GetTransformFeedbackVaryingEXT => GetTransformFeedbackVarying
  GetUniformLocationARB => GetUniformLocation
  GetUniformfvARB => GetUniformfv
  GetUniformivARB => GetUniformiv
  GetUniformuivEXT => GetUniformuiv
  GetVertexAttribIivEXT => GetVertexAttribIiv
  GetVertexAttribIuivEXT => GetVertexAttribIuiv
  GetVertexAttribPointervNV => GetVertexAttribPointerv
  GetVertexAttribdvARB => GetVertexAttribdv
  GetVertexAttribfvARB => GetVertexAttribfv
  GetVertexAttribivARB => GetVertexAttribiv
  IsBufferARB => IsBuffer
  IsEnabledIndexedEXT => IsEnabledi
  IsFramebufferEXT => IsFramebuffer
  IsProgramNV => IsProgramARB
  IsQueryARB => IsQuery
  IsRenderbufferEXT => IsRenderbuffer
  IsVertexArrayAPPLE => IsVertexArray
  LightModelxOES => LightModelx
  LightModelxvOES => LightModelxv
  LightxOES => Lightx
  LightxvOES => Lightxv
  LineWidthxOES => LineWidthx
  LinkProgramARB => LinkProgram
  LoadMatrixxOES => LoadMatrixx
  LoadTransposeMatrixdARB => LoadTransposeMatrixd
  LoadTransposeMatrixfARB => LoadTransposeMatrixf
  MapBufferARB => MapBuffer
  MaterialxOES => Materialx
  MaterialxvOES => Materialxv
  MultMatrixxOES => MultMatrixx
  MultTransposeMatrixdARB => MultTransposeMatrixd
  MultTransposeMatrixfARB => MultTransposeMatrixf
  MultiDrawArraysEXT => MultiDrawArrays
  MultiTexCoord1dARB => MultiTexCoord1d
  MultiTexCoord1dvARB => MultiTexCoord1dv
  MultiTexCoord1iARB => MultiTexCoord1i
  MultiTexCoord1ivARB => MultiTexCoord1iv
  MultiTexCoord1sARB => MultiTexCoord1s
  MultiTexCoord1svARB => MultiTexCoord1sv
  MultiTexCoord2dARB => MultiTexCoord2d
  MultiTexCoord2dvARB => MultiTexCoord2dv
  MultiTexCoord2iARB => MultiTexCoord2i
  MultiTexCoord2ivARB => MultiTexCoord2iv
  MultiTexCoord2sARB => MultiTexCoord2s
  MultiTexCoord2svARB => MultiTexCoord2sv
  MultiTexCoord3dARB => MultiTexCoord3d
  MultiTexCoord3dvARB => MultiTexCoord3dv
  MultiTexCoord3iARB => MultiTexCoord3i
  MultiTexCoord3ivARB => MultiTexCoord3iv
  MultiTexCoord3sARB => MultiTexCoord3s
  MultiTexCoord3svARB => MultiTexCoord3sv
  MultiTexCoord4dARB => MultiTexCoord4d
  MultiTexCoord4dvARB => MultiTexCoord4dv
  MultiTexCoord4iARB => MultiTexCoord4i
  MultiTexCoord4ivARB => MultiTexCoord4iv
  MultiTexCoord4sARB => MultiTexCoord4s
  MultiTexCoord4svARB => MultiTexCoord4sv
  MultiTexCoord4xOES => MultiTexCoord4x
  Normal3xOES => Normal3x
  OrthofOES => Orthof
  OrthoxOES => Orthox
  PointParameterfEXT => PointParameterf
  PointParameterfvEXT => PointParameterfv
  PointParameteriNV => PointParameteri
  PointParameterivNV => PointParameteriv
  PointParameterxOES => PointParameterx
  PointParameterxvOES => PointParameterxv
  PointSizexOES => PointSizex
  PolygonOffsetxOES => PolygonOffsetx
  PrimitiveRestartIndexNV => PrimitiveRestartIndex
  ProvokingVertexEXT => ProvokingVertex
  RenderbufferStorageEXT => RenderbufferStorage
  RotatexOES => Rotatex
  SampleCoverageARB => SampleCoverage
  SampleCoveragexOES => SampleCoveragex
  ScalexOES => Scalex
  SecondaryColor3bEXT => SecondaryColor3b
  SecondaryColor3bvEXT => SecondaryColor3bv
  SecondaryColor3dEXT => SecondaryColor3d
  SecondaryColor3dvEXT => SecondaryColor3dv
  SecondaryColor3iEXT => SecondaryColor3i
  SecondaryColor3ivEXT => SecondaryColor3iv
  SecondaryColor3sEXT => SecondaryColor3s
  SecondaryColor3svEXT => SecondaryColor3sv
  SecondaryColor3ubEXT => SecondaryColor3ub
  SecondaryColor3ubvEXT => SecondaryColor3ubv
  SecondaryColor3uiEXT => SecondaryColor3ui
  SecondaryColor3uivEXT => SecondaryColor3uiv
  SecondaryColor3usEXT => SecondaryColor3us
  SecondaryColor3usvEXT => SecondaryColor3usv
  SecondaryColorPointerEXT => SecondaryColorPointer
  ShaderSourceARB => ShaderSource
  TexBufferARB => TexBuffer
  TexEnvxOES => TexEnvx
  TexEnvxvOES => TexEnvxv
  TexParameterIivEXT => TexParameterIiv
  TexParameterIuivEXT => TexParameterIuiv
  TexParameterxOES => TexParameterx
  TexParameterxvOES => TexParameterxv
  TransformFeedbackVaryingsEXT => TransformFeedbackVaryings
  TranslatexOES => Translatex
  Uniform1fARB => Uniform1f
  Uniform1fvARB => Uniform1fv
  Uniform1iARB => Uniform1i
  Uniform1ivARB => Uniform1iv
  Uniform1uiEXT => Uniform1ui
  Uniform1uivEXT => Uniform1uiv
  Uniform2fARB => Uniform2f
  Uniform2fvARB => Uniform2fv
  Uniform2iARB => Uniform2i
  Uniform2ivARB => Uniform2iv
  Uniform2uiEXT => Uniform2ui
  Uniform2uivEXT => Uniform2uiv
  Uniform3fARB => Uniform3f
  Uniform3fvARB => Uniform3fv
  Uniform3iARB => Uniform3i
  Uniform3ivARB => Uniform3iv
  Uniform3uiEXT => Uniform3ui
  Uniform3uivEXT => Uniform3uiv
  Uniform4fARB => Uniform4f
  Uniform4fvARB => Uniform4fv
  Uniform4iARB => Uniform4i
  Uniform4ivARB => Uniform4iv
  Uniform4uiEXT => Uniform4ui
  Uniform4uivEXT => Uniform4uiv
  UniformMatrix2fvARB => UniformMatrix2fv
  UniformMatrix3fvARB => UniformMatrix3fv
  UniformMatrix4fvARB => UniformMatrix4fv
  UnmapBufferARB => UnmapBuffer
  UseProgramObjectARB => UseProgram
  ValidateProgramARB => ValidateProgram
  VertexAttrib1dARB => VertexAttrib1d
  VertexAttrib1dvARB => VertexAttrib1dv
  VertexAttrib1sARB => VertexAttrib1s
  VertexAttrib1svARB => VertexAttrib1sv
  VertexAttrib2dARB => VertexAttrib2d
  VertexAttrib2dvARB => VertexAttrib2dv
  VertexAttrib2sARB => VertexAttrib2s
  VertexAttrib2svARB => VertexAttrib2sv
  VertexAttrib3dARB => VertexAttrib3d
  VertexAttrib3dvARB => VertexAttrib3dv
  VertexAttrib3sARB => VertexAttrib3s
  VertexAttrib3svARB => VertexAttrib3sv
  VertexAttrib4NbvARB => VertexAttrib4Nbv
  VertexAttrib4NivARB => VertexAttrib4Niv
  VertexAttrib4NsvARB => VertexAttrib4Nsv
  VertexAttrib4NubARB => VertexAttrib4Nub
  VertexAttrib4NubvARB => VertexAttrib4Nubv
  VertexAttrib4NuivARB => VertexAttrib4Nuiv
  VertexAttrib4NusvARB => VertexAttrib4Nusv
  VertexAttrib4bvARB => VertexAttrib4bv
  VertexAttrib4dARB => VertexAttrib4d
  VertexAttrib4dvARB => VertexAttrib4dv
  VertexAttrib4ivARB => VertexAttrib4iv
  VertexAttrib4sARB => VertexAttrib4s
  VertexAttrib4svARB => VertexAttrib4sv
  VertexAttrib4ubvARB => VertexAttrib4ubv
  VertexAttrib4uivARB => VertexAttrib4uiv
  VertexAttrib4usvARB => VertexAttrib4usv
  VertexAttribDivisorARB => VertexAttribDivisor
  VertexAttribI1ivEXT => VertexAttribI1iv
  VertexAttribI1uivEXT => VertexAttribI1uiv
  VertexAttribI4bvEXT => VertexAttribI4bv
  VertexAttribI4svEXT => VertexAttribI4sv
  VertexAttribI4ubvEXT => VertexAttribI4ubv
  VertexAttribI4usvEXT => VertexAttribI4usv
  VertexAttribIPointerEXT => VertexAttribIPointer
  VertexAttribPointerARB => VertexAttribPointer
  WindowPos2dMESA => WindowPos2d
  WindowPos2dvMESA => WindowPos2dv
  WindowPos2fMESA => WindowPos2f
  WindowPos2fvMESA => WindowPos2fv
  WindowPos2iMESA => WindowPos2i
  WindowPos2ivMESA => WindowPos2iv
  WindowPos2sMESA => WindowPos2s
  WindowPos2svMESA => WindowPos2sv
  WindowPos3dMESA => WindowPos3d
  WindowPos3dvMESA => WindowPos3dv
  WindowPos3fMESA => WindowPos3f
  WindowPos3fvMESA => WindowPos3fv
  WindowPos3iMESA => WindowPos3i
  WindowPos3ivMESA => WindowPos3iv
  WindowPos3sMESA => WindowPos3s
  WindowPos3svMESA => WindowPos3sv

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Michel Dänzer
7708a86464 radeonsi: Implement alpha testing in pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-12 15:45:42 +01:00
Michel Dänzer
e44dfd4b3c radeonsi: Initialize uses_kill boolean from TGSI info.
Fixes discarded pixels incorrectly updating the depth buffer.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-12 15:45:42 +01:00
Vincent Lejeune
557d4918ad glsl: store read vector in a temp in vec_index_to_cond
Vector indexing on matrixes generates several copy of the
constant matrix, for instance vec=mat4[i][j] generates :
vec=mat4[i].x;
vec=(j==1)?mat4[i].y;
vec=(j==2)?mat4[i].z;
vec=(j==3)?mat4[i].w;
In the case of constant matrixes, the mat4[i] expression generates
copy of the 16 elements of the matrix 4 times ; indirect addressing
also prevents some conservative CSE algorithms (like the one in LLVM)
from factoring the mat4[i] expression.
This patch will make the vec_index_to_cond pass generates :
temp = mat4[i];
vec=temp.x;
vec=(j==1)?temp.y;
vec=(j==2)?temp.z;
vec=(j==3)?temp.w;

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-11 22:20:15 +01:00
Marek Olšák
05a2f66cde gallium/u_blitter: handle PIPE_TEXTURE_CUBE_ARRAY in is_box_inside_resource 2012-11-11 13:33:01 +01:00
Andreas Boll
5ecbc3a9e8 build: fix enable/disable language in ./configure --help
Based on patch from Brian Paul.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-10 21:32:09 +01:00
Kenneth Graunke
e639385064 i965: Fix AA Line Distance Mode in 3DSTATE_SF on Ivybridge.
We were accidentally setting bit 14 in DWord 2 (which is Reserved/MBZ)
rather than bit 14 in DWord 3 (which is AA Line Distance Mode).

There's also no reason to ever set it to legacy mode; the bit is only
used when drawing antialiased lines anyway.  Set it unconditionally.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-10 12:14:23 -08:00
Ian Romanick
5581954c3a dri_util: Fix prologue comment for driCreateConfigs
The parameters and operation of this function changed, but I didn't
bother to change the prologue comment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-09 18:38:19 -08:00
Ian Romanick
3ec3201f31 swrast: swrastFillInModes doesn't do 8-bit modes, so don't try
Support for 8-bit modes was removed in commits 0398a26 and bda208a4.
However, I didn't notice code in dri_init_screen that explicitly tries
to create this modes.  This is structurally different from other drivers
(that only create modes that match the display color depth).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56555
Cc: Vinson Lee <vlee@freedesktop.org>
2012-11-09 18:38:19 -08:00
Darren Salt
d2a6dd9a95 Fix use of glsl_parser.{cc,h} where source dir != build dir.
Fixes a regression caused by commit 9948a3365.

https://bugs.freedesktop.org/show_bug.cgi?id=56787
https://bugs.freedesktop.org/show_bug.cgi?id=56685
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-09 16:56:35 -08:00
Brian Paul
2951a9dd51 Revert "mesa: assert that key->fragprog_inputs_read value isn't too large"
This reverts commit 0d61f879a1.

Assigning the FS inputs to the 12 bit field is fine since we don't care
about the higher FS inputs.  Maybe I'll revisit silencing the compiler
warning another day.
2012-11-09 16:31:22 -07:00
Matt Turner
c6f426c02d glcpp: wire up glcpp-test to make check
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
68414bc868 glcpp/tests: Add tests for multiline #elif
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
28e397660c glcpp/tests: Add test for multiline #if
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
b44423cf75 glcpp/tests: Add test for multiline #line
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
c3a15d9a35 glcpp/tests: Add test to check #line followed by code
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51802
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Fabian Bieler
9ad71c44fa glcpp: don't push #line directives into next line
By moving the HASH_LINE rule out of control_line: and into line:, we avoid
adding control_line's additional \n (as seen in the first hunk).

mattst88: Carl and I determined independently of Fabian that the 091
test needed to be modified identically to this, and our patch to fix the
test was more complicated.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
060e696799 glcpp: Reject garbage after #else and #endif tokens
Previously we were accepting garbage after #else and #endif tokens when
the previous preprocessor conditional evaluated to false (eg, #if 0).

When the preprocessor hits a false conditional, it switches the lexer
into the SKIP state, in which it ignores non-control tokens. The parser
pops the SKIP state off the stack when it reaches the associated #elif,
#else, or #endif. Unfortunately, that meant that it only left the SKIP
state after the lexing the entire line containing the #token and thus
would accept garbage after the #token.

To fix this we use a mid-rule, which is executed immediately after the
#token is parsed.

NOTE: This is a candidate for the stable branch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56442
Fixes: preprocess17_frag.test from oglconform
Reviewed-by: Carl Worth <cworth@cworth.org> (glcpp-parse.y)
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Dave Airlie
afcaa03f7e r600g: fix printk warnings
Brian reported seeing:
r600_texture.c: In function ‘r600_texture_create_object’:
r600_texture.c:468:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
r600_texture.c:468:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’
r600_texture.c:485:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
r600_texture.c:485:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’

this should wrap over them fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie
aafdc5bda4 softpipe: fix unused variable warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie
add3a0709f gallium: fix unused cap warnings in drivers for cube map array cap.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie
eb44c36df8 r600g: add initial cube map array support (v2)
This contains the evergreen support.

Support is possible on rv670 upwards and the code in here
should work, but it doesn't and I haven't debugged it to
figure out why.

Beyond just adding support for the cube map array sampling,
r600 resinfo isn't conformant with the GL specification,
which states the number of layers should be returned for
the textureSize, so we have to track in an external
constant buffer the layers for each sampler if we need
them in the shader.

v2: only update the sampler constants if the sampler views have changed,
as suggested by Marek.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:20:46 +10:00
Dave Airlie
e9cf40142d u_blitter: fix cube array check
Pointed out by Marek on irc,

no committing after beer!

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:20:45 +10:00
José Fonseca
5dbc84ecb0 util/u_surface: Support 3D/array textures in util_resource_copy_region().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
c84dd7a940 draw: Remove redundant draw_geometry_shader_delete().
draw_delete_geometry_shader() seems to be the real one.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
dc53e1b410 trace: Support geometry shaders.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
bbb48a4a55 util/u_surface: Fix util_clear_depth_stencil for Z32_FLOAT_S8X24_UINT.
util_pack_z_stencil was being unconditionally invoked for all formats,
causing an assertion failure for Z32_FLOAT_S8X24_UINT.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
49dff2cb05 galahad: Support geometry shader / stream-output methods.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
658b73a246 softpipe,util: Fix blending of R and RG formats.
Alpha is also 1 for formats like R32G32_FLOAT.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
48ce928900 softpipe: Fix rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE.
We must multiply the factor against the destination, not the source.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
e5f0ae0bd8 tgsi: Lift the requirement of indirection being done by ADDR register.
For drivers with native integer / SM4 support this is just an hindrance.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
7e112c604e util: Fix reduction of line adjacency primitives.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
b7283834dc softpipe: Handle adjacency primitives.
Not fully tested.

Based on diagrams from
http://msdn.microsoft.com/en-us/library/windows/desktop/bb205124.aspx#Primitive_Adjacency

v2: Fix based on Brian's feedback.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
5d12c7b755 util/u_rect: Make it C++ safe.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:18 +00:00
Dave Airlie
1d9738dab3 u_blitter: don't create fragment program for cube maps unless supported.
should fix http://bugs.freedesktop.org/56906

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 20:34:23 +10:00
Mario Kleiner
eabbe5c45f mesa: Don't glPopAttrib() GL_POINT_SPRITE_COORD_ORIGIN on < OpenGL-2.0
The GL_POINT_BIT state attribute GL_POINT_SPRITE_COORD_ORIGIN
is only supported on OpenGL-2.0 or later. Prevent glPopAttrib()
from trying to restore it on OpenGL-1.4 implementations which
support GL_ARB_POINT_SPRITE, as otherwise the sequence...

glPushAttrib(GL_POINT_BIT);
glPopAttrib();

throws an GL_INVALID_ENUM error in glPopAttrib().

See also commit f778174ea1

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-08 22:53:54 -08:00
Kenneth Graunke
c299f44782 mesa: Fix glGetVertexAttribI[u]iv now that we have real integer attribs.
Since cf438f5375e242, we store actual integers for the attribute data.
We just need to reinterpret the GLfloat array as a GLint/GLuint array
so we can read the proper data.

Fixes oglconform's glsl-vertex-attrib/basic.VertexAttribI[1234][u]i
subtests (after fixing an unrelated bug in those test cases).

v2: Use the COPY_4V macro to be concise.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com> [v1]
2012-11-08 22:53:54 -08:00
Kenneth Graunke
6ccfa1c543 mesa: Fix typo in glDeleteQueriesARB debug message.
"Deleete" all the extra letters!
2012-11-08 22:53:39 -08:00
Vinson Lee
2aa783318d svga: Fix memory leak in svga_buffer_transfer_map.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-08 21:28:15 -08:00
Dave Airlie
2c8f088132 docs: update with ARB_texture_cube_map_array support
just mention softpipe is done, r600g will come soon.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:58:49 +10:00
Dave Airlie
308a03f1ab u_blitter: add cube map array support.
This adds cube array support to the blitter.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:29:26 +10:00
Dave Airlie
309fda2fb2 softpipe: add ARB_texture_cube_map_array support (v1.1)
This adds support to the softpipe texture sampler and tgsi exec.

In order to handle the extra input to the texture sampling,
I've had to expand the interfaces to take a c1 value for storing
the texture compare value for the TEX2 case.

v1.1: add comments (Brian)

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:29:26 +10:00
Dave Airlie
8c0ccce300 st/mesa: add support for ARB_texture_cube_map_array (v2)
This adds mesa state tracker support for the new extension,
along with glsl->tgsi conversion to use the new opcodes
where appropriate.

v2: fix assert found running textureSize tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:29:13 +10:00
Dave Airlie
c4427ceff7 gallium: add defines/shader opcode for texture cube map array
This just adds the texture target and capability along
with 3 new opcodes required to support this extension.

As this extension requires some texture opcodes with samp + 5 args,
we need to use another src register, this is only required
for TEX, TXL and TXB opcodes to implement this spec.

TEX2 is required for shadow cube map arrays
TXL2 is required for cube map array sampler + explicit lod
TXB2 is required for cube map array sampler + lod bias

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:37 +10:00
Dave Airlie
5b115864d2 mesa: arb_texture_cube_map_array: fix attrib push/pop
fdo9833 piglit test caught this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:37 +10:00
Dave Airlie
4c8750015b glsl: add ARB_texture_cube_map_array support (v2)
This adds all the new builtins + the new sampler types,
and hooks them up if the extension is supported.

v2: fix missing signatures for grad/lod
fix missing textureSize clarifications
fix compare vs starts with usage

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:33 +10:00
Dave Airlie
2c52c0e1ce mesa: add get support for TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
e0e7e29554 mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)
This adds the mesa core + texture + fbo support for the
texture cube map array extension.

v2:
add comment to _mesa_num_tex_faces related to cube map arrays (Brian)
drop wrong comment cut-n-paste (Brian)
fix / 6 maximum check issue (Kenneth)
coalsece some array case statements (Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
5a5a80e021 mesa: add ARB_texture_cube_map_array extension bits
This just adds the bit + extension name.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
d078c4fb92 glapi: add ARB_texture_cube_map_array.
This adds the ARB_texture_cube_map_array enums.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
037b4f8038 r600g: fix lod bias/explicit lod with cube maps.
While developing cube map array support I found that we didn't
support this properly, also piglit didn't test for it at all.

I've submitted a test to piglit to check for this, and this
fixes explicit lod and lod bias with cube maps.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:40 +10:00
Dave Airlie
7356579540 r600g: clarify const buffer numbering and handling
For cube map arrays I'll need another driver private constant
buffer, and looking forward to UBOs. So clean up with some
defines, that can be modified when adding cube map array and ubos
later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:40 +10:00
Eric Anholt
2fcaf4eae8 i965: Fix slow leak of brw->wm.compile_data->store
We were successfully freeing our compile data at context destroy, but until
then we were allocating a new store every compile without freeing it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56019
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-08 14:50:32 -08:00
Eric Anholt
177c82555b i965/fs: Add support for global copy propagation.
It is common for complicated shaders, particularly code-generated ones, to
have a big array of uniforms or attributes, and a prologue in the shader that
dereferences from the big array to more informatively-named local variables.
Then there will be some small control flow operation (like a ? : statement),
and then use of those informatively-named variables.  We were emitting extra
MOVs in these cases, because copy propagation couldn't reach across control
flow.

Instead, implement dataflow analysis on the output of the first copy
propagation pass and re-run it to propagate those extra MOVs out.

On one future Steam release, reduces VS+FS instruction count from 42837 to
41437.  No statistically significant performance difference (n=48), though, at
least at the low resolution I'm running it at.

shader-db results:

total instructions in shared programs: 722170 -> 702545 (-2.72%)
instructions in affected programs:     260618 -> 240993 (-7.53%)

Some shaders do get hurt by up to 2 instructions, because a choice to copy
propagate instead of coalesce or something like that results in a dead write
sticking around.  Given that we already have instances of those instructions
in the affected programs (particularly unigine), we should just improve dead
code elimination to fix the problem.
2012-11-08 14:50:32 -08:00
Dave Airlie
9785ae0973 glsl_to_tgsi: fix dst register for texturing fetches.
I've no idea why there isn't a piglit that triggers this behaviour,
but while enabling TBOs for softpipe and r600g, I noticed all the
integer tests failed. I tracked it back to the TXF returning a float
when it should be returning an int. This fixed it and I haven't
seen any regressions in a full piglit run on softpipe.

http://bugs.freedesktop.org/55010

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 06:05:54 +10:00
Vincent Lejeune
e6b3858c89 r600g: fix pre eg export with llvm
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-08 13:21:57 +01:00
Vinson Lee
4cb8b946d9 i965: Fix assertion in brw_alu3.
Fixes side effect in assertion defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-07 22:54:26 -08:00
Jonas Ådahl
a3b6b2d305 wayland: Destroy frame callback when destroying surface
If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.

This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().

Note: This is a candidate for stable branches.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-11-07 16:13:03 -05:00
Alex Deucher
0b61f0b148 r600g/compute: fix call to r600_bytecode_init
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-07 11:51:16 -05:00
Kenneth Graunke
65faedb0d9 mesa: Remove PROG_EMIT_VERTEX and PROG_END_PRIMITIVE opcodes.
These were only used for geometry shader support back in the days before
the new GLSL compiler.  Future geometry shader support will not use
these.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-07 00:00:46 -08:00
Vinson Lee
57049219f5 svga: Ensure vb_transfer in svga_swtnl_draw_vbo in initialized.
Fixes a uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-06 23:33:00 -08:00
Vinson Lee
5cbc0f0036 scons: Build src/mesa/main/es1_conversion.c for all builds.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-06 23:16:29 -08:00
Fredrik Höglund
f42518962a egl_dri2/x11: Fix eglPostSubBufferNV()
This got broken in commit 0a523a8820.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
2012-11-07 00:51:09 +01:00
Paul Berry
91b828ea74 dispatch: Delete unused init_dispatch functions.
The new code-generated version of _mesa_create_exec_table() populates
the entire dispatch table (except for dynamic functions) by itself; it
no longer calls separate functions to initialize parts of the dispatch
table.  This patch removes those no-longer-needed functions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:46 -08:00
Paul Berry
98874ec30b dispatch: Code generate api_exec.c.
This patch adjusts makefiles to cause src/mesa/main/api_exec.c to be
generated using src/mapi/glapi/gen/gl_genexec.py.  There should be no
functional change.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:45 -08:00
Paul Berry
38a1039a42 glapi/gen: Add code generation script for _mesa_create_exec_table().
This script generates the file api_exec.c, which contains just the
function _mesa_create_exec_table(), based on the XML files in
src/mapi/glapi/gen.

The following XML attributes, in particular, are used:
- "es1" indicates functions that should be available in ES1 contexts.
- "es2" indicates functions that should be available in ES2/ES3
  contexts.
- "exec" indicates which Mesa function should be dispatched to.  E.g.
  if the GL function is glFoo(), then:
  - exec="mesa" (the default) dispatches to _mesa_Foo().
  - exec="check" dispatches to _check_Foo().
  - exec="es" dispatches to _es_Foo().
  - exec="loopback" dispatches to loopback_Foo().
  - exec="skip" or exec="dynamic" causes this function to be skipped;
    either it is not yet supported ("skip"), or its dispatch table
    entry will be dynamically populated based on GL state ("dynamic").
- "desktop" indicates functions that should be available in desktop GL
  (non-ES) contexts.
- "deprecated" indicates functions that should not be available in
  core contexts.
- "mesa_name" indicates functions whose implementation in Mesa has a
  different suffix than the corresponding GL function name.

The generated code looks roughly like this (showing just a single
statement in each block for brevity):

    struct _glapi_table *
    _mesa_create_exec_table(struct gl_context *ctx)
    {
       struct _glapi_table *exec;

       exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
       if (exec == NULL)
          return NULL;

       if (_mesa_is_desktop_gl(ctx)) {
          SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
          SET_BeginQueryARB(exec, _mesa_BeginQueryARB);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES) {
          SET_GetPointerv(exec, _mesa_GetPointerv);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
          SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2) {
          SET_AttachShader(exec, _mesa_AttachShader);
          /* other functions not shown */
       }
       if (ctx->API == API_OPENGL) {
          SET_Accum(exec, _mesa_Accum);
          /* other functions not shown */
       }
       if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
          SET_AlphaFunc(exec, _mesa_AlphaFunc);
          /* other functions not shown */
       }
       if (ctx->API == API_OPENGLES) {
          SET_AlphaFuncxOES(exec, _es_AlphaFuncx);
          /* other functions not shown */
       }

       return exec;
    }

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:45 -08:00
Paul Berry
679df028e7 glapi/gen: handle new XML attributes.
This patch updates gl_XML.py to parse the new XML attributes "exec",
"desktop", "deprecated", and "mesa_name", which will be needed to code
generate _mesa_create_exec_table().

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:44 -08:00
Paul Berry
91b5a741f6 glapi/gen: Gather API version info across aliased functions.
gl_XML.py's gl_function class keeps track of an entry_point_api_map
property that tracks, for each set of aliased functions, which ES1 or
ES2 version the given function name first appeared in.

This patch aggregates that information together across aliased
functions, into an easier-to-use api_map property.

Future patches will use this information when code generating
_mesa_create_exec_table(), to determine which set of dispatch table
entries should be populated based on the API.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:44 -08:00
Paul Berry
ccd872824b glapi/gen: Comment fix.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:44 -08:00
Paul Berry
f7fa946d1d dispatch: Make all API functions non-static.
Some of the functions that we store in the dispatch table are declared
as non-static in their .c files and are inserted into the dispatch
table directly by _mesa_create_exec_table().  Other functions are
declared as static, and are inserted into the dispatch table by a
dedicated function that lives in the same .c file
(e.g. _mesa_loopback_init_api_table() in api_loopback.c).

This patch makes all of these functions non-static, and creates
appropriate prototypes for them, so that in future patches we can
populate the entire dispatch table using a single code-generated
function.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:43 -08:00
Paul Berry
e41d1a4e74 glapi: Annotate XML with function name suffix anomalies.
When the XML lists one or more GL api functions as aliases for another
GL function, the mesa function that implements the functionality is
usually named after the canonical version of the function (the one
that is the target of the aliases).  For example, FogCoordd is listed
as an alias of FogCoorddEXT, and the Mesa function implementing the
functionality is called loopback_FogCoorddEXT.

However, there are exceptions.  For example, Enablei is listed as an
alias of EnableIndexedEXT, but the Mesa function implementing the
functionality is called _mesa_EnableIndexed.

To account for these anomalies, this patch annotates the XML with
"mesa_name" attributes, which describe how to adjust the function name
to find the corresponding Mesa function.

For example:

  <function name="EnableIndexedEXT" mesa_name="-EXT">...</function>
  <function name="IsProgramNV" mesa_name="-NV+ARB">...</function>

means that EnableIndexedEXT is implemented by a Mesa function called
_mesa_EnableIndexed, and IsProgramNV is implemented by a Mesa function
called _mesa_IsProgramARB.

Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine the name of the Mesa function
that should be stored in each dispatch table entry.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:43 -08:00
Paul Berry
4b37fa8581 glapi: Annotate XML with desktop="false" for GLES-only functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped when the API is desktop GL.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:42 -08:00
Paul Berry
3c474657f7 glapi: Annotate XML with exec="{es,check}" for special GLES1 functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to ES-specific implementations.  exec="es" indicates that
the ES-specific implementation has a name beginning with "_es_"
(e.g. _es_QueryMatrixxOES), and exec="check" indicates that the
ES-specific implementation has a name beginning with "_check_"
(e.g. _check_GetTexGenxvOES).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:42 -08:00
Paul Berry
d1b2bd5191 glapi: Annotate XML with exec="loopback" for loopback functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to functions in api_loopback.c.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:42 -08:00
Paul Berry
784d2f303c glapi: Annotate XML with exec="dynamic" for dynamic functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because Mesa dispatches them differently depending on GL
state.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:41 -08:00
Paul Berry
3464bce419 glapi: Annotate XML with exec="skip" for unimplemented functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because they aren't implemented by Mesa.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:41 -08:00
Paul Berry
89a577080f glapi: Annotate XML with deprecated="3.1" for deprecated functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped in core contexts.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:41 -08:00
Paul Berry
11e9d8dd05 glapi: Mark GLX extensions as window_system="glX".
We were already doing this for some GLX extensions, but not others.
This patch makes our use of window_system="glX" consistent.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:40 -08:00
Paul Berry
e70b1a1379 glapi: Use GL_ or GLX_ prefix for all category names.
This patch standardizes the category names used in the glapi XML files
to begin each extension name with the prefix "GL_" or "GLX_".  There
is no functional change, because these category names are not used in
the generated code.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:40 -08:00
Paul Berry
5708e27113 dispatch: Remove a few FEATURE_ES1 conditionals.
This allows the GLES1.1 dispatch sanity test to be run on all builds,
even builds that do not include GLES1 support.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:39 -08:00
Brian Paul
0d61f879a1 mesa: assert that key->fragprog_inputs_read value isn't too large
fragprog_inputs_read is a 12-bit bitfield so check the assigned value.
MSVC warns on the assignment.  Not easy to fix but let's do a sanity check.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
406df38a66 mesa: fix MSVC signed/unsigned warnings in context.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
27d70b7266 mesa: fix MSVC signed/unsigned warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
085d81c370 swrast: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
cb5fb15578 tnl: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
5c05d28a43 mesa: silence MSVC signed/unsigned warning in texgetmage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
0dddf592ed mesa: silence MSVC signed/unsigned warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
15cb1a9029 vbo: use GLuint for numInstances to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
859c387603 mesa: fix signed/unsigned MSVC warnings in fbobject.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
d4e18764c6 mesa: s/GLint/GLuint/ in matrix.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
49cea4d40c mesa: s/int/GLuint/ in get.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
cc6c887cca mesa: fix assorted MSVC conversion warnings in format_pack.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
75f2ccf3a2 st/mesa: change glsl_to_tgsi_visitor from class to struct
To match the declaration in the .h file and silence an MSVC warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
80b3dfa704 st/mesa: add int cast to silence warning
MSVC warns that negating an unsigned value yields an unsigned value.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
ab8c5347f1 glsl: fix signed/unsigned comparision warnings on MSVC
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
78d3cfb5b4 glsl: remove incorrect 'struct' keyword
ir_variable is a class, not a struct.  Fixes an MSVC warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
e9dd5895dd glsl: add 'f' suffix to floats to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
c3466315c0 glsl: change int->unsigned to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Vinson Lee
e87a57843c scons: Require libdrm_radeon 2.4.40.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-05 22:00:01 -08:00
Marek Olšák
428e37c2da r600g: add in-place DB decompression and texturing with DB tiling
The decompression is done in-place and only the compressed tiles are
decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F.

The texture unit is programmed to use non-displayable tiling and depth
ordering of samples, so that it can fetch the texture in the native DB format.

The latest version of the libdrm surface allocator is required for stencil
texturing to work. The old one didn't create the mipmap tree correctly.
We need a separate mipmap tree for stencil, because the stencil mipmap
offsets are not really depth offsets/4.

There are still some known bugs, but this should save some memory and it also
improves performance a little bit in Lightsmark (especially with low
resolutions; tested with Radeon HD 5000).

The DB->CB copy is still used for transfers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-11-06 02:54:16 +01:00
Marek Olšák
c80ceded6f configure.ac: require libdrm_radeon 2.4.40 2012-11-06 02:36:12 +01:00
Marek Olšák
acf438f537 vbo: fix glVertexAttribI* functions
The functions were broken, because they converted ints to floats.
Now we can finally advertise OpenGL 3.0. ;)

In this commit, the vbo module also tracks the type for each attrib
in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT.

The little ugliness is the vertex attribs are declared as floats even though
there may be integer values. The code just copies integer values into them
without any conversion.

This implementation passes the glVertexAttribI piglit test which I am going
to commit in piglit soon. The test covers vertex arrays, immediate mode and
display lists.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: cosmetic changes as suggested by Brian
2012-11-06 01:13:48 +01:00
Anuj Phogat
a196f43596 meta: Remove redundant code in _mesa_meta_GenerateMipmap
Integer textures generate invalid operation in glGenerateMipmap.
So, the code related to integer textures is now redundant.

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-05 10:17:48 -08:00
Anuj Phogat
c0a78d7d7b mesa: Generate invalid operation in glGenerateMipMap for integer textures
Khronos has reached a conclusion and disallowed following texture formats in
glGenerateMipMap():
 (a) ASTC textures
 (b) integer internal formats (e.g., RGBA8UI, RG16I)
 (c) textures with stencil formats (e.g., STENCIL_INDEX8)
 (d) textures with packed depth/stencil formats (e.g, DEPTH24_STENCIL8)

https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9471

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-05 10:17:48 -08:00
José Fonseca
3700bd1158 trace: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
2012-11-05 11:18:07 +00:00
José Fonseca
99c45c5aa4 galahad: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
2012-11-05 11:05:34 +00:00
José Fonseca
f1034e944b util: Make u_framebuffer.h C++ safe. 2012-11-05 10:39:42 +00:00
Eric Anholt
ccbfe3dde9 mesa: Use "non-gen name" more consistently as an error message in GL core.
I used this to help verify that my test was actually testing the paths I
wanted to.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:46 -08:00
Eric Anholt
4fce0230fc mesa: Fix core GL genned-name handling for glBeginQuery().
Fixes piglit gl-3.1/genned-names.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:36 -08:00
Eric Anholt
947d8ff4a7 mesa: Fix the core GL genned-name handling for glBindBufferBase()/Range().
This is part of fixing gl-3.1/genned-names.

v2: Fix a missing return value.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:03 -08:00
Vandrus Zoltán
5ac46da588 i965: Fix oversized initial allocation of the state cache table pointers.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55030
2012-11-04 12:24:13 -08:00
Eric Anholt
3a937daf3f i965: Force border color A to 1 when it's not present in the GL format.
It's usually forced to 1 by the surface format, but sometimes we actually have
alpha present because it's the only format available.

Fixes piglit texwrap bordercolor tests for OpenGL 1.1, GL_EXT_texture_sRGB and
GL_ARB_texture_float.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 12:23:59 -08:00
Eric Anholt
1e08d5452e i965: Fix uploading user vertex arrays with basevertex set.
If the index buffer is full of values like "0 1 2 3", but basevertex is 4, we
need to upload at least vertex data for elements 4 5 6 7.  Whether we also
upload 0 1 2 3 is a question of whether there are VBOs present or not -- see
the code setting start_vertex_bias in brw_draw_upload.c.

Fixes piglit draw-elements*base-vertex user_varrays

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
29a6307e12 i965: Set dirty state for brw_draw_upload.c when num_instances changes.
Otherwise, if we had a set of prims passed in with a num_instances varying
between them, we wouldn't upload enough (or too much!) from user vertex
arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
13170321f6 i965: Remove the vbo_rebase_prims() path.
The brw_draw_upload.c start_vertex_bias code has support for doing the rebase
without rewriting the index buffer by applying a basevertex.  It looks like
vbo_rebase_prims() is not equipped to handle basevertex.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
9864a5b098 i965/fs: Fix a comment in copy propagation.
We haven't been only tracking raw GRF-GRF moves since the constant propagation
merge, and also the extension for source modifiers and uniforms.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
545b59b62a i965/fs: Allow copy-propagation on pull constant load values.
Given that we handle similarly-regioned GRFs registers for our copy
propagation from our UNIFORM file, there's no reason not to allow it.

The shader-db impact is negligible -- +90 instructions total, 2 shaders helped
and 7 hurt (slightly increased register pressure increased spilling), but this
is to prevent regression in other shaders when fixing copy_propagation to
reduce register pressure in the shaders that are hurt here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
cf26b4569a i965/fs: Do dead code elimination just after copy propagation.
If we put the register coalescing in between the two, then we end up with code
sequences involving dead writes that the dead code elimination doesn't know
how to remove.  In place of making dead code elimination smart (which we
should do, too), make it less important for the moment.

shader-db results:

total instructions in shared programs: 722240 -> 721275 (-0.13%)
instructions in affected programs:     50573 -> 49608 (-1.91%)

(no shaders regressed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Lucas Stach
d8988f048f nv50,nvc0: expose ARB_map_buffer_alignment
All HW buffers (also suballocated ones) are already aligned.
Just make sure that also the initial sysram buffers have proper
alignment.
2012-11-04 12:33:38 +01:00
Kenneth Graunke
05882b0d3b i965/fs: Compact the virtual GRF arrays.
During code generation, we create tons of temporary variables, many of
which get immediately killed and are never used.  Later optimization and
analysis passes, such as compute_live_intervals, loop over all the
virtual GRFs.  By compacting them, we can save a lot of overhead.

Reduces compilation time in L4D2's largest fragment shader from 10.2
seconds to 5.2 seconds (50%).  Drops compute_live_variables() from
10-12% of another game's startup time to 8%.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-03 20:28:57 -07:00
Jordan Justen
e3542ea51b dispatch_sanity test: add GL CORE 3.1 test
The function list was generated from glcorearb.h for GL 4.3.

Note that many GL 4.X functions are commented out, and indicate
that they need to be added to Mesa's XML.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
3b64f4b4fb dispatch_sanity test: create common context creation function
We also no longer call _swrast_CreateContext, _tnl_CreateContext
or _swsetup_CreateContext when creating the context.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
83b6a7cdaa dispatch_sanity test: allow newer functions to be set to NOP
If a GL function was introduced in a later GL version than the
context we are testing, then it is okay if it is set to the
_mesa_generic_nop function.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
7e64fe583f dispatch_sanity test: pass ctx to validate_functions/nops
This will allow validate_functions to access ctx->Version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
2ad1b13508 dispatch_sanity test: add version to function list
This will be used by GL CORE contexts to differentiate functions that
can be set to nop from functions that are required for a particular
context version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
4d62cb64a5 mesa: remove unimplemented FramebufferTextureFaceARB
This function can be re-added with an actual implementation
when ARB_geometry_shader4 is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
f625cb580a mesa: remove unimplemented FramebufferTextureARB
This function can be re-added with an actual implementation
when ARB_geometry_shader4 is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
f862be0d7c mesa: disable ProgramParameteri until it is needed
ProgramParameteri will be required for ARB_geometry_shader4
or GLES3. Don't enable this function until either of those
is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
31c03f2f8c glapi: alias ProgramParameteriARB to ProgramParameteri
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
1c3a64793a glapi: move include for ARB_get_program_binary.xml to gl_API.xml
These functions are part in GL 4.3. Moving this will allow
ProgramParameteriARB to alias ProgramParameteri.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
dd6660038e glapi: alias FramebufferTextureARB to FramebufferTexture
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen
9e036966bb mesa shaderapi: don't enable various functions for GL CORE
These EXT_separate_shader_objects function will no longer be
enabled for CORE profiles:
* UseShaderProgramEXT
* ActiveProgramEXT
* CreateShaderProgramEXT

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen
5ae8c9c0ca mesa api_exec: disable StencilFuncSeparateATI for API_OPENGL_CORE
This was mistakenly enabled in a21116f.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen
86d5c28580 mesa api_exec: add comment regarding GetPointerv & CORE profiles
GetPointerv was de-deprecated in 893ddb.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Vincent Lejeune
84b4372132 r600g: make tgsi-to-llvm generates store.pixel* intrinsic for fs
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-02 23:19:11 +01:00
Vincent Lejeune
1feb6b79ab configure.ac: Prevent build of radeon llvm backend with llvm < 3.2
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-02 23:18:16 +01:00
Thierry Reding
c0def90ede android: Update for builtin_stubs.cpp move
This fixes the Android build after the move of builtin_stubs.cpp into
the builtin_compiler subdirectory. This patch is untested.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-02 10:37:03 -07:00
Michel Dänzer
c5c3d2f933 radeonsi: Implement support for vertex shader samplers.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-02 18:27:18 +01:00
Johannes Obermayr
ebf0a96250 glsl: Fix builtin_compiler build by -I $(top_srcdir)/include.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56664
2012-11-02 08:53:31 -07:00
José Fonseca
8ac4b82699 scons: Update for builtin_stubs.cpp
Note this by itself is not enough to fix scons build -- it will fail
until you remove:

   rm -rf build/*/glsl/builtin_compiler

because that node was a filei before, but it will be now a directory.

This also means that bisecting across this change will require wiping
the build directory..
2012-11-02 09:43:42 +00:00
Thierry Reding
9948a33653 build: Don't cross-compile GLSL builtin compiler
The builtin_compiler binary is used during the build process to generate
code for the builtin GLSL functions. Since this binary needs to be run
on the build host, it must not be cross-compiled.

This patch fixes the build system to compile a second version of the
source files and the builtin_compiler binary itself for the build
system. It does so by defining the CC_FOR_BUILD and CXX_FOR_BUILD
variables, which are searched for by the configure script and point to
the location of native C and C++ compilers.

In order for this to work properly, builtin_function.cpp is removed
from BUILT_SOURCES, otherwise the build system would try to generate it
before having had a chance to descend into the builtin_compiler
subdirectory. With the builtin_compiler and glsl_compiler now being
generated at different stages, the build instructions for glsl_compiler
can be simplified a bit.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 18:18:21 -07:00
Brian Paul
8d3fb1be6b libgl-xlib: include glheader.h instead of GL/gl.h to fix build
GL/gl.h doesn't define GLfixed but glapitable.h uses it.
2012-11-01 17:38:42 -06:00
Kenneth Graunke
df8a4001f5 i965: Remove unused variables after removing the old VS backend.
Fixes compiler warnings about unused variables.
2012-11-01 16:13:16 -07:00
Kenneth Graunke
60c008dde6 i965: Remove unnecessary walk through Mesa IR in ProgramStringNotify().
Variable indexing of non-uniform arrays only exists in GLSL.  Likewise,
OPCODE_CAL/OPCODE_RET only existed to try and support GLSL's function
calls.  We don't use Mesa IR for GLSL, and these features are explicitly
disallowed by ARB_vertex_program/ARB_fragment_program and never
generated by ffvertex_prog.c.

Since they'll never happen, there's no need to check for them, which
saves us from walking through all the Mesa IR instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:36 -07:00
Kenneth Graunke
109a97dbd2 i965: Remove VS constant buffer read support from brw_eu_emit.c.
brw_vec4_emit.cpp implements this directly; only the old backend used
the brw_eu_emit.c code.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:34 -07:00
Kenneth Graunke
31c1ea5ed4 i965: Update comment about clipper constants.
The old VS backend doesn't exist, but I believe these still need to be
delivered to the clipper thread.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:32 -07:00
Kenneth Graunke
b68e662e61 i965/vs: Remove brw_vs_compile::constant_map.
It was only used for the old backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:30 -07:00
Kenneth Graunke
ab973403e4 i965/vs: Remove support for the old parameter layout.
Only the old backend used it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:29 -07:00
Kenneth Graunke
4b2457b548 i965/vs: Delete the old vertex shader backend.
It's no longer used for anything.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:26 -07:00
Kenneth Graunke
66c8473e02 i965/vs: Replace brw_vs_emit.c with dumping code into the vec4_visitor.
Rather than having two separate backends, just create a small layer that
translates the subset of Mesa IR used for ARB_vertex_program and fixed
function programs to the Vec4 IR.  This allows us to use the same
optimization passes, code generator, register allocator as for GLSL.

v2: Incorporate Eric's review comments.
- Fix use of uninitialized src_swiz[] values in the SWIZZLE_ZERO/ONE
  case: just initialize it to 0 (.x) since the value doesn't matter
  (those channels get writemasked out anyway).
- Properly reswizzle source register's swizzles, rather than overwriting
  the swizzle.
- Port the old brw_vs_emit code for computing .x of the EXP2 opcode.
- Update comments, removing mention of NV_vertex_program, etc.
- Delete remaining #warning lines and debug comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:23 -07:00
Kenneth Graunke
1f0093720d i965/vs: Refactor min/max handling to share code.
v2: Properly use "conditionalmod" pre-Gen6, rather than the incorrectly
copy-and-pasted "BRW_CONDITIONAL_G".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:21 -07:00
Kenneth Graunke
fd8655aa7a i965/vs: Add support for emitting DPH opcodes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:19 -07:00
Kenneth Graunke
6bc021bc78 i965/vs: Only do INTEL_DEBUG=perf when there's a GLSL shader.
This will become necessary once we start supporting ARB programs and
fixed function in this backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:12 -07:00
Paul Berry
a8ab7e335d dispatch: stop generating separate GLES1 API code.
This patch removes the generated files api_exec_es1.c,
api_exec_es1_dispatch.h, and api_exec_es1_remap_helper.h (and the
source files and build rules used to generate them), since they are no
longer used.  GLES1 now uses the same dispatch table layout as all the
other APIs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 11:26:30 -07:00
Paul Berry
8386088e3d dispatch: stop using _mesa_create_exec_table_es1() for GLES1.
This patch modifies context creation code for GLES1 to use
_mesa_create_exec_table() (which is used for all other APIs) instead
of the GLES1-specific _mesa_create_exec_table_es1().

There is a slight change in functionality.  As a result of a mistake
in the code generation of _mesa_create_exec_table_es1(), it does not
include glFlushMappedBufferRangeEXT or glMapBufferRangeEXT (this is
because when support for those two functions was added in commit
762d9ac, src/mesa/main/APIspec.xml wasn't updated).  With this patch,
glFlushMappedBufferRangeEXT and glMapBufferRangeEXT are properly
included in the dispatch table.  Accordingly, dispatch_sanity.cpp is
modified to expect these two functions to be present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Leave GLES1.1 dispatch sanity test disabled when not building
GLES1 support.
2012-11-01 11:26:07 -07:00
Paul Berry
a21116f87e dispatch: GLES1 fixes for _mesa_create_exec_table().
Currently, _mesa_create_exec_table() (in api_exec.c) is used for all
APIs except GLES1.  In GLES1, _mesa_create_exec_table_es1() (a code
generated function) is used instead.

In principle, this shouldn't be necessary.  It should be possible for
api_exec.c to contain the logic for populating the dispatch table for
all API's.

This patch paves the way for using _mesa_create_exec_table() instead
of _mesa_create_exec_table_es1(), by making _mesa_create_exec_table()
(and the functions it calls) expose the correct subset of desktop GL
functions for GLES1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 11:25:27 -07:00
Paul Berry
5a1b40acf5 dispatch: Make a header to go along with querymatrix.c.
This patch creates a header querymatrix.h, to allow functions defined
in querymatrix.c to be used from other .c files.  It also switches
from the nonstandard GL_APIENTRY to GLAPIENTRY.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Don't declare _mesa_Get{Integer,Float}v in querymatrix.c.
Instead, just include main/get.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:25:14 -07:00
Paul Berry
b60244cfb9 dispatch: Add standard boilerplate and GL_APIENTRY to es1_conversion.h.
This patch adds the usual boilerplate (copyright notice and guards
against redundant inclusion) to es1_conversion.h.  It also moves the
definition of GL_APIENTRY from es1_conversion.c.

This allows es1_conversion.h to be safely included from other .c files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Use copyright notice from src/mesa/main/es_generator.py (the
script that used to generate this file).
2012-11-01 11:24:57 -07:00
Paul Berry
dd3218d73b dispatch: Include GLES1-only functions in dispatch table.
Previously dispatch table-related code was generated from gl_API.xml,
so it did not include slots for GLES1-only functions (such as those
taking fixed-point arguments).

This patch generates dispatch table-related code from
gl_and_es_API.xml, so that GLES1-only functions are included.  This
paves the way for future patches that will unify the GLES1 dispatch
table with the dispatch tables for the other APIs.

The following generated files are affected:
- glapi_x86.S
- glapi_x86-64.S
- glapi_sparc.S
- glprocs.h
- glapitemp.h
- glapitable.h
- glapi_gentable.c
- dispatch.h
- remap_helper.h

Since this change affects makefiles, a full rebuild is required.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Adjust dependencies to ensure that generated files will be rebuilt
whenever any ES-related XML source files are changed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:23:22 -07:00
Paul Berry
571d5c353a dispatch: properly handle parameter name mismatches in glapitemp.h.
Previously, when code-generating aliased functions in glapitemp.h, we
weren't consistent about which function alias we used to obtain the
parameter names, with the risk that we would generate incorrect code
like this:

  KEYWORD1 void KEYWORD2 NAME(Foo)(GLint x)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFoo(%d);\n", x));
  }
  KEYWORD1 void KEYWORD2 NAME(FooEXT)(GLint y)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFooEXT(%d);\n", x));
  }

At the moment there are no aliased functions with mismatched parameter
names, so this isn't the problem.  But when we introduce GLES1
functions into the dispatch table, there will be
(MapBufferRange/MapBufferRangeEXT).  This patch paves the way for that
by fixing the code generation script to handle the mismatch correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:49 -07:00
Paul Berry
33e0004720 dispatch: Include glheader.h in dispatch-related files.
This ensures that GLES1-only typedefs are available in these files.
In a future patch, this will allow us to expand the dispatch table to
include GLES1-only functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:24 -07:00
Paul Berry
47deaf6175 dispatch: Update check_table.cpp to reflect recent aliasing changes.
In commits bad96f6 and e7dd2e5 I added the following aliases:
- ClampColor -> ClampColorARB
- VertexAttribDivisor -> VertexAttribDivisorARB

But I neglected to update check_table.cpp, causing "make check" to
fail for non-shared-glapi builds.

This patch removes the functions that are now aliased from
check_table.cpp, so that "make check" works correctly again.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:09 -07:00
Eric Anholt
56f8ed4c35 i965/gen4: Fix assertion failures in depthstencil piglit tests.
Don't forget to set depth_mt even if !hiz_mt.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 09:22:09 -07:00
Kenneth Graunke
b57d2dfbf6 i965: Add "alpha to coverage" to performance debug recompile messages.
This was missing and got labeled "Something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-31 19:54:36 -07:00
Kenneth Graunke
369419e847 i965: Don't replicate data for zero-stride arrays when copying to VBOs.
When copy_array_to_vbo_array encountered an array with src_stride == 0
and dst_stride != 0, we would replicate out the single element to the
whole size (max - min + 1).  This is unnecessary: we can simply upload
one copy and set the buffer's stride to 0.

Decreases vertex upload overhead in an upcoming Steam for Linux title.
Prior to this patch, copy_array_to_vbo_array appeared very high in the
profile (Eric quoted 20%).  After the patch, it disappeared completely.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 19:54:36 -07:00
Kenneth Graunke
3d2b4291c2 i965: Don't bother trying to extend the current vertex buffers.
This essentially reverts the following:

  commit c625aa19cb
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Fri Feb 18 10:37:43 2011 +0000

      intel: extend current vertex buffers

While working on optimizing an upcoming Steam title, I broke this code.
Eric expressed his doubts about this optimization, and noted that the
original commit offered no performance data.

I ran before and after benchmarks on Xonotic and Citybench, and found
that this code made no difference.  So, remove it to reduce complexity
and make future work simpler.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-31 19:54:36 -07:00
Marek Olšák
1eedebc65b r600g: re-enable handling of DISCARD_RANGE, improving performance
It seems to work for me now. Even the graphics corruption is gone.

This also boosts performance in Reaction Quake.
2012-11-01 03:17:58 +01:00
Marek Olšák
fa58644855 r600g: fix abysmal performance in Reaction Quake
The problem was we set VRAM|GTT for relocations of STATIC resources.
Setting just VRAM increases the framerate 4 times on my machine.

I rewrote the switch statement and adjusted the domains for window
framebuffers too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-11-01 03:17:58 +01:00
Marek Olšák
4cf6acc3d0 gallium/u_vbuf: document how it works 2012-11-01 03:17:58 +01:00
Marek Olšák
46b0893fb9 gallium/u_vbuf: optimize looping over the list of buffers to upload 2012-11-01 03:17:58 +01:00
Marek Olšák
a97b053fdd gallium/u_vbuf: skip processing of buffers unused by the vertex element state 2012-11-01 03:17:58 +01:00
Brian Paul
fc2cf14038 swrast: remove explicit size from texfetch_funcs array
By removing the array size, the static assertion to check for missing
elements can do its job properly.  This will catch cases where a new
Mesa format is added but the swrast texfetch code isn't updated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 13:37:11 -06:00
José Fonseca
f69fc36127 llvmpipe: Obey back writemask.
Tested with a modified glean tstencil2 test.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 16:50:40 +00:00
Jerome Glisse
470952f751 r600g: avoid shader needing too many gpr to lockup the gpu v2
On r6xx/r7xx shader resource management need to make sure that the
shader does not goes over the gpr register limit. Each specific
asic has a maxmimum register that can be split btw shader stage.
For each stage the shader must not use more register than the
limit programmed.

v2: Print an error message when discarding draw. Don't add another
    boolean to context structure, but rather propagate the discard
    boolean through the call chain.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-10-31 10:49:15 -04:00
Marek Olšák
183e122bdf draw: fix assertion failure in draw_emit_vertex_attr
This is a regression since b3921e1f53.

The array stores VS outputs, not FS inputs.
Now llvmpipe can do 32 varyings too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 02:06:11 +01:00
Marek Olšák
91107a3522 r600g: use SQ_VTX_SEMANTIC_CLEAR to clear the semantic registers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-31 02:06:11 +01:00
Marek Olšák
d6600f9d39 mesa: remove NV_read_buffer extension enable flag
It's been enabled by default, so the flag isn't really useful.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 02:05:12 +01:00
Marek Olšák
b8380e54b8 mesa: remove SGIS_texture_lod extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:05:11 +01:00
Marek Olšák
01f0bedc2d mesa: remove NV_texgen_reflection extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
7857dbeb17 mesa: remove NV_light_max_exponent extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
cc07149276 mesa: remove IBM_rasterpos_clip extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
f5543d6eb2 mesa: remove IBM_multimode_draw_arrays extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
271b6aeccd mesa: remove APPLE_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
55bf57dbb4 mesa: don't always enable OES_standard_derivatives
For Intel, expose it only if gen >= 4.
For Gallium, expose it only if PIPE_CAP_SM3 is advertised.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
b6f5c37ac3 mesa: move EXT_texture3D enabling to _mesa_init_extensions 2012-10-31 02:04:16 +01:00
Marek Olšák
2266b1df23 mesa: remove EXT_separate_specular_color extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:26 +01:00
Marek Olšák
39a0223a87 mesa: remove EXT_rescale_normal extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:23 +01:00
Marek Olšák
6f5fc612f3 mesa: remove EXT_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:21 +01:00
Marek Olšák
57b00c85b1 mesa: remove EXT_draw_range_elements extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:19 +01:00
Marek Olšák
cf9acc3833 mesa: remove EXT_compiled_vertex_array extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:17 +01:00
Marek Olšák
1301f91b31 mesa: remove ARB_window_pos extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:15 +01:00
Marek Olšák
d012e6d8fe mesa: remove ARB_transpose_matrix extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:12 +01:00
Marek Olšák
3bba7c5ab4 mesa: remove ARB_copy_buffer extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:57:25 +01:00
Marek Olšák
c9f2af3df7 gallium: expose ARB_map_buffer_alignment on Radeon
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: update relnotes-9.1
v3: use align_malloc and align_free for malloced buffers in r300g
v4: document the new CAP in the docs
2012-10-31 01:53:50 +01:00
Marek Olšák
f2f782d50f mesa: implement ARB_map_buffer_alignment
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:48:40 +01:00
Marek Olšák
0ebd0b78c6 st/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:44:58 +01:00
Marek Olšák
c0c26ddaef r600g: use better sample positions for 8x MSAA
Taken from the intel driver. The sample positions are actually a solution
to the 8 queens puzzle.  It gives more accurate and smoother AA.
2012-10-31 00:55:23 +01:00
Marek Olšák
e73bf3b805 gallium: add start_slot parameter to set_vertex_buffers
This allows updating only a subrange of buffer bindings.

set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that
range. Binding NULL resources unbinds buffers too (both buffer and user_buffer
must be NULL).

The meta ops are adapted to only save, change, and restore the single slot
they use. The cso_context can save and restore only one vertex buffer slot.
The clients can query which one it is using cso_get_aux_vertex_buffer_slot.
It's currently set to 0. (the Draw module breaks if it's set to non-zero)

It should decrease the CPU overhead when using a lot of meta ops, but
the drivers must be able to treat each vertex buffer slot as a separate
state (only r600g does so at the moment).

I can imagine this also being useful for optimizing some OpenGL use cases.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 00:55:13 +01:00
Marvin Schmidt
a7c5be098a st/xorg: Remove superfluous miInitializeBackingStore() call
It was defined as an empty function since Nov 2010 and was ultimately
removed completely.

See xserver commit 1cb0261

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-10-30 11:36:31 +01:00
Vinson Lee
0a66ced8f8 xlib: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-29 22:25:56 -07:00
Brian Paul
aab0ea9352 mesa: remove array size so the static assert can work
With the explit NUM_TEXTURE_TARGETS array size, the assertion that
Elements(targets) == NUM_TEXTURE_TARGETS would pass even if elements
were missing.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-29 17:56:05 -06:00
Brian Paul
1e46d810c8 mesa: use GLuint for more gl_constants fields
To silence assorted MSVC warnings.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul
ec5341800b vbo: silence MSVC double/float conversion warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul
f6c83e1661 mesa: silence some MSVC conversion warnings in get.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul
06bb81f01d mesa: silence MSVC signed/unsigned comparision warnings in hash_table.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
8e45e38512 mesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
03503daa21 mesa: silence MSVC signed/unsigned comparision warnings in accum.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
db0136ae3e mesa: silence MSVC signed/unsigned comparison warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
298d7a20e1 mesa: silence MSVC double/float assignment warnings in pixel unpack code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Vincent Lejeune
5ab82e0ccf r600g: tgsi-to-llvm emits right input intrinsics
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-30 00:28:42 +01:00
Tapani Pälli
e4e3b07181 intel: support for 16 bit config with 24 depth and 8 stencil
Patch adds additional singlesample config with 565 color buffer,
24 bit depth and 8 bit stencil buffer. This makes Quadrant benchmark
work on Android. Tested with Sandybridge and Ivybridge machines.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 11:58:47 -07:00
Ian Romanick
e8f2bec25e dri: Support MESA_FORMAT_SARGB8 in driCreateConfigs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:56 -07:00
Ian Romanick
749ac8b73a intel: If the visual is sRGB, use an sRGB internal format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:53 -07:00
Ian Romanick
1f6e10f67b dri: Convert driCreateConfigs to use a gl_format enum
This is instead of the pair of GLenums for format and type that were
previously used.  This is necessary for the Intel drivers to expose sRGB
framebuffer formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 09:55:42 -07:00
Ian Romanick
43d6fe156b dri_util: Elminiate the bytes_per_pixel table
With fewer formats to support, it's kind of useless.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:38 -07:00
Ian Romanick
bda208a4d4 dri_util: Remove support for RGB332 framebuffers
None of the remaining DRI drivers in Mesa use this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:32 -07:00
Ian Romanick
0398a26097 swrast: Remove the 2_3_3_REV framebuffer format
There is no gl_format in Mesa that corresponds to this arrangement, so I
have a very hard time believing that this works.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:27 -07:00
Ian Romanick
386282b5c2 glx: Add the extension string for GLX_ARB_framebuffer_sRGB
From the GLX perspective, the ARB and EXT extensions are identical.  Use
a single bit for both.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:23 -07:00
Ian Romanick
7b0f912e70 glx: Set sRGBCapable to a default value
Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:15 -07:00
Bryan Cain
170f0459a2 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-29 15:49:00 +01:00
Marek Olšák
96ed6c90ef r600g: implement texturing with 8x MSAA compressed surfaces for Evergreen
The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns
garbage there.

The 8x MSAA case is broken on Cayman, though at least the result looks somewhat
correct.

Only the 8x MSAA case works on Evergreen and is enabled.
2012-10-29 12:51:41 +01:00
Marek Olšák
b3921e1f53 mesa: bump MAX_VARYING to 32
We're starting to get apps utilizing more than 16 varyings and
most current hardware supports 32 anyway.

Tested with r600g.
swrast, softpipe and llvmpipe still advertise 16 varyings.

This fixes a WebGL crash after launching this demo:
https://developer.mozilla.org/en-US/demos/detail/falling-cubes

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

NOTE: This is a candidate for the stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 12:51:41 +01:00
Andreas Boll
00e6819e99 Revert "glsl_to_tgsi: set correct register type for array and structure elements"
This reverts commit ebd8df7a31.

accidentally pushed.
2012-10-29 12:21:07 +01:00
Vinson Lee
d37ae64203 scons: Add -fno-rtti to CXXFLAGS with llvm-3.2.
llvm-3.2svn r166772 no longer requires RTTI for lib/Support.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-10-28 11:31:25 -07:00
Christoph Bumiller
9ae7d8bb79 nv50/ir: restore use of long immediate encodings
NOTE: This is a candidate for the 9.0 branch.
2012-10-28 14:57:20 +01:00
Christoph Bumiller
351d3c59f2 nv50,nvc0: fix 2d engine stencil-only copies 2012-10-28 14:25:56 +01:00
Alexander V. Nikolaev
eaa8e56108 gallium/gallivm: code generation options for LLVM 3.1+
LLVM 3.1+ haven't more "extern unsigned llvm::StackAlignmentOverride"
and friends for configuring code generation options, like stack
alignment.

So I restrict assiging of lvm::StackAlignmentOverride and other
variables to LLVM 3.0 only, and wrote similiar code using
TargetOptions.

This patch fix segfaulting of WINE using llvmpipe built with LLVM 3.1

Signed-off-by: Alexander V. Nikolaev <avn@daemon.hole.ru>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-10-28 10:34:26 +00:00
Eric Anholt
459b28aba7 i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().
This is a leftover from when we had to split those two functions due to
the separate BO validation step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:54 -07:00
Eric Anholt
99dc870613 i965: Rename misleading "active" field of brw->query.
"Active" is an already-used term for the query being between
glBeginQuery() and glEndQuery(), while this is tracking whether the
start of the packet pair for emitting state has been inserted into the
current batchbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:01 -07:00
Marek Olšák
b78b62497f r600g: advertise 32 streamout vec4 outputs
to match the varying limit.
2012-10-26 19:01:16 +02:00
Brian Paul
80bc3206aa softpipe: remove extraneous whitespace 2012-10-26 10:59:29 -06:00
Brian Paul
369b5a311c gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Use the PRIx64 and PRIu64 format macros from inttypes.h.  We made a
similar change in prog_print.c in df2d81ea59.
2012-10-26 10:59:29 -06:00
Marek Olšák
8b63512be0 r600g: advertise 32 fragment shaders inputs, not 34 2012-10-26 18:01:14 +02:00
José Fonseca
8eb2b331ef graw/fs-test: Use user constant buffers.
Much simpler. More interesting.
2012-10-26 16:02:59 +01:00
José Fonseca
ce10624e9e trace: Flush before drawing. 2012-10-26 16:02:59 +01:00
José Fonseca
91332e455a graw: Ensure new members are zeroed.
Several new state members were added, and they were not being zeroed,
causing random crashes.
2012-10-26 16:02:59 +01:00
José Fonseca
2532f0d063 tests/graw: Update occlusion query example. 2012-10-26 16:02:58 +01:00
Michel Dänzer
97078b198d radeonsi: Handle TGSI_SEMANTIC_FACE.
Fixes two piglit tests using gl_FrontFacing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:18 +02:00
Michel Dänzer
691f08dbea radeonsi: Handle TGSI_SEMANTIC_BCOLOR.
Put the back face colour right after the front face colour in the LDS parameter
space.

Fixes 18 piglit tests related to two sided lighting.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer
44ef033c25 radeonsi: Don't snoop context state while building shaders.
Let's use the shader key describing the state.

Ported from r600g commit b652180107.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer
f3257d80b0 radeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Alex Deucher
bd274eb8f4 r600g: split cayman common state out into a shared function
And use it for compute.  This should improve compute support
on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:32 -04:00
Alex Deucher
67c875117c r600g: emit some additional regs on cayman
These are common to both evergreen and cayman, but were
not emitted on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:06 -04:00
Alex Deucher
d781f0c73c r600g: there are 16 const buffer size regs for each shader stage
we were previously only setting 8 of them.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:55 -04:00
Alex Deucher
20d268b350 r600g: rework evergreen_init_common_regs()
Move gfx specific bits out as the code is shared with
compute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:40 -04:00
Alex Deucher
480e146305 r600g/compute: always CONTEXT_CONTROL packet at start of CS
It's required.  The CP uses this to properly allocate new
contexts.  Also do a CS partial flush since we are updating
CONFIG regs which are single state.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:33 -04:00
José Fonseca
4a93414985 tools/trace: More helpful message when no args are provided. 2012-10-26 10:50:48 +01:00
José Fonseca
54536686b2 scons: Build xlib swrast too.
Helpful for debugging.
2012-10-26 10:50:48 +01:00
Christian König
59d4bc8c48 vl: fix the dri winsys helper screen init
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-26 09:53:04 +02:00
Vinson Lee
8cb2a4a7f5 tests: Use printf instead of debug_printf in u_format_compatible_test.
Use printf instead of debug_printf to be consistent with print
statements in rest of unit tests.

This also fixes the lack of print output with the MinGW build of
u_format_compatible_test.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 23:09:59 -07:00
Marek Olšák
8fb4b1dce1 r300g: fix texture border color for sRGB formats
NOTE: This is a candidate for the stable branches.
2012-10-26 01:27:05 +02:00
Kenneth Graunke
b45a68eebf glsl: Allow ir_if in the linker's move_non_declarations function.
Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements.  For example,

   float foo = some_boolean ? 0.0 : 1.0;

becomes:

   (declare (temporary) float conditional_tmp)
   (if (var_ref some_boolean)
       ((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
       ((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations.  As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine.  So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:53:39 -07:00
Kenneth Graunke
03ea156f1b i965/vs: Preserve the type when copy propagating into an instruction.
Consider the following code, which reinterprets a register as a
different type:

mov(8)          g6<1>F          g1.4<0,4,1>.xF
and(8)          g5<1>.xUD       g6<4,4,1>.xUD   0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV.  Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8)          g5<1>.xUD       g6<4,4,1>.xF    0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke
10ff6772c8 i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.
Consider the following code sequence:

   mul(8)          g4<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mov.sat(8)      m1<1>.xyF       g4<4,4,1>F
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

The compute-to-MRF pass will discover the first mov.sat and attempt to
replace it by rewriting earlier instructions.  Everything works out,
so it replaces scan_inst's destination file, reg, and reg_offset,
resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

Unfortunately, it loses the .xy writemask on the mov.sat's MRF
destination.  While this doesn't pose an immediate problem, it then
proceeds to transform the second mov.sat, resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          m1<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF

Instead of writing both halves of the vector (like the original code),
it overwrites the full vector both times, clobbering the desired .xy
values.

When encountering a MOV, the compute-to-MRF code scans for instructions
which generate channels of the MOV source.  It ensures that all
necessary channels are available (possibly written by several
instructions).  In this case, *more* channels are available than
necessary, so we want to take the subset that's actually used.
Taking the bitwise and of both writemasks should accomplish that.

This was discovered by analyzing an ARB_vertex_program test
(glean/vertProg1/MUL test (with swizzle and masking)) with my new
Mesa IR -> Vec4 IR translator code.  However, it should be possible
with GLSL programs as well.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke
9142ade154 glcpp: Don't use infinite lookhead for #define differentiation.
Previously, we used lookahead patterns to differentiate:

   #define FOO(x)  function macro
   #define FOO (x) object macro

Unfortunately, our rule for function macros:

   {HASH}define{HSPACE}+/{IDENTIFIER}"("

relies on infinite lookahead, and apparently triggers a Flex bug where
the generated code overflows a state buffer (see YY_STATE_BUF_SIZE).

There's no need to use infinite lookahead.  We can simply change state,
match the identifier, and use a single character lookahead for the '('.
This apparently makes Flex not generate the giant state array, which
avoids the buffer overflow, and should be more efficient anyway.

Fixes piglit test 17000-consecutive-chars-identifier.frag.

NOTE: This is a candidate for every release branch ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-10-25 14:52:53 -07:00
Kenneth Graunke
eeb2fb72eb i965/vs: Fix debug dumping of VS push constants.
While copying the values into the batch space, we advance the param
pointer.  The debug code then tries to iterate over all the uploaded
values, starting at param...which is now the end of the uploaded data,
rather than the start.

This patch saves a pointer to the start of push constant space before
it gets altered and switches the debug code to use that.

Tested by uncommenting the code and examining the output of
glsl-vs-clamp-1.shader_test.  Previously all values appeared to be zero.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:53 -07:00
Matt Turner
df924d82e2 mesa/tests: Add ES3.0 dispatch table sanity test
Since ES3.0 is backward compatible with 2.0, we check that all the 2.0
functions and additional 3.0 functions exist.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Matt Turner
355f507f2a Split dispatch sanity's validate_function test into two
Will be useful for the next patch, adding GLES 3 testing.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Paul Berry
1cf6360f89 dispatch_sanity: print names of functions that shouldnt be in dispatch table.
Previously we just printed the dispatch table index and the user had
to convert it to a function name.  That was a pain because when
FEATURE_remap_table is defined, the assignment of functions to
dispatch table entries is done at run time.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Paul Berry
03984b26c4 shared-glapi: implement _glapi_get_proc_name().
Previously this function was only implemented for non-shared-glapi
builds.  Since the function is only intended for debugging purposes we
use a simple O(n) algorithm.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Matt Turner
67f1e7bf5f src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS
When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
are not used. AM_CPPFLAGS should be used for includes anyway.

Fixes a build problem since 41b14d125:

CC       ralloc_test-ralloc.o
In file included from ../../../src/glsl/ralloc.c:42:0:
../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-10-25 13:31:24 -07:00
Matt Turner
d654afd892 egl: Import eglext.h revision 19332
The version number (14) wasn't updated.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 10:49:09 -07:00
Matt Turner
41b14d1251 ralloc: Annotate printf functions with PRINTFLIKE(...)
Catches problems such as (in the gles3 branch)

glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
	'long long int', but argument 4 has type 'int' [-Wformat]

As a side-effect, remove ralloc.c's likely/unlikely macros and just use
the ones from main/compiler.h.

NOTE: This is a candidate for the release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-25 10:47:43 -07:00
Matt Turner
ec57fbbc72 build: Ship install-sh in the tarball
Fixes the problem where configure from the tarball would report missing
files:

$ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in bin

NOTE: This is a candidate for the 9.0 branch.
2012-10-25 10:47:43 -07:00
José Fonseca
0cb0c38cce mesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)
4bits and 3bits quantitization values differ significantly for
values other than 0 and 1.

Fixes piglit draw-pixels for softpipe/llvmpipe.

NOTE: Probably a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-25 17:57:57 +01:00
José Fonseca
4efcdd1e7a trace: Fix dumping of set_constant_buffer method. 2012-10-25 15:30:19 +01:00
Andreas Boll
86cd77d0a9 docs: add another fixed bug to mesa 8.0.5 release notes
Reported-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 23:59:51 +02:00
Andreas Boll
2574d10398 docs: Add 8.0.5 release notes
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 23:51:09 +02:00
Bryan Cain
ebd8df7a31 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.
2012-10-24 23:51:08 +02:00
Vincent Lejeune
0f35702d79 r600g: force bank_swizzle if already set
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:37:02 +02:00
Vincent Lejeune
d1eaa9ea70 r600g: rewrite tgsi-to-llvm load-input to handle fragcoord
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:31:41 +02:00
Christoph Bumiller
d310e29302 nv50/ir/tgsi: fix srcMask for TXP with SHADOW1D 2012-10-24 20:47:38 +02:00
Ian Romanick
be1c5f4498 mesa: Use MIN instead of CLAMP for unsigned source data
This silences a zillion GCC warnings like:

../../../src/mesa/main/pack.c: In function '_mesa_pack_rgba_span_from_uints':
../../../src/mesa/main/pack.c:560:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 11:03:16 -07:00
Michel Dänzer
eee1ff423c st/mesa: Fix assertions for copying texture image to finalized miptree.
The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 17:54:25 +02:00
Andreas Boll
ecb02c27fc gallium/docs: fix sphinx warning
src/gallium/docs/source/context.rst:495: WARNING:
malformed hyperlink target.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 14:14:03 +02:00
Vinson Lee
016897cc66 scons: Do not use -fvisibilty=hidden on Cygwin.
This is a follow-up to commit db78643182.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-23 23:22:45 -07:00
Andreas Boll
3e3ff4cd73 mesa: fix indentation in get-pick-list.sh script
NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Andreas Boll
135ec3a1db mesa: grep for commits with cherry picked in commit message only once
and save them temporary in already_picked

NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Andreas Boll
b2991526ed mesa: optimize get-pick-list.sh script
cuts down the while loop iterations from 4600 to 380 commits at the
moment

NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Andreas Boll
fa27a0db43 mesa: simplify get-pick-list.sh script
and add a description for the script

NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Ian Romanick
2d95db660e mesa: add get-pick-list.sh script into bin/
NOTE: This is a candidate for the stable branches.
2012-10-23 19:26:56 +02:00
Paul Berry
2e0de80751 _mesa_create_exec_table: GLES3 fixes.
This patch sets up the dispatch table for the following GLES3
functions when a GLES3 context is in use:

- BeginQuery
- BeginTransformFeedback
- BindSampler
- BindTransformFeedback
- BlitFramebuffer
- ClearBufferfi
- ClearBufferfv
- ClearBufferiv
- ClearBufferuiv
- ClientWaitSync
- CopyBufferSubData
- DeleteQueries
- DeleteSamplers
- DeleteSync
- DeleteTransformFeedbacks
- EndQuery
- EndTransformFeedback
- FenceSync
- FramebufferTextureLayer
- GenQueries
- GenSamplers
- GenTransformFeedbacks
- GetInteger64v
- GetQueryObjectuiv
- GetQueryiv
- GetSamplerParameterfv
- GetSamplerParameteriv
- GetStringi
- GetSynciv
- GetTransformFeedbackVarying
- GetVertexAttribIiv
- GetVertexAttribIuiv
- IsQuery
- IsSampler
- IsSync
- IsTransformFeedback
- PauseTransformFeedback
- RenderbufferStorageMultisample
- ResumeTransformFeedback
- SamplerParameterf
- SamplerParameterfv
- SamplerParameteri
- SamplerParameteriv
- TransformFeedbackVaryings
- VertexAttribDivisor
- VertexAttribIPointer
- WaitSync

And it avoids setting up the dispatch table for these non-GLES3
functions:

- ColorMaski
- GetBooleani_v
- Enablei
- Disablei
- IsEnabledi
- ClearColorIiEXT
- ClearColorIuiEXT
- TextureStorage2DEXT
- TextureStorage3DEXT
- GetActiveUniformName
- GetnUniformdv
- GetnUniformfv
- GetnUniformiv
- GetnUniformuiv

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: Make the ctx argument to _mesa_init_transform_feedback_dispatch()
a const pointer.  Add a comment to remind us to add
GetBufferParameteri64v once tests exist for it.  Also add
VertexAttribDivisor for GLES3, and remove GetActiveUniformName and
GetnUniform{dv,fv,iv,uiv} for GLES3.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:40 -07:00
Paul Berry
5863e3d16e _mesa_create_exec_table(): deprecate ProgramStringARB.
This function is only useful for the ARB_{vertex,fragment}_program
extensions, which we don't expose in core contexts.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:40 -07:00
Paul Berry
893ddb068f _mesa_create_exec_table: de-deprecate GetPointerv.
glGetPointerv was de-deprecated in GL 4.3, because GL 4.3 adds
functionality from KHR_debug and ARB_debug_output, which require
glGetPointerv.

This patch modifies _mesa_create_exec_table() to populate
glGetPointerv in the dispatch table for core contexts.

Technically this is not in compliance with the spec--what we really
ought to do for core contexts is expose glGetPointerv only when a GL
4.3 context is in use or one of the two extensions is present.
However, it seems silly to go to that extra work, since the only
client-visible effect would be for glGetPointerv to raise an
INVALID_OPERATION error instead of an INVALID_ENUM error.  Besides,
the other functions set up by _mesa_create_exec_table() only depend on
the API in use, not on the GL version or extensions supported.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry
e7dd2e5213 glapi: Alias VertexAttribDivisor and VertexAttribDivisorARB.
There's no reason to have separate slots in the dispatch table for
these two functions, since they are synonymous.

Note: previous to this patch, we never populated the dispatch table
slot for VertexAttribDivisor, which was ok, since it is not required
until 3.3.  After this patch, both functions will be usable provided
that the ARB_instanced_arrays extension is present.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry
bad96f6ada glapi: Alias ClampColor and ClampColorARB.
There's no reason to have separate slots in the dispatch table for
these two functions, since they are synonymous.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry
992ed68ed6 main: Fix warning ('struct gl_context' declared inside parameter list).
This eliminates a warning in GCC 4.7.1.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Eric Anholt
ab7188e199 mesa: Return 0 for GL_CURRENT_QUERY with a mismatched query target.
With the previous two commits, this fixes piglit
GL_ARB_occlusion_query2/api.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:53 -07:00
Eric Anholt
8f1131fcc0 mesa: Refuse to EndQuery with a mismatched query target.
v2: Add a comment about what we're checking for.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:53 -07:00
Eric Anholt
ce086ebd89 mesa: Throw an error for a new query on an already-active query target.
There's a similar test below, but it's not the same: that one checks whether
this query object is already active (potentially on another target).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:52 -07:00
Eric Anholt
e755c1a36b i965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.
v2: Fix mangled sentence in the comment, and make the loop exit early.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
2012-10-22 17:35:59 -07:00
Brian Paul
11070105f0 st/mesa: free TGSI tokens with ureg_free_tokens()
since they're allocated by ureg_get_tokens().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
2012-10-22 15:49:31 -06:00
Brian Paul
bb93439873 st/mesa: replace REALLOC() with realloc()
We should use the later since we're freeing the memory with free(),
not the gallium FREE() macro.

This fixes a mismatch when using the gallium debug memory functions.

NOTE: This is a candidate for the 9.0 branch.
2012-10-22 15:49:31 -06:00
Brian Paul
140f1d9207 docs: GL_ARB_texture_storage is supported for all gallium drivers 2012-10-22 15:49:31 -06:00
Matt Turner
9a51edfb5a Re-add HAVE_PTHREADS preprocessor macro
Broken in commit 814345f54b.

NOTE: This is a candidate for the 9.0 branch.
2012-10-22 10:52:47 -07:00
Kristian Høgsberg
259fc154f1 gbm: Use the kms dumb ioctls for cursor instead of libkms
We need to create bos suitable for cursor usage that we can map and
write data into.  The kms dumb ioctls is all we need for this, so drop
the dependency on libkms.
2012-10-21 13:00:49 -04:00
Tom Stellard
d2b0338e33 r600g: Remove special handling of PRED_SET* insructions for LLVM 3.2
The 3.2 version of the backend now sets all the correct fields for
PRED_SET* instructions.
2012-10-19 21:25:01 +00:00
Tom Stellard
8030cb0ed4 radeon/llvm: Sort tgsi opcode action initialization
This was done in order to identify and remove duplicate entries.
2012-10-19 21:25:01 +00:00
Tom Stellard
bd8af8a3dc radeon/llvm: Fix lowering TGSI_OPCODE_SSG 2012-10-19 21:25:00 +00:00
Eric Anholt
cae077cd0f i965: Stop flushing the batch on timestamp queries, too.
Given the usecase we have of trying to measure timestamps across individual
draw calls, flushing will totally mess up what people are trying to measure.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-19 11:47:01 -07:00
Eric Anholt
1973845fbd i965: Don't flush the batch immediately on EndQuery.
The theory I had when I wrote the code was that you wanted to minimize latency
on your queries because the app was going to ask soon.  Only, it turns out
that everybody batches up their queries and asks for the results later (often
after the next SwapBuffers!), so this was a pessimization.

Until now, I had no workload where it mattered enough to benchmark.  Recently
I started playing some Minecraft, which uses tons of queries to decide whether
to render chunks of the terrain.  For that app, avoiding the flush in the
query-generation loop improves performance 22.7% +/- 4.7% (n=3) on an apitrace
capture of it (confirmed in game by watching the fps meter found by pressing
F3, 15/16 -> 20/21 fps).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-19 11:47:01 -07:00
Eric Anholt
804469c58d i965/fs: Fix typo in refactor of brw_fs_reg_allocate.cpp.
I'm amazed that my usual warnings check didn't catch this, and that this
passed piglit.
2012-10-19 11:47:01 -07:00
Tapani Pälli
f593acd577 i965/vs: include format argument in debug printf
otherwise some compilers will throw error
"error: format not a string literal and no format arguments"

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-19 10:00:19 -07:00
Michel Dänzer
c2e37b1d2e st/mesa: Fix source miptree level for copying data to finalized miptree.
Fixes WebGL texture mips conformance test, no piglit regressions.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-19 16:01:14 +02:00
Francisco Jerez
26fc30ef83 clover: No need for clover::is_zero() to be a functor.
Simplify is_zero() somewhat, and as a side effect work around a gcc compiler
bug that causes build failure.

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

Reported-by: Dmitry Cherkassov <dcherkassov@gmail.com>
2012-10-19 12:38:44 +02:00
Brian Paul
6551c4ea3c st/mesa: improve the guess_and_alloc_texture() heuristic
If GL_BASE_LEVEL==0 and GL_MAX_LEVEL==0 that's a pretty good hint that
there'll be a single mipmap level in the texture.

Google Earth sets the texture's state this way before the first glTexImage
call.  This saves a bit of texture memory.
2012-10-18 18:00:50 -06:00
Marek Olšák
e5a9bf5523 gallium: remove unused data pointer from pipe_transfer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-18 22:54:53 +02:00
Chad Versace
0da72d3502 intel: Skip texsubimage fastpath for more pixel unpack state (v2)
Fixes piglit tests "unpack-teximage2d --pbo=* --format=GL_BGRA" on
Sandybridge+.

The fastpath was checking an incomplete set of pixel unpack state. This
patch adds checks for all the fields of gl_pixelstore_attrib that affect
2D texture uploads.  Also, it begins permitting the case where
GL_UNPACK_ROW_LENGTH is 0.

Ideally, we would just ask a unicorn to JIT this fastpath for us in
a way that safely handles the unpacking state. Until then, it's safer if
only a small set of situations activate the fastpath.

v2: Use _mesa_is_bufferobj(), per Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-18 08:53:59 -07:00
Matt Turner
6c28174969 Finish _HAVE_FULL_GL removal
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 19:30:34 -07:00
Dmitry Cherkasov
b21455f27d configure.ac: Fix LLVM 3.2 r600/radeonsi error message
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Dmitry Cherkasov <Dmitrii.Cherkasov@amd.com>
2012-10-17 17:43:35 -04:00
Brian Paul
0d1ee26489 svga: add svga_screen_cache_dump() debug helper 2012-10-17 15:30:33 -06:00
Kristian Høgsberg
e20a0f14b5 wayland: Drop support for ill-defined, unused wl_egl_pixmap
It doesn't provide the cross-process buffer sharing that a window system
pixmap could otherwise support and we don't have anything left that uses
this type of surface.
2012-10-17 16:32:13 -04:00
Kristian Høgsberg
2b8e90a338 wayland: Remove 0.85 compatibility #ifdefs 2012-10-17 16:32:13 -04:00
Kristian Høgsberg
0229e3ae41 egl/wayland: Update to Wayland 0.99 API
The 0.99.0 Wayland release changes the event API to provide a thread-safe
mechanism for receiving events specific to a subsystem (such as EGL) and
we need to use it in the EGL platform.

The Wayland protocol now also requires a commit request to make changes
take effect, issue that from eglSwapBuffers.
2012-10-17 16:32:13 -04:00
Eric Anholt
be4c0a243e i965/fs: Statically allocate the reg_sets at context initialization.
Now that we've replaced all the variable settings other than reg_width, it's
easy to hang on to this (the expensive part of setting up the allocator).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:02:16 -07:00
Eric Anholt
8757fa65b8 i965/fs: Allocate registers in the unused parts of the gen7 MRF hack range.
This should also reduce register pressure on gen7+, like the previous commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:02:06 -07:00
Eric Anholt
a087e9f27f i965/fs: Reduce the interference between payload regs and virtual GRFs.
Improves performance of the Lightsmark penumbra shadows scene by 15.7% +/-
1.0% (n=15), by eliminating register spilling. (tested by smashing the list of
scenes to have all other scenes have 0 duration -- includes additional
rendering of scene description text that normally doesn't appear in that
scene)

v2: Allow allocation of all but g0/g1 of the payload.
v3: Pull count_to_loop_end() out to a helper function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2, recommended v3)
2012-10-17 13:01:57 -07:00
Eric Anholt
551e1cd44f i965/fs: Expose the payload registers to the register allocator.
For now, nothing else can get allocated over them, but that will change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:54 -07:00
Eric Anholt
6c69df1e0f i965/fs: Remove extra allocation for classes[].
This was to slot in the magic aligned pairs class, but it got moved to a
descriptive name later.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:51 -07:00
Eric Anholt
5d90b98879 i965/fs: Make the register allocation class_sizes[] choice static.
Based on split_virtual_grfs(), we choose the same set every time, so set it in
stone.  This will help us avoid regenerating the somewhat expensive
class/register set setup every compile.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:37 -07:00
Eric Anholt
20ebebac51 i965/vs: Improve live interval calculation.
This is derived from the FS visitor code for the same, but tracks each channel
separately (otherwise, some typical fill-a-channel-at-a-time patterns would
produce excessive live intervals across loops and cause spilling).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48375
          (crash -> failure, can turn into pass by forcing unrolling still)
2012-10-17 12:24:01 -07:00
Eric Anholt
e1a518e2b1 i965/vs: Fix the mlen of scratch read/write messages.
These messages always have m0 = g0 and m1 = offset, and write has m2 = data.
Avoids regression in opt_compute_to_mrf() with a change to scratch writes to
set up the data as an MRF write in the IR.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
c226b7a4d3 i965: Make the cfg reusable from the VS.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
54679fcbca i965: Share the predicate field between FS and VS.
Note that BRW_PREDICATE_NONE is 0 and BRW_PREDICATE_NORMAL is 1, so that's a
lot like the true/false we had in the FS before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
7abfb67dc4 i965: Rename fs_cfg types to not mention fs.
fs_bblock_link -> bblock_link
fs_bblock -> bblock_t (to avoid conflicting with all the fs_bblock *bblock)
fs_cfg -> cfg_t (to avoid conflicting with all the fs_cfg *cfg)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
5ed57d9543 i965: Move brw_fs_cfg.* to brw_cfg.*.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
24aeeb2fdc i965: Make the FS and VS share a few visitor/instruction fields.
This will let us reuse brw_fs_cfg.cpp from brw_vec4_*.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
338fd85e62 i965/vs: Trim the swizzle of the scratch write temporary.
This fixes confusion by the upcoming live variable analysis which saw e.g. use
of temp.w when only temp.xyz were initialized in the basic block, and
concluded that temp.w must have come from outside of the block (even though it
was never initialized anywhere).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
af911b2819 i965/vs: Do the temporary allocation in emit_scratch_write().
Both callers were doing basically the same thing, just written differently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Eric Anholt
9499f7984e i965/vs: Simplify emit_scratch_write() prototype.
Both callers used (effectively) inst->dst as the argument, so just reference
it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Eric Anholt
914d8f9f84 i965/vs: Add a little bit of IR-level debug ability.
This is super basic, but it let me visualize a problem I had with
opt_compute_to_mrf().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Adam Jackson
a30d14635d glx: Add GLXBadProfileARB to the error string list
Note: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-10-17 15:12:14 -04:00
Owen W. Taylor
1d0c621121 glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()
Due to a string mismatch, INTEL_swap_event wasn't listed among GLX
extensions for the connection, even when present on both client and
server. That is, glXQueryServerString and glXGetClientString reported the
extension, but glXQueryExtensionsString did not.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-17 10:16:23 -07:00
José Fonseca
aa2067c757 gallivm: Hide AVX support when requested by LP_NATIVE_VECTOR_WIDTH or unsupported by LLVM.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-10-17 18:07:43 +01:00
Will Schmidt
54821c0e99 gallivm: Use mcjit for ppc_64 architecture
Per commentary and direction in the LLVM community, support for ppc64 is
going into MCJIT rather than the old JIT.  There is no existing support
in prior llvm versions, so no need to specify LLVM version numbers.

Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-10-17 18:07:43 +01:00
Brian Paul
32638737c5 st/mesa: silence MSVC signed/unsigned comparison warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
ead664e506 st/mesa: silence MSVC double/unsigned assignment warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
198d1bdb5f tgsi: silence MSVC signed/unsigned comparison warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
34a5fd2a39 util: fix MSVC signed/unsigned comparison warning in u_upload_mgr.c code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
ba7bfdeff2 util: fix MSVC signed/unsigned comparison warning in u_vbuf.c code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
a0785544e3 util: fix MSVC double/float conversion warning in u_format_r11g11b10f.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
f031910486 draw: silence MSVC signed/unsigned comparison warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
a115a29153 util/blitter: silence assorted MSVC warnings
Fix signed/unsigned comparison warnings and float/int assignment warnings.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
7abd136e91 wmesa: remove old, unused span code 2012-10-17 10:13:30 -06:00
José Fonseca
879894552b scons: Fix graw-xlib lib order.
Avoids "undefined symbol: XShmCreateImage" error.
2012-10-17 15:28:26 +01:00
José Fonseca
ea2978b11c tgsi: Add support to parse IMM[x] too.
Thanks to Brian for pointing this out.
2012-10-17 15:27:26 +01:00
José Fonseca
2ab6e67d90 Revert "gallivm: Don't use llvm.x86.avx.max/min.ps.256 inadvertently."
This reverts commit bf2edc776b.
2012-10-17 15:04:20 +01:00
Vinson Lee
53e36d333c build: Build on Cygwin with gnu99 instead of c99.
The GCC c99 standard on Cygwin sets __STRICT_ANSI__ and symbols such as
strdup are not available.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-16 23:28:22 -07:00
Matt Turner
0199ff7fe3 es2api: Add GL ES 3 headers 2012-10-16 19:31:22 -07:00
Matt Turner
c9155c9317 glapi: Add es2="3.0" attributes to XML.
Note that we are missing the ARB_internalformat_query extension, which
provides the glGetInternalformativ function needed by GL ES 3.0.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-10-16 19:31:22 -07:00
Brian Paul
1284543a44 svga: whitespace fixes, remove useless comments 2012-10-16 18:11:58 -06:00
Brian Paul
0087f5ce51 svga: silence MSVC warning about negating an unsigned value 2012-10-16 17:55:39 -06:00
Brian Paul
ffbac58746 svga: silence MSVC double/float assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul
ce3faa993c svga: fix MSVC double/float parameter warning 2012-10-16 17:55:39 -06:00
Brian Paul
d21e6c87c0 svga: silence MSVC float/int assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul
200291e087 svga: silence MSVC double/float assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul
25cd2c2a8a svga: silence some MSVC signed/unsigned comparison warnings 2012-10-16 17:55:39 -06:00
Ian Romanick
4d0458dc6e mesa/tests: Add ES1.1 dispatch table sanity test
This test actually depends on FEATURE_ES1 because
_mesa_create_exec_table_es1 doesn't exist without it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-10-16 14:57:20 -07:00
Ian Romanick
95b76eab71 mesa/tests: Compile ES2 test regardless of FEATURE_ES2 setting
The relevant ES2 code is always in Mesa.  Always building the tests
ensures that things aren't accidentally broken when people don't build
with --enable-es2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-16 14:57:20 -07:00
Brian Paul
c50d6a2abc mesa: remove FEATURE_ES1 tests in enable.c code
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
1633fa1627 mesa: remove FEATURE_ES test in _mesa_get_compressed_formats()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
4936aadcd1 mesa: remove FEATURE_ES test in _mesa_is_compressed_format()
The code already has a runtime ES1 test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
920f331cf1 mesa: remove FEATURE_GL test from updated_drawbuffers()
There's already a runtime test for full OpenGL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
99940eef48 mesa: remove #if _HAVE_FULL_GL checks
This is basically more of the "remove FEATURE_x" clean-up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
198fa6452b mesa: remove ASSERT_NO_FEATURE macro
Was only used in one place.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Eric Anholt
7139ab80ca i965: Fix rendering to small mipmaps of depth/stencil buffers using a temp mt.
Fixes 51 piglit tests (fbo-clear-formats, and most of the remaining failures
in depthstencil).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
5c8dd6cf79 i965: Share the draw x/y offset masking code between main/blorp and all gens.
This code is twisty, and the comment before most of the blocks was actually
giving me the opposite impression from its intention: We want to apply as much
of our offset as possible through coarse tile-aligned adjustment, since we can
do so independently per buffer, and apply the minimum we can through
fine-grained drawing offset x/y, since it has to agree between all buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
ddfa346e4a i965: Make a helper function for the renderbuffer temporary mt workaround.
We now have a case of wanting to do that on gen6+ as well, so make this logic
usable elsewhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
4bec2e31bf i965: Warn on a couple of workarounds in blending.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
1fe71848b6 intel: Add a macro for printing a debug warning once.
There are a number of places where some obscure piece of the code is not
currently worth fixing, and we have some workaround behavior available.  It's
nicer for users to do some lame workaround than to just assert, but without
asserts we never knew when the workaround was at fault.

This should give us a nice compromise: Execute the workaround, but mention
that the obscure workaround was hit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Andreas Boll
85067d4bab docs: add note about removal of GL_NV_fragment_program 2012-10-16 21:24:04 +02:00
Paul Berry
381186dbf8 glapi: Delete gles_api.py, since it is no longer used.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
c8ad6ef1c6 mapi_abi: Use GLES information from XML rather than gles_api.py.
Note: mapi_abi can consume API information from either XML or a .csv
file.  A side effect of this change is that the ES1 and ES2 API
printers can only be used with XML input now.  That's ok, since the
.csv input format is only used for the OpenVG API.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
137f8ef225 mapi_abi: Override 'hidden' and 'handcode' attributes using polymorphism.
Previously, the ES1, ES2, and shared GLAPI printers passed a list of
function names to the base class constructor, which was used by the
_override_for_api() function to loop over all the API functions and
adjust their 'hidden' and 'handcode' attributes as appropriate for the
API flavour being code-generated.

This patch lifts the loop from _override_for_api() into its caller,
and makes it into a polymorphic function, so that the derived classes
can customize its behaviour directly.  In a future patch, this will
allow us to override the 'hidden' and 'handcode' attributes based on
information from the XML rather than a list of functions.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
4f6fc905c6 mapi_abi: Get rid of unnecessary copy.
Previously, _get_api_entries() would make a deep copy of each element
in the entries table before modifying the 'hidden' and 'handcode'
attributes.  This was unnecessary, since the entries aren't used again
after this function.  Removing the copy simplifies the code, because
it is no longer necessary to adjust the alias pointers to point to the
copied entries.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
77ed171f27 mapi_abi: Remove sanity check that all GLES functions are present.
Currently mapi_abi.py uses hardcoded lists of function names (in
gles_api.py) to determine which functions need to be included in the
GLES 1 or GLES 2 API.  This patch removes a sanity check which
verified that all GLES functions listed in the hardcoded lists were
actually present in the XML.

Later patches in this series will modify mapi_abi.py to determine
which functions need to be included in the GLES 1 or GLES 2 API based
directly on the XML.  Once that is done, the sanity check will be
redundant.  Removing the sanity check now will simplify the patches to
come.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
155eff56b1 mapi_abi: Collect all imports at top of file.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
e378cd77bc glapi: Use GLES information from XML rather than gles_api.py.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
cd4ce16c45 glapi: Read GLES information from XML.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
81a7f50781 glapi: Add es1 and es2 attributes to XML.
Currently, the set of functions which exist in GLES1 or GLES2 is
determined by hardcoded lists of function names in gles_api.py.  This
patch encodes that information into the XML files using new
attributes, es1 and es2.

The es1 attribute denotes the first version of GLES 1 in which the
function exists (e.g. es1="1.1" means the function exists in GLES 1.1
but not GLES 1.0).  "none" (the default) means the function is not
available in any version of GLES 1.

The es2 attribute denotes the first version of GLES 2/3 in which the
function exists (e.g. es2="2.0" means the function exists in both GLES
2.0 and GLES 3.0).  "none" (the default) means the function is not
available in any version of GLES 2 or GLES 3.

Note that since GLES 3 is a strict superset of GLES 2, there is no
need for a separate attribute for it; instead, 'es2="3.0"' should be
used to denote functions that are present in GLES 3 but not GLES 2.

This patch only adds information about GLES versions 1.0, 1.1, and
2.0.

Later patches will modify the python code generation scripts to use
this information rather than the hardcoded lists in gles_api.py.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
7dc052b12b glapi: use new-style Python classes.
An unfortunate quirk of Python 2 is that there are two types of
classes: "classic" classes (which are backward compatible with some
unfortunate design decisions made early in Python's history), and
"new-style" classes.  Classic classes have a number of limitations
(for example they don't support super()) and are unavailable in Python
3.  There's really no reason to use classic classes, except in
unmaintained legacy code.  For more information see
http://www.python.org/download/releases/2.2.3/descrintro/.

This patch upgrades the Python code in src/mapi/glapi/gen to use
exclusively new-style classes.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Kenneth Graunke
41954107c0 i965/fs: Fix segfault when using INTEL_DEBUG=perf with non-GLSL.
Now that ARB programs and fixed function are routed through the new
backend, shader might be NULL.  Don't do INTEL_DEBUG=perf support in
that case, since it relies on shader->compiled_once.

Since INTEL_DEBUG=perf wasn't previously supported, this maintains the
status quo.  It might be nice to support it someday, however.

This could be moved to brw_shader_program instead of brw_shader, but
it appears even prog can be NULL in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 12:02:01 -07:00
Kenneth Graunke
56705cd36b mesa: Don't flatten IF statements by default.
MaxIfDepth of 0 means "flatten all the time", not "never flatten".
This is only desirable on hardware that can't support control flow;
software rasterization and most hardware drivers want this.

This alters behavior for swrast as well as i915.  Tested on i915.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 12:01:39 -07:00
Kenneth Graunke
b2e0293213 mesa: Remove PROGRAM_WRITE_ONLY register type.
More dead code.  I'm not sure what it was for.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:25 -07:00
Kenneth Graunke
01d2bd34f4 mesa: Remove dead _mesa_num_parameters_of_type() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
1366db2ef6 mesa: Remove dead _mesa_add_attribute() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
d0021cb0fb mesa: Remove remnants of PROGRAM_VARYING.
The previous patch removed the producer of things in this file.
Since there aren't any, we can remove it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
eda4a4ae81 mesa: Remove dead _mesa_add_varying() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
f7cfe3fc70 mesa: Remove dead program_parameter::Flags field.
All flags are now gone, so we can stop storing and passing this around.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
5bb6f15f79 st/mesa: Remove the PROG_PARAM_BIT_CYL_WRAP flag. [v2]
Nobody ever set the flag, which makes this dead code.

v2: Leave the ureg_DECL_fs_input_cyl function in place, even though it's
    unused, since VMWare uses it for their internal projects.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
4b13252bba mesa: Remove GLSL-related PROG_PARAM_BIT flags.
GLSL doesn't use the program code anymore.  Accordingly, there were no
consumers of these flags, so there's no need to define them.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
8d418d1616 mesa: Remove support for named parameters.
These were only part of NV_fragment_program, so we can kill them.

The fact that PROGRAM_NAMED_PARAM appears in r200_vertprog.c is rather
comedic, but also demonstrates that people just spam the various types
of parameters everywhere because they're confusing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
d67e52b027 driconf: Remove force enable for NV_vertex_program.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
58c466519d mesa: Remove yet more remnants of NV_fragment_program.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
e5f03f23a0 mesa: Remove some miscellaneous NV program stuff from arbprogram.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
d213d27f84 mesa: Simplify _mesa_BindProgram() by removing NV program remnants.
Without NV programs, there's no need for the compatible_program_targets
function.  A simple (non-)equality check will do.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
2f350f360b mesa: Remove get and enable bits for NV_fragment_program.
Also remove a leftover remnant from NV_vertex_program.

v2: Update for Imre's get changes.

Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-10-16 11:35:23 -07:00
Kenneth Graunke
d711717b4a mesa: Remove prog_print support for NV programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
2254569bda mesa: Remove support for parsing NV fragment programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
9dc2c28983 mesa: Remove the gl_program::Resident flag.
It apparently was only used for NV programs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
7742952f7e mesa: Remove the EmitNVTempInitialization shader compiler option.
Nobody uses it anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
7487b16128 mesa: Remove the NV program API functions.
These are all unused now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
16d8161962 mesa: Switch to the other glGetVertexAttribPointervARB implementation.
Previously, Mesa used nvprogram.c's _mesa_GetVertexAttribPointervNV()
function to implement this GL call.  There was also a second
implementation in varray.c, _mesa_GetVertexAttribPointervARB(), which
was entirely unused.

The varray.c variant has an additional assertion and checks the index
against ctx->Const.VertexProgram.MaxAttribs rather than
MAX_VERTEX_GENERIC_ATTRIBS.  However, that variable is defined to the
same value, so it should be fine.

This will allow us to kill the duplicate function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
070ba30c36 mesa: Remove some shared NV_vp/fp functions from the dispatch table.
Also kill the resulting dead code for display list handling.

v2: Also kill dlist's OPCODE_REQUEST_RESIDENT_PROGRAMS_NV.

Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
ff1943dec9 mesa: Unhook NV_fragment_program API from the dispatch table.
The NamedParameter functions were introduced in NV_fragment_program, and
are not shared with any other extensions.

Although this patch appears to remove the LocalParameter functions, it
does not: the ARB_fragment_program section also set them up.  Now we
simply initialize them a single time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
492feddb03 swrast: Remove support for the NV_fragment_program extension.
No hardware drivers support this, it's obsolete, and unlikely to be
useful without NV_vertex_program, which is gone now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:33 -07:00
Alex Deucher
ed8d87c6a6 radeonsi: add some new SI pci ids
Note: this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-16 13:11:38 -04:00
Tom Stellard
b1e7bd7690 r600g: Fix segfault in r600_compute_global_transfer_map()
This segfault was caused by commit
369e468889, however it is my fault for not
testing the patch while it was on the list.
2012-10-16 14:39:16 +00:00
Tom Stellard
a73c5d3f9d r600g: Fix build with --enable-opencl 2012-10-16 14:39:15 +00:00
Fredrik Höglund
762d9ace6b mesa/es: Enable GL_EXT_map_buffer_range
This extension is functionally the same as GL_ARB_map_buffer_range.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 13:21:41 +02:00
Kristian Høgsberg
017c6fb324 gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-10-15 22:33:04 -04:00
Fredrik Höglund
0978707917 glx: Fix a regression in the new XCB code
dri2DrawableGetMSC(), dri2WaitForMSC() and dri2WaitForSBC() were
inadvertently changed to return 0 on success.  This resulted in the callers
returning an error to the client.

Restore the previous behavior and also check that the reply pointers are
valid before accessing them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 02:24:42 +02:00
Brian Paul
df3721fd2e st/mesa: remove OPCODE_BRA switch case 2012-10-15 13:17:53 -06:00
Eric Anholt
59c4420fac docs: Add note about removal of GL_NV_vertex_program. 2012-10-15 11:53:24 -07:00
Eric Anholt
bc74c4bbaf mesa: Remove defines for NV_vertex_program limits.
Note that _mesa_GetVertexAttribPointervNV() is actually
glGetVertexAttribPointerv(), which operates on the generic attributes.  The
geometry shader initialization looks like arbitrary cruft to me.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
09c006da9f mesa: Fix comments for NV_vp code that's now only used by other extensions.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
37fc983d03 mesa: Add notes about remaining NV_vertex_program code.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
8b2fe73897 mesa: Remove miscellaneous remains of NV_vertex_program.
v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:24 -07:00
Eric Anholt
cb9a1bf316 mesa: Remove API specific to GL_NV_vertex_program's aliased attribs.
v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:24 -07:00
Eric Anholt
8058a70763 mesa: Remove prog_instruction.h field for never-supported NV_vertex_program3.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
cc763f0f3f mesa: Remove support for GL_VERTEX_STATE_PROGRAMs and their execution.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
363643f540 mesa: Remove NV_vertex_program-specific parameters support.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
c0120c2509 mesa: Remove support for NV_vertex_program's attribute evaluation.
Note that the MAP2 getters were missing from the implementation.  Neat.

v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:23 -07:00
Eric Anholt
4f9d351ef1 mesa: Remove support for NV_vertex_program's special attributes aliasing
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
6a20f0e561 mesa: Fix NV_fragment_program's display list opcode for RequestResident.
While nuking NV_vertex_program, I noticed that one of my opcodes was used in a
strange place.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
6ab9c04769 mesa: Remove support for NV_vertex_program's tracked matrices.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
bcfd51f8c4 mesa: Remove Mesa IR opcodes that existed only for NV_vertex_program.
v2: Remove dead positive() function, caught by Matt.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:23 -07:00
Eric Anholt
422566e1c7 mesa: Remove support for parsing NV vertex programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
cff1b1df4b swrast: Remove support for GL_NV_vertex_program.
It's not supported in any hardware drivers, and doesn't appear to be useful on
Linux.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
a1998673ba gallium: Remove #if 0-ed enable of NV_vp. It's going away.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt
63c233cf08 r200: Remove support for software-only NV_vertex_program.
It wasn't supported in hardware, and the comments in the code indicated no
known uses (similar to my experience on Intel) and a possible intent to remove
it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt
af90c8c511 intel: Remove NV_vertex_program support.
We were holding on to this code because we were aware that NWN 1 had some
support for vertex programs -- no other linux programs I've come across would
use it (since other software also has ARB_vp or GLSL support).  Only, it turns
out that NWN doesn't even give us any vertex programs.  Given that we have
known issues where the extension has never been fully supported, just give up
on it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46795
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt
1a8a0418f2 i965/vp: Remove more code for unused opcodes.
These don't appear in ARB_vp or NV_vp and I missed that fact on the first
pass of removing dead opcodes.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Andreas Boll
c5adfb21b3 r600g: drop useless switch statement
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-15 20:34:02 +02:00
Andreas Boll
0ce21660c2 gallium/docs: update some distro information
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 16:11:49 +02:00
Marek Olšák
023dae71ef r600g: emit the border color only when it's needed
That depends on the texture wrap modes and filtering.
2012-10-15 16:04:09 +02:00
Marek Olšák
33dda8f4fb r600g: cleanup create_sampler_state functions
- stopped using util_color
- reformatted to occupy less characters per line.
- used memcpy for the border color
- used pipe_color_union in the state structure
2012-10-15 16:04:09 +02:00
Marek Olšák
2bbd307fa6 st/mesa: fix integer texture border color for some formats (v2)
And the clear color too, though that may be an issue only with GL_RGB if it's
actually RGBA in the driver.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: The types of st_translate_color parameters were changed to gl_color_union
    and pipe_color_union as per Brian's comment.
2012-10-15 16:04:09 +02:00
Brian Paul
1ec12c53ba util: added debug_print_transfer_flags() function 2012-10-15 07:49:14 -06:00
Abdiel Janulgue
bcb10ca172 mesa: Fix a crash in update_texture_state() for external texture type
NOTE: This is a candidate for the stable branch.

Signed-off-by: Abdiel <abdiel.janulgue@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-15 07:49:14 -06:00
Brian Paul
88ecd0ddb9 svga: remove needless debug-mode linked list code
LIST_DEL() always sets the prev/next pointers to NULL now.
2012-10-15 07:49:14 -06:00
Chris Fester
3fffe8f7b7 util: null-out the node's prev/next pointers in list_del()
Note: This is a candidate for the 9.0 branch.
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-15 07:49:14 -06:00
Daniel Stone
4004620d34 build: Don't fail if libX11 isn't installed
configure.ac would previously refuse to complete if libX11 wasn't
installed, even if we'd disabled GLX and weren't building an X11 EGL
platform.  Make the check simply set the no_x variable that's used (but
never set) immediately below for what looks like this very case.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-10-14 20:41:35 -07:00
Christoph Bumiller
43e6c51aed nouveau: fix offset in nouveau_buffer_transfer_map
Before 369e468889, the transfer was
initialized before the call to map and had the correct value already.
2012-10-14 18:58:04 +02:00
Matt Turner
fb85b204d3 u_format_s3tc.c: Don't call getenv() twice
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-12 12:26:03 -07:00
Tapani Pälli
60565b564b android: generate matching remap_helper to dispatch table
commit a010215463 removed ES2 specific dispatch
table and remap_helper, since now we are using dispatch.h which is generated
from gl_and_es_API.xml we need to generate a matching remap_helper using the
same xml.

Note: This is a candidate for the 9.0 branch.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-12 11:42:09 -07:00
José Fonseca
bf2edc776b gallivm: Don't use llvm.x86.avx.max/min.ps.256 inadvertently.
Could happen when CPU supports AVX, but LLVM doesn't.
2012-10-12 18:52:28 +01:00
José Fonseca
9ccf91f9ef tgsi: Dump register number when dumping immediates.
For example:

VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], GENERIC[12]
DCL CONST[0..4]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
IMM[0] UINT32 {4294967295, 0, 0, 0}
IMM[1] FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx
  1: F2I TEMP[0].x, -TEMP[0]
  2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx
  3: F2I TEMP[1].x, -TEMP[1]
  4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
  5: IF TEMP[0].xxxx :0
  6:   MOV TEMP[0], IMM[1].xyxy
  7: ELSE :0
  8:   MOV TEMP[0], IMM[1].yxxy
  9: ENDIF
 10: MOV OUT[1], TEMP[0]
 11: MOV OUT[0], IN[0]
 12: END

instead of

VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], GENERIC[12]
DCL CONST[0..4]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
IMM UINT32 {4294967295, 0, 0, 0}
IMM FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx
  1: F2I TEMP[0].x, -TEMP[0]
  2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx
  3: F2I TEMP[1].x, -TEMP[1]
  4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
  5: IF TEMP[0].xxxx :0
  6:   MOV TEMP[0], IMM[1].xyxy
  7: ELSE :0
  8:   MOV TEMP[0], IMM[1].yxxy
  9: ENDIF
 10: MOV OUT[1], TEMP[0]
 11: MOV OUT[0], IN[0]
 12: END
2012-10-12 18:52:14 +01:00
Roland Scheidegger
d366520e85 gallivm: fix rsqrt failures
lp_build_rsqrt initially did not do any newton-raphson step. This meant that
precision was only ~11 bits, but this handled both input 0.0 and +infinity
correctly. It did not however handle input 1.0 accurately, and denormals
always generated infinity result.
Doing a newton-raphson step increased precision significantly (but notably
input 1.0 still doesn't give output 1.0), however this fails for inputs
0.0 and infinity (both result in NaNs).
Try to fix this up by using cmp/select but since this is all quite fishy
(and still doesn't handle denormals) disable for now. Note that even with
workarounds it should still have been faster since the fallback uses sqrt/div
(which both use the usually unpipelined and slow divider hw).
Also add some more test values to lp_test_arit and test lp_build_rcp() too while
there.

v2: based on José's feedback, avoid hacky infinity definition which doesn't
work with msvc (unfortunately using INFINITY won't cut it neither on non-c99
compilers) in lp_build_rsqrt, and while here fix up the input infinity case
too (it's disabled anyway). Only test infinity input case if we have c99,
and use float cast for calculating reference rsqrt value so we really get
what we expect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-10-12 18:51:18 +01:00
José Fonseca
2a4105cbc0 galahad: galahad_context_blit
must unwrap.
2012-10-12 18:38:05 +01:00
Marek Olšák
555c8d500a r600g: move shader structures into r600_shader.h 2012-10-12 19:00:30 +02:00
José Fonseca
23c6b8f2ed mesa/st: Fix assertions.
Can't access ptDraw before it is written.
2012-10-12 17:04:34 +01:00
Andreas Boll
c3dd8c358c doxygen: add gbm to .gitignore 2012-10-12 17:45:49 +02:00
Marek Olšák
7997b3c97c r600g: implement MSAA resolving for 8-bit and 16-bit integer formats
by changing the format to NORM.
2012-10-12 15:23:27 +02:00
Oliver McFadden
1b921acd5f intel: print debug either to stdout or `logcat' depending on platform.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-12 11:14:54 +03:00
Brian Paul
743d859e62 util: fix broken pipe_get_tile_rgba() call
Fix breakage from commit 369e468.
2012-10-11 15:53:16 -06:00
Tom Stellard
4cc530f452 radeon/llvm: Fix build with LLVM 3.2 2012-10-11 21:33:00 +00:00
Tom Stellard
dc54c49df9 clover: Fix build with LLVM 3.2
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-10-11 21:32:54 +00:00
Tom Stellard
c6b0132d1e clover: Don't link against libclangRewrite
This library does not exist in LLVM 3.2 and libOpenCL.so links fine
without it on LLVM 3.1

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-10-11 21:32:36 +00:00
Marek Olšák
7b01bc1e4c radeonsi: handle unhandled CAPs 2012-10-11 21:36:26 +02:00
Marek Olšák
dd9274df4f radeonsi: fixup the return type of is_format_supported 2012-10-11 21:32:47 +02:00
Marek Olšák
8e3e4145ce radeonsi: remove unused local variables 2012-10-11 21:31:36 +02:00
Marek Olšák
47b7af6337 r600g: put user indices in the command stream for small index counts
This improves performance a little bit if there are lots of small indexed
draw commands.
2012-10-11 21:21:59 +02:00
Marek Olšák
0369fc9725 r600g: inline r600_translate_index_buffer 2012-10-11 21:21:34 +02:00
Marek Olšák
369e468889 gallium: unify transfer functions
"get_transfer + transfer_map" becomes "transfer_map".
"transfer_unmap + transfer_destroy" becomes "transfer_unmap".

transfer_map must create and return the transfer object and transfer_unmap
must destroy it.

transfer_map is successful if the returned buffer pointer is not NULL.
If transfer_map fails, the pointer to the transfer object remains unchanged
(i.e. doesn't have to be NULL).

Acked-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:16 +02:00
Marek Olšák
ec4c74a9dc st/mesa: use the renderbuffer chosen by core Mesa in CopyTexSubImage
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:12 +02:00
Marek Olšák
9fe06f8815 softpipe: remove unused functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:10 +02:00
Marek Olšák
1c02075df0 st/mesa: use transfer_inline_write in st_texture_image_data
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:07 +02:00
Marek Olšák
ce7ebdd29a st/mesa: remove useless checking in reset_cache
It's always NULL here.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:03 +02:00
Andreas Boll
f04a6a65cc docs: start release notes file for 9.1 2012-10-11 19:26:10 +02:00
Brian Paul
60a9390978 svga: don't use uninitialized framebuffer state
Only the first 'nr_cbufs' color buffers in the pipe_framebuffer_state are
valid.  The rest of the color buffer pointers might be unitialized.
Fixes a regression in the piglit fbo-srgb-blit test since changes in the
gallium blitter code.

NOTE: This is a candidate for the 9.0 branch (just to be safe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-11 09:13:59 -06:00
John Kåre Alsaker
6c53ec1ef2 svga: Remove wierd code which forces non-sRGB formats.
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-10 18:22:22 -06:00
John Kåre Alsaker
1a4aad11b0 svga: Add support for 16-bit per channel RGBA
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-10 18:19:44 -06:00
Eric Anholt
34c58acb59 i965/vs: Add support for splitting virtual GRFs.
This should improve our ability to register allocate without spilling.
Unfortuantely, due to the live variable analysis being ignorant of loops, we
still have register allocation failures on some programs.

v2: Add more context to the comment explaining the function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-10-10 13:22:56 -07:00
Eric Anholt
d4bcc65918 i965/vs: Try again when we've successfully spilled a reg.
Before, we'd spill one reg, then continue on without actually register
allocating, then assertion fail when we tried to use a vgrf number as a
register number.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-10 13:22:56 -07:00
Kenneth Graunke
9237f0ea8d i965/vs: Implement register spilling.
To validate this code, I ran piglit -t vs quick.tests with the "go spill
everything" debugging code enabled.  There was only one regression:
glsl-vs-unroll-explosion simply ran out of registers.  This should be
fine in the real world, since no one actually spills every single
register.

NOTE: This is a candidate for the 9.0 branch. Even if it proves to have
bugs, it's likely better than simply failing to compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-10 13:22:56 -07:00
Kenneth Graunke
46e529672b i965/vs: Fix unit mismatch in scratch base_offset parameter.
move_grf_array_access_to_scratch() calculates scratch buffer offsets in
bytes.  However, emit_scratch_read/write() expects the base_offset
parameter to be measured in OWords.

As a result, a shader using a scratch read/write offset greater than
zero (in practice, a shader containing more than one variable in
scratch) would use too large an offset, frequently exceeding the
available scratch space.

This patch corrects the mismatch by removing spurious conversion from
OWords to bytes in move_grf_array_access_to_scratch().

This is based on a patch by Paul Berry.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-10 13:22:55 -07:00
Matt Turner
587d5db11d egl: Return EGL_BAD_MATCH for invalid profile attributes
Version 12 of the EGL_KHR_create_context spec changed this behavior.

NOTE: This is a candidate for the 9.0 branch
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-10 13:15:06 -07:00
Vincent Lejeune
5090ce42e4 radeon/llvm: use ceil intrinsic instead of llvm.AMDIL.round.posinf
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:33 +02:00
Vincent Lejeune
9a6bb3f645 radeon/llvm: use floor intrinsic instead of llvm.AMDIL.floor
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:20 +02:00
Vincent Lejeune
bfdf26892c radeon/llvm: use llvm fabs intrinsic
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:03 +02:00
Vincent Lejeune
8db11bc4ed radeon/llvm: use llvm intrinsic for flog2
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:45 +02:00
Vincent Lejeune
23e11ac835 radeon/llvm: add support for cos/sin intrinsic
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:28 +02:00
Vincent Lejeune
876b42663c radeon/llvm: add a pattern for fsqrt
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:13 +02:00
Paul Berry
99802519b4 glapi: Reformat python code generation scripts to use 4-space indentation.
This brings us into accordance with the official Python style guide
(http://www.python.org/dev/peps/pep-0008/#indentation).

To preserve the indentation of the c code that is generated by these
scripts, I've avoided re-indenting triple-quoted strings (unless those
strings appear to be docstrings).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-10 11:19:14 -07:00
José Fonseca
856464979b mesa: Avoid C99 indexed initializers.
Not supported by MSVC.

Reviewed-by: Imre Deak <imre.deak@intel.com>
2012-10-10 17:55:04 +01:00
José Fonseca
3f228ed090 mesa: Prevent CONST macro re-definition.
Should fix MSVC build, as windows.h also defines CONST.

CONST usage in get.c is not new, so probably this just appeared now due
to changes in the includes.
2012-10-10 11:40:34 +01:00
José Fonseca
a555888151 mesa: Silence 'assignment makes integer from pointer without a cast' warnings. 2012-10-10 11:35:34 +01:00
Imre Deak
9c1c23331a glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS
This got broken by:
7182a1f glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension
section

Fix it by appending the _EXT suffix to the enum in the test too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:56:02 +03:00
Imre Deak
dd6479160c mesa: glGet: remove the unused TYPE_API_MASK flags
Since we generate the hash tables in build time, these flags aren't used
any more, remove them.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:26 +03:00
Imre Deak
d220435416 mesa: glGet: use the build time generated hash tables
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:23 +03:00
Imre Deak
98f880e0c4 mesa: glGet: add script to generate hash tables in build time
This will be needed by the next patch, which will switch to using
the parameter descriptor- and hash tables generated by the script.

The hash algorithm remains the same, the output parameter descriptor
table format changes slightly. There the TYPE_API_MASK entries are
removed and an invalid NULL entry is inserted at the beginning. This is
ok, as get.c:find_value() doesn't rely on TYPE_API_MASK any more to
detect an invalid enum.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:19 +03:00
Imre Deak
6678125eae scons/android: add flag to check for enabled GL APIs
Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:16 +03:00
Imre Deak
ea637c5b64 mesa: glGet: rename *{_EXT,_ARB} enums missing from the XML spec
The following enums used to be extensions but later became part of the
core specification. The _EXT/_ARB versions of these are not present in
in the current XML spec files, only defined in GL/glext.h

Later we'll need to look up these in a python script using the XML spec.
As a preparation for that remove the _EXT,_ARB suffix from these enums
and rename GL_DISTANCE_ATTENUATION_EXT to GL_POINT_DISTANCE_ATTENUATION.
Naturally, all enums keep their numerical values.

Note that similar renames shouldn't be necessary in the future: in case
of a new extension the XML spec is updated with the new _EXT/_ARB etc.
name and this name is added to the enum table in get.c.  Later the
extension may become part of the core spec, at which point the name w/o
the _EXT/_ARB suffix is added to the XML spec and the table in get.c
remains the same.

GL_BLEND_DST_ALPHA_EXT
GL_BLEND_DST_RGB_EXT
GL_BLEND_SRC_ALPHA_EXT
GL_BLEND_SRC_RGB_EXT
GL_COLOR_SUM_EXT
GL_COMPRESSED_TEXTURE_FORMATS_ARB
GL_CURRENT_FOG_COORDINATE_EXT
GL_CURRENT_SECONDARY_COLOR_EXT
GL_DISTANCE_ATTENUATION_EXT
GL_FOG_COORDINATE_ARRAY_EXT
GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
GL_FOG_COORDINATE_ARRAY_TYPE_EXT
GL_FOG_COORDINATE_SOURCE_EXT
GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
GL_PACK_IMAGE_HEIGHT_EXT
GL_PACK_SKIP_IMAGES_EXT
GL_SECONDARY_COLOR_ARRAY_EXT
GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
GL_UNPACK_IMAGE_HEIGHT_EXT
GL_UNPACK_SKIP_IMAGES_EXT

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:11 +03:00
Imre Deak
59d3bf6542 mesa: glGet: simplify the 'enum not found' condition
When traversing the hash table looking up an enum that is invalid we
eventually reach the first element in the descriptor array. By looking
at the type of that element, which is always TYPE_API_MASK, we know that
we can stop the search and return error. Since this element is always
the first it's enough to check for its index being 0 without looking at
its type.

Later in this patchset, when we generate the hash tables during build
time, this will allow us to remove the TYPE_API_MASK and related flags
completly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:08 +03:00
Imre Deak
2ad4a47547 mesa: glGet: fix parameter lookup for apps using multiple APIs
The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:05 +03:00
Imre Deak
7182a1fc5e glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section
This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the
EXT_polygon_offset section. (Solution by Ian Romanick)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:42:42 +03:00
Marek Olšák
87a34131c4 r600g: move SQ_GPR_RESOURCE_MGMT_1 into new config_state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:07 +02:00
Marek Olšák
c5584e93b1 r600g: move DB_SHADER_CONTROL into db_misc_state
Also update the register value in more appropriate places
than r600_update_derived_state.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:05 +02:00
Marek Olšák
ae25b93245 r600g: emit PS_PARTIAL_FLUSH at the beginning of CS
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:03 +02:00
Marek Olšák
ef723613e0 r600g: atomize depth-stencil-alpha state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:01 +02:00
Marek Olšák
711f3bae9d r600g: atomize rasterizer state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:58 +02:00
Marek Olšák
9a683d1bd8 r600g: sort variables in r600_context
Some variables have been removed from there too.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:55 +02:00
Marek Olšák
30bcc5538f r600g: initialize SQ_VTX_SEMANTIC_* in the start_cs command buffer
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:49 +02:00
Marek Olšák
18a189188a r600g: atomize scissor state
The workaround for R600 lacking VPORT_SCISSOR_ENABLE has also been simplified.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:45 +02:00
Marek Olšák
ab075de53b r600g: atomize polygon offset state
POLY_OFFSET_DB_FMT_CNTL is moved to the framebuffer state, because it only
depends on the zbuffer format.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:42 +02:00
Marek Olšák
a50edc8ed8 r600g: atomize fetch shader
The state object is actually a buffer, it's literally a buffer containing
the shader code.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:38 +02:00
Marek Olšák
8bf7044ec6 r600g: remove the dual_src_blend flag from the shader key
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:35 +02:00
Marek Olšák
faaba52aed r600g: atomize blend state
This is not so trivial, because we disable blending if the dual src
blending is turned on and the number of color outputs is less than 2.
I decided to create 2 command buffers in the blend state object and just
switch between them when needed, because there are other states unrelated
to blending (like the color mask) and those shouldn't be changed
(the old code had it wrong).

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:32 +02:00
Marek Olšák
eb65fefa4b r600g: inline r600_atom_dirty
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:28 +02:00
Marek Olšák
d8ea64697b r600g: remove the "atom" variable from r600_command_buffer
r600_command_buffer is not an atom.

The "atoms" have evolved into state slots (or groups of state slots) where
you can bind states. There is a fixed amount of atoms (state slots)
in the context.

The command buffers are nothing like that. They represent states, not state
slots.

We could probably give r600_atom a better name someday.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:25 +02:00
Eric Anholt
1e7776ca2b egl: Remove bogus invalidate code.
The invalidate event support is a careful dance between driver and loader,
where both have to say they can handle it, and then the loader reports
invalidate events for the driver so the driver can do the optimization.

The EGL code doesn't report __DRIuseInvalidateExtension to the driver, so it
has no responsibility to call the driver's invalidate function, and the driver
is doing the glViewport hack because it assume.  This is not
the only time invalidate would need to be called (we need it *any* time an
invalidate event comes down the pipe, but we don't watch for them), so just
stop calling the driver's function.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:04 -07:00
Eric Anholt
7e9bd2b2ed egl: Add support for driconf control of swapinterval.
This behavior mostly matches glx_dri2.  It's slightly complicated in
comparison because EGL exposes the implementation limits in the EGL config.

Note that platform_x11 was the only one setting swap_available, so the move of
the MaxSwapInterval into it is appropriate.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
8c472b8f6a glx: Replace DRI2SwapBuffers() custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
f02242a4fa glx: Fix some indentation.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
811602885b glx: Replace DRI2SwapInterval custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
7acf8ae0e1 glx: Reuse setSwapInterval for setting initial swap interval. 2012-10-09 14:32:03 -07:00
Eric Anholt
d0937759db glx: Allow glXSwapInterval(0) when vblank_mode=0.
There's no reason to say no in this case.
2012-10-09 14:32:03 -07:00
Eric Anholt
ab8ae9301f glx: Replace DRI2GetMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
8e61b9028a glx: Replace DRI2WaitForMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
183ab9e14e glx: Replace DRI2WaitForSBC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
1e74910bb7 glx/dri1: Remove uncompiled __DRI_SWAP_BUFFER_COUNTER code.
It's been in place but never enabled since 2010.  Note how one piece called a
DRI2 function, suggesting never being tested.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
da3f7c127b egl: Quit checking for a bug in old xcb when we require new xcb.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
b477384f40 egl: Drop xcb ifdefs by just requiring a version from this year.
glx and gallium's xcb_dri2 usage already require this version, so this is
nothing really new.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
b49cd8495f egl: Unifdef dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
c35a9388a3 glx: Unifdef some dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

I left in the DRI_TEX_BUFFER_VERSION ifdefs, which is broken and uncompiled
(the version wasn't bumped from 2 to 3 when the patch was landed), but I don't
know what should be done with it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
bb01f671bb glx: Require xcb_dri2 for building glxdri2.c.
I'm going to transition a bunch of the protocol to using XCB so we can stop
rolling it ourselves.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
dc6fa41076 glx: Remove the last user of -DUSE_XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
3f0e3a7ad5 glx: Unifdef USE_XCB.
It's been required for building glx since
b518dfb513 in january.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
31c7d4ec18 egl: Cleanly cast EGLNative* pointers to X11 types.
The EGLNative* types are all defined to be pointers across all our EGL
implementations, but in the X11 platform they're actually just XIDs (32-bit
integers).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:01 -07:00
Vincent Lejeune
11e08f42e4 r600g: use a select to handle front/back color in llvm
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-09 23:19:09 +02:00
Vincent Lejeune
80663cb185 r600g: frontcolor tracks its associated backcolor
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-09 23:19:09 +02:00
Matt Turner
900cc7cf80 Remove VAAPI support.
Not working and unmaintained.

Reviewed-by: Christian König <christian.koenig@amd.com>
2012-10-09 14:00:05 -07:00
Marcin Slusarz
63a15117a5 nv50: fix build after "nv50: fix printf warning"
When compiled with C++ compiler, inttypes.h defines PRI* macros only when
__STDC_FORMAT_MACROS is defined.
2012-10-09 22:42:54 +02:00
Marcin Slusarz
93eba26935 nouveau: use pre-calculated stride for resource_get_handle
Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.
2012-10-09 22:23:09 +02:00
Tom Stellard
45288cd2b6 r600g: Fix build with --enable-opencl 2012-10-09 19:54:12 +00:00
Ian Romanick
b25fbceb86 mesa/tests: Remove driverCtx parameter from call to _mesa_initialize_context
Fixes 'make check' breakage since 733dba2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-09 11:21:14 -07:00
Quentin Glidic
7cb8764ca3 intel: Add missing #include <time.h>
Commit 006c1a3c65 introduced a call to
clock_gettime, but failed to include <time.h>, breaking the build in
some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-09 09:12:41 -07:00
Kenneth Graunke
b6346749a8 i965: Delete some dead code from brw_eu_emit.c.
Presumably some of this was used by the old fragment shader backend.
2012-10-09 09:11:26 -07:00
Andreas Boll
840d8484c0 docs: add missing release date 2012-10-09 17:50:29 +02:00
Andreas Boll
c833d98ff9 docs: update release notes for 9.0 2012-10-09 17:36:41 +02:00
Andreas Boll
3699150d3b docs: add news item for 9.0 release
Reviewed-by: Brian Paul <brianp@vmware.com>

ported manually from
8e73273cb9
2012-10-09 17:29:37 +02:00
Brian Paul
541158fbb9 mesa: remove unused _mesa_cpal_compressed_format_type() function
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-09 07:05:47 -06:00
Marek Olšák
30ebc8650c nv50: fix printf warning 2012-10-09 14:38:43 +02:00
Marek Olšák
51872e8bb3 nv30: fix type conversion warning 2012-10-09 14:34:27 +02:00
Marek Olšák
cf9081b37c i915g: fix unused variable and type conversion warnings 2012-10-09 14:33:16 +02:00
Daniel Stone
4f310984a9 teximage: Remove unnecessary compressed format check
Ever since df4a88ac, the check for compressed formats has been
unnecessary.  And ever since cb72ec5f, the build has been broken with
FEATURE_ES.  Remove it, as it does nothing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-10-09 14:32:03 +02:00
Andreas Boll
b534c39ece docs: update FAQ
Reported-by: Fabio Pedretti <fabio.ped@libero.it>

v2: (Chad Versace <chad.versace@linux.intel.com>)
  - Rewrite FAQ - proper place for installing mesa.

v3: fix some typos

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 09:00:18 +02:00
Ben Skeggs
63c3a799ae nv50: point vertex runout at a valid address
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 09:56:36 +10:00
Ben Skeggs
c47a01c29c nvc0: point vertex runout at a valid address
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 09:56:34 +10:00
Ben Skeggs
d53bbabe61 nvc0: fix missing permanent bo reference on poly cache
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 09:56:12 +10:00
Brian Paul
1aa8ad8b50 Revert "st/mesa: remove unused variables to fix compile warnings"
This reverts commit 810d2e167c.

The pscreen variable is used in an assertion.  Use "(void) pscreen;"
to silence the warning.
2012-10-08 17:32:54 -06:00
Brian Paul
bad1b271a0 mesa: minor whitespace fixes in teximage.c 2012-10-08 17:30:21 -06:00
Marek Olšák
810d2e167c st/mesa: remove unused variables to fix compile warnings 2012-10-09 01:14:55 +02:00
Marek Olšák
cb72ec5fc5 mesa: remove unused variables to fix compile warnings 2012-10-09 01:14:55 +02:00
Marek Olšák
fd3219962d softpipe: initialize quadColor2 to fix compile warnings 2012-10-09 01:14:24 +02:00
Marek Olšák
d0349c91c8 r600g: remove unused variables to fix compile warnings 2012-10-09 01:11:56 +02:00
Marek Olšák
d284613422 llvmpipe: remove unused variables to fix compile warnings 2012-10-09 01:10:58 +02:00
Stéphane Marchesin
437a2560b1 i915g: Don't clobber I915_NEW_FS on new framebuffer.
This snuck in with a previous commit.
2012-10-08 12:30:46 -07:00
Eric Anholt
6a514494fa i965/fs: Improve performance of copy/constant propagation.
Use a simple chaining hash table for the ACP.  This is not really very good,
because we still do a full walk of the tree per destination write, but it
still reduces fp-long-alu runtime from 5.3 to 3.9s.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:38 -07:00
Eric Anholt
fb5bf03a20 i965/fs: Move constant propagation to the same codebase as copy prop.
This means that we don't get constant prop across into the first block after a
BRW_OPCODE_IF or a BRW_OPCODE_DO, but we have hope for properly doing it
across control flow at some point.  More importantly, with the next commit it
will help avoid O(n^2) with instruction count runtime for shaders that have
many constant moves.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:38 -07:00
Eric Anholt
098acf6c84 i965: Remove the old ARB_fragment_program backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:38 -07:00
Eric Anholt
97615b2d8c i965: Replace brw_wm_* with dumping code into the fs_visitor.
This makes a giant pile of code newly dead.  It also fixes TXB on newer
chipsets, which has been totally broken (I now have a piglit test for that).
It passes the same set of Ian's ARB_fragment_program tests.  It also improves
high-settings ETQW performance by 3.2 +/- 1.9% (n=3), thanks to better
optimization and having 8-wide along with 16-wide shaders.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24355
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:27 -07:00
Eric Anholt
014aaa97d3 i965: Reduce maximum GL_ARB_fragment_program instruction count to 1024.
I don't know of any programs that would need more than this.  The larger
programs I've seen have neared 100 instructions.  This prevent excessive
runtimes of automatic tests that attempt to test up to the exposed maximums
(like fp-long-alu).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
9cfc00a84c i965/fs: Add a couple more algebraic cases that help some ARB_fp patterns.
ARB_fp doesn't go through the GLSL optimizer, and these were things you see
frequently thanks to conditionals being lowered to SLT/SGE and MUL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
d81d7a4b65 i965/fs: Pull ir_binop_min/ir_binop_max handling to a separate function.
This will be reused from the ARB_fp compiler.  I touched up the pre-gen6 path
to not overwrite dst in the first instruction, which prevents the need for
aliasing checks (we'll need that in the ARB_fp compiler, but it actually
hasn't been needed in this codebase since the revert of the nasty old
MOV-avoidance code).  I also made the conditional_mod between gen6 and
pre-gen6 consistent, which shouldn't matter except for denorm/(+/-)0
comparisons where the choice between left and right hand side of the
comparison changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
5c26874546 i965/fs: Refactor rectangle/GL_CLAMP texture coordinate adjustment.
We'll want to reuse this for ARB_fp handling.

v2: Fold the remaining bit of emit_texcoord back into visit(ir_texture).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
e7149d390c i965/fs: Pass fragment depth to the fb write as a fs_reg, not an ir_variable.
This will be used for the ARB_fp change to use this backend.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
6589c0bd56 mesa: Note that OPCODE_RFL is not part of ARB_fp (it's NV_fp only).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
José Fonseca
88e417d761 st/wgl: Don't cache HDC anywhere.
Applications may destroy HDC at any time. So always get a HDC as needed.

Fixes lack of presents with Solidworks eDrawings when screen resolution is
changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-08 15:42:50 +01:00
Ian Romanick
86de501f14 meta: Make shader template literal strings be parameters to asprintf
This enables the C compiler to generate warnings if the formats and the
arguments don't match.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:50 -07:00
Ian Romanick
751737f497 meta: Always enable GL_EXT_texture_array in mipmap shader
'#extension foo: enable' is harmless.  The functionality is only
actually enabled if the extension is supported.  The shader won't use
the functionality if it's not supported, so we're fine.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:47 -07:00
Ian Romanick
0e973b7498 meta: Since mipmap output type is always vec4, don't sprintf it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:45 -07:00
Ian Romanick
0242381f06 meta: Don't use GLSL 1.30 shader on OpenGL ES 2
Fixes GLES2 CoverageGL conformance test.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:42 -07:00
Ian Romanick
3308c079bd meta: Rearrange shader creation in setup_glsl_generate_mipmap
The diff looks weird, but this moves the code from the first 'if
(ctx->Const.GLSLVersion < 130)' block down into the second block.  It
also moves some variable decalarations closer to their use.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:39 -07:00
Ian Romanick
ab097dde0c meta: Remove unsafe global mem_ctx pointer
NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:34:17 -07:00
Stéphane Marchesin
6ef37f71b0 i915g: Call draw_set_mapped_vertex_buffer from draw_vbo
This regressed with the draw rework. Fixes glest and vdrift crash.
2012-10-06 13:15:04 -07:00
Marek Olšák
9dfca930d7 r600g: fix possible issue with stencil mipmap rendering
Somehow I only hit this issue with my latest libdrm changes.
This won't be needed with DB texturing.

NOTE: This is a candidate for the 9.0 branch.
2012-10-06 05:31:01 +02:00
Marek Olšák
6fa22b840e r600g: ensure PERFECT_ZPASS+NOOP_CULL_DISABLE are 0 for blits+decompression
When an occlusion query was active, the derived DB state wasn't changed
for u_blitter even though all the occlusion queries were suspended.

It's fixed by moving the state update into the emit functions, which are
called whenever queries are stopped or suspended.
2012-10-06 04:31:16 +02:00
Marek Olšák
6db53ca490 r600g: don't modify pipe_resource in resource_copy_region, fixing race condition
pipe_resource can be shared between contexts, we shouldn't modify its
description. Instead, let's use the resource "views" (sampler views and
surfaces), where we can freely change almost any property of a resource.
2012-10-06 04:31:16 +02:00
Marek Olšák
d063c7b142 r600g: fix streamout on RS780 and RS880
The latest kernel from git is required. Transform feedback (along with GL3.0)
is turned off on older kernels.
2012-10-06 03:49:29 +02:00
Marek Olšák
588263e7a7 gallium: allow debug helpers in the release build
No idea why this is #ifdef'd. Trace and Noop are definitely useful no matter
how Mesa is built.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-06 03:34:40 +02:00
Brian Paul
733dba2a08 mesa: remove the driverCtx parameter to _mesa_create/initialize_context()
No longer used.
2012-10-05 17:13:03 -06:00
Brian Paul
917d273928 mesa: remove unused gl_context::DriverCtx field 2012-10-05 17:13:03 -06:00
Brian Paul
4c9042d21d radeon/r200: remove use of gl_context::DriverCtx field 2012-10-05 17:13:03 -06:00
Brian Paul
5a63634a13 radeon/r200: make radeon_context subclass of gl_context
radeon_context now contains a gl_context, rather than a pointer to one.
This will allow some minor core Mesa clean-up.
2012-10-05 17:13:03 -06:00
Kenneth Graunke
7fa0f10cd8 mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.
The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
GLSL or ARB vp/fp) are in use.  If either TNL or TexEnv programs are
active, at least one stage is using fixed function.

On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
tests, as well as missing textures in Xonotic.  These were all
regressions since commit fb4a34e60e.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-05 13:19:53 -07:00
Stéphane Marchesin
74b6ea49df i915g: Get rid of the fixup state functions.
Now that the saved_* state is gone, we don't need those any longer.
2012-10-05 12:45:02 -07:00
Stéphane Marchesin
dca9e3c477 i915g: Remove the i915_context->saved_* stuff.
When using u_blitter, the state was being saved from saved_*, but we
don't use that. So after u_blitter resumed we got some corrupted
state in.

So let's just remove the saved_* stuff. I thought it was weird but
harmless, it's actually broken.
2012-10-05 12:45:01 -07:00
Stéphane Marchesin
98600c5ff6 i915g: Don't update I915_HW_PROGRAM in update_framebuffer
It's already going to be updated in update_dst_buf_vars.
2012-10-05 12:45:00 -07:00
Stéphane Marchesin
762ac0a218 Revert "i915g: Don't bind 0-length programs"
This reverts commit 8c28a9bd73.
2012-10-05 12:44:58 -07:00
Vinson Lee
df0de93206 glapi: Do not use backtrace on Cygwin.
execinfo.h is not available on Cygwin.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-04 22:28:15 -07:00
Paul Berry
8f0b81bf7d mesa: don't enable glVertexPointer() when using API_OPENGLES2.
This function is only present in GLES1 and in the OpenGL compatibility
profile.

Fixes the following "make check" failure:

    [----------] 1 test from DispatchSanity_test
    [ RUN      ] DispatchSanity_test.GLES2
    Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
    compression/decompression unavailable
    dispatch_sanity.cpp:122: Failure
    Value of: table[i]
       Actual: 0x4de54e
    Expected: (_glapi_proc) _mesa_generic_nop
    Which is: 0x41af72
    i = 321
    [  FAILED  ] DispatchSanity_test.GLES2 (4 ms)
    [----------] 1 test from DispatchSanity_test (4 ms total)

NOTE: This is a candidate for stable release branches.

Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-04 12:46:42 -07:00
Stéphane Marchesin
8c28a9bd73 i915g: Don't bind 0-length programs
Since we started doing fixups for different render target formats,
this has been an issue. Instead just don't do anything, when the
program gets emitted later it'll get the correct fixup.

Fixes a bunch of piglit tests.
2012-10-04 12:39:06 -07:00
Brian Paul
91d8409649 mesa: don't call TexImage driver hooks for zero-sized images
This simply avoids some failed assertions but there's no reason to
call the driver hooks for storing a tex image if its size is zero.

Note: This is a candidate for the stable branches.
2012-10-04 07:59:11 -06:00
Rob Bradford
185d6df3c1 intel: Fix intel_texsubimage_tiled_memcpy to skip GL_EXT_unpack_subimage case
413c49141 added an optimisation to improve the performance of teximage
under a limited set of circumstances. If GL_EXT_unpack_subimage has been
used then we we must also skip this optimisation since the optimised
codepath does not take the packing values into consideration.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-03 16:44:22 -07:00
Matt Turner
31ab61cac1 dri drivers: Link dricommon before dynamic libraries
I think libtool should be handling this for us, but the build fails for
Jordan because libdricommon (a static library, which uses expat) appears
before -lexpat on the linker command.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-03 13:41:09 -07:00
Paul Berry
551c991606 register_allocate: don't consider trivially colorable registers for spilling.
Previously, we considered all registers as candidates for spilling.
This was counterproductive--for any registers that have already been
removed from the interference graph, there is no benefit to spilling
them, since they don't contribute to register pressure.

This patch ensures that we will only try to spill registers that are
still in the interference graph after register allocation has failed.

This is consistent with the recommendations of the paper "Retargetable
Graph-Coloring Register Allocation for Irregular Architectures", on
which our register allocator is based.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-03 12:54:42 -07:00
Marek Olšák
53d06ecdd0 glx/dri2: use uint64_t instead of double to represent time for FPS calculation
Wine or a windows app changes fpucw to 0x7f, causing doubles to be equivalent
to floats, which broke the calculation of FPS.
We should be very careful about using doubles in Mesa.

Henri Verbeet adds:
  For reference, this is done by for example d3d9 when a D3D device is
  created without D3DCREATE_FPU_PRESERVE set. In the general case
  applications can do all kinds of terrible things to the FPU control
  word of course.
2012-10-03 16:55:48 +02:00
Oliver McFadden
ff835724b5 mesa: tests: EnumStrings.LookUpByNumber
[ RUN      ] EnumStrings.LookUpByNumber
enum_strings.cpp:43: Failure
Value of: _mesa_lookup_enum_by_nr(everything[i].value)
  Actual: "GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE"
Expected: everything[i].name
Which is: "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"
enum_strings.cpp:43: Failure
Value of: _mesa_lookup_enum_by_nr(everything[i].value)
  Actual: "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE"
Expected: everything[i].name
Which is: "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"
[  FAILED  ] EnumStrings.LookUpByNumber (2 ms)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55505
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-03 14:11:58 +03:00
Andreas Boll
336cc6499b docs: add link to the GLSL compiler page
This reverts commit 9e0931e355

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-03 08:54:12 +02:00
Andreas Boll
d495669965 docs: update shading documentation
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-03 08:53:46 +02:00
Matt Turner
159ca32fec build: Remove autoconf check for signbit
rebase failure in 7da12426f7.
2012-10-02 22:50:02 -07:00
Stéphane Marchesin
fe3aeb7ea3 i915g: Implement srgb textures the easy way.
Since the hw can do it, let's use the hw. It's less accurate
but doesn't have the shader instruction count shortcomings.
2012-10-02 17:54:50 -07:00
Stéphane Marchesin
2acc719374 i915g: Use X tiling for textures
This is what the classic driver does, and it allows faster
texture uploads.
2012-10-02 17:54:48 -07:00
Robert Bragg
0a523a8820 SwapBuffersRegionNOK: invert rectangles on y axis
The EGL_NOK_swap_region2 spec states that the rectangles are specified
with a bottom-left origin within a surface coordinate space also with a
bottom left origin, so this patch ensures the rectangles are flipped
before passing them on to dri2_copy_region.

Fixes piglit's egl-nok-swap-region test.

Tested-by: Matt Turner <mattst88@gmail.com>
2012-10-02 14:49:00 -07:00
Brian Paul
df4a88ac43 mesa: remove bogus compressed texture size checks
A compressed texture image size doesn't have to be a multiple of the
compressed block size (only sub-images do).  Fixes issues when building
compressed mipmaps because we often wind up with non-block-size images
for the higher mipmap levels.

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

Note: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Sven Arvidsson <sa@whiz.se>
2012-10-02 15:19:00 -06:00
Michel Dänzer
82e38ac91f radeonsi: Fix double compilation of shader variants.
Fixes crash in piglit glsl-max-varyings.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02 17:53:47 +02:00
Michel Dänzer
c3db19efba radeonsi: Better indexing of parameters in the pixel shader.
We were previously using the TGSI input index, which can exceed the number of
parameters passed from the vertex shader via the parameter cache. Now we use
a separate index which only counts those parameters.

Prevents piglit regressions with the following fix.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02 17:50:58 +02:00
Michel Dänzer
dbb4a7f950 radeon/llvm: Disable SI flow control again for now.
It makes piglit unreliable due to VM protection faults and GPU lockups.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-02 16:50:36 +02:00
Andreas Boll
48e4eb695a docs/helpwanted: cleanup todo list links
split into common and driver specific To-Do lists
add an explanation for each To-Do list

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-02 15:44:34 +02:00
Andreas Boll
1f38fb2697 docs: document how to apply a candidate to a stable branch
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-02 15:44:28 +02:00
Andreas Boll
f07784d9ba docs: document how to mark a candidate for a stable branch
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-02 15:44:00 +02:00
Negreanu Marius Adrian
e00abb00f0 android: glcpp: fix abuse of yylex
Port the 'glcpp: fix abuse of yylex' commit to Android.mk
Also, since the Android.*.mk are sourced in a global namespace,
the local-y-to-c-and-h is prefixed with the LOCAL_MODULE name,

The initial fix commit is 53d46bc787

There's also a bugzilla for this: 54947

Signed-off-by: Negreanu Marius Adrian <adrian.m.negreanu@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-10-02 08:14:34 +03:00
Matt Turner
523c015246 build: Don't build libdricore if not building classic drivers 2012-10-01 15:23:05 -07:00
Matt Turner
b6c0fa1280 libdricore: Remove dead C(XX)FLAGS_NOVISIBILITY 2012-10-01 15:23:05 -07:00
Matt Turner
24ded89876 build: Add visibility CFLAGS to OSMesa 2012-10-01 15:23:05 -07:00
Matt Turner
1762ec28db build: Link OSMesa with glapi, libdl, libstdc++
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=399813
          https://bugs.freedesktop.org/show_bug.cgi?id=53179
2012-10-01 15:23:05 -07:00
Matt Turner
4cfff7211c build: Set visibility CFLAGS in dri/swrast 2012-10-01 15:23:05 -07:00
Matt Turner
3628402707 build: Set visibility CFLAGS in dri/r200 2012-10-01 15:23:05 -07:00
Matt Turner
55d45efdd8 build: Set visibility CFLAGS in dri/radeon 2012-10-01 15:23:05 -07:00
Matt Turner
340637d54d build: Set visibility CFLAGS in dri/nouveau 2012-10-01 15:23:04 -07:00
Matt Turner
381d120b8a build: Set visibility CFLAGS in dri/i915 2012-10-01 15:23:04 -07:00
Matt Turner
d2872b5612 build: Set visibility CFLAGS in dri/common 2012-10-01 15:23:04 -07:00
Matt Turner
8746f641bb build: Build src/glsl with visibility CFLAGS 2012-10-01 15:23:04 -07:00
Matt Turner
710a90ccaf build: Turn on visibility CFLAGS for core mesa 2012-10-01 15:23:04 -07:00
Matt Turner
63c3a051cd build: Order src/Makefile correctly 2012-10-01 15:23:04 -07:00
Matt Turner
814345f54b build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition 2012-10-01 15:23:04 -07:00
Matt Turner
b6651ae6ad build: Use PTHREAD_LIBS and PTHREAD_CFLAGS 2012-10-01 15:23:04 -07:00
Matt Turner
dd4fde8f67 build: Set PTHREAD_LIBS for pkgconfig files if empty 2012-10-01 15:20:50 -07:00
Tom Stellard
00d80b3a6f llvmpipe: Fix build with LLVM 2.8
Commit 8d9778589f added all-targets to the
LLVM_COMPONENTS list, but this component does not exist with LLVM 2.8.

Adding all-targets is not necessary for any drivers, and it seems to be
left over from earlier versions of the commit mentioned above.

Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-10-01 17:42:56 -04:00
Tom Stellard
67fcb3c2b4 configure.ac: Use amdgpu component for LLVM 3.2
The amdgpu component actually does exist.  I must have been using an
older version of llvm-config by accident when I first made this change.
2012-10-01 21:14:10 +00:00
Tom Stellard
f2f17fc348 radeon/llvm: Only initialize the AMDGPU target 2012-10-01 21:14:10 +00:00
Tom Stellard
cbd09a9e5c radeon: Fix build with LLVM 3.1
The build was broken by commit 8d9778589f
2012-10-01 15:47:31 -04:00
Tom Stellard
8d9778589f radeon: Support LLVM 3.2
LLVM 3.2 and newer requires that the R600/SI backend be part of the
LLVM tree.
2012-10-01 15:37:17 +00:00
Tom Stellard
91ee735001 r600g: Re-enable growing of the compute memory pool 2012-10-01 15:37:16 +00:00
Tom Stellard
44b1050e6c r600g: Fix bug when adding new items to the compute memory pool
The items are ordered in the item list by their offsets, with the lowest
offset coming first in the list.  The old code was assuming that new
items being added to the list would always have a greater offset than
the first item in the list, however this is not always the case.
2012-10-01 15:37:16 +00:00
Tom Stellard
eacca90f43 r600g: Use a RAT buffer as the backing bo for the compute memory pool 2012-10-01 15:37:16 +00:00
Tom Stellard
5cd1c65dc1 r600g: Make sure to init the compute memory pool with enough memory 2012-10-01 15:37:16 +00:00
Tom Stellard
2508d43c36 r600g: Add evergreen_init_color_surface_rat() v2
This can be used to initialize the CB* registers for buffers without a
radeon_surface.

v2:
  - Get correct group_bytes value from r600_screen
  - Stop setting unnecessary fields

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-01 15:37:16 +00:00
Tom Stellard
d13c3b19f9 r600g: Add register field definitions for 028C70_RESOURCE_TYPE
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-01 15:37:16 +00:00
Oliver McFadden
9545d9611f intel: add support for ANGLE_texture_compression_dxt.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-01 17:21:51 +03:00
Alex Deucher
304beb81bb radeonsi: emit PA_SU_PRIM_FILTER_CNTL
has no default value.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:51 +02:00
Alex Deucher
7d76767f21 radeonsi: remove some old r600g cruft
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Alex Deucher
918e302a19 radeonsi: fix range checking for state regs
end value is exclusive, but in practice we shouldn't
hit this.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Alex Deucher
f1a3de5e9d radeonsi: drop some cayman remnants
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Christian König
22ae062fa1 radeonsi: define SGPR register numbers
Instead of hardcoding them.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Christoph Bumiller
c321b1bef1 nvc0: make sure handles for unbound textures/samplers are uploaded on nve4 2012-09-30 23:09:37 +02:00
Christoph Bumiller
2149ce41ed nv50,nvc0: fix 3d engine blit for nvc0 2012-09-30 23:09:29 +02:00
Christoph Bumiller
36ea744f58 nv50,nvc0: implement blit 2012-09-30 21:31:45 +02:00
Marek Olšák
de80660c2b gallium: remove resource_resolve
The functionality is provided by the new blit function.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
d37e6b15ad st/mesa: implement decompress_with_blit using gallium blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
d1b929a137 st/mesa: implement BlitFramebuffer using gallium blit
This also fixes a lot tests, especially all the clip-and-scissor-blit MSAA
piglit tests.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
ad3d5dbcc5 svga: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
3d9d4b1ce6 softpipe: implement blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
5f3054dcc4 radeonsi: implement blit
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
fc887d687b r600g: implement blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
95b777e688 r300g: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
ced065a079 nv30: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
db85443922 nv30: use util_format_is_supported
Hardware drivers *must* use it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
ff2d192ec5 llvmpipe: implement blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
6d2f59ce54 i915g: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
2a309dc2b4 gallium: implement blit in driver wrappers
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
ab3070c5fa gallium: add helpers for dumping pipe_box and pipe_blit_info
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
cecfb452ab gallium/u_blitter: add helper for blitting via resource_copy_region
v2: fix off-by-one error in is_box_inside_resource, add comments

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
0b0697e80d gallium/u_blitter: add gallium blit implementation
The original blit function is extended and the otAher functions reuse it.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
84d2f2295e gallium/u_blitter: add ability to disable and restore the render condition
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
59dfe0af60 gallium/u_blitter: facilitate co-existence with the Draw module
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
9cc257ad40 gallium/u_blitter: check PIPE_CAP_TEXTURE_MULTISAMPLE
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
c4df2e3337 gallium: add blit into the interface
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
b9c9dd4783 gallium: add PIPE_CAP_TEXTURE_MULTISAMPLE
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
c15dbd7ef2 softpipe: fix set_framebuffer_state with uninitialized surfaces past nr_cbufs-1
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Vinson Lee
0615e8324c scons: Use full path of texture_builtins.py.
Fixes this build error on Cygwin.
Explicit dependency `src/glsl/builtins/tools/texture_builtins.py' not
found, needed by target
`build/cygwin-x86-debug/glsl/builtin_function.cpp'.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-29 14:38:37 -07:00
Brian Paul
46328296bd mesa: add fall-through comment, just to be clear 2012-09-29 08:53:59 -06:00
Brian Paul
bd81ebf085 mesa: remove useless GLenum casts 2012-09-29 08:53:59 -06:00
Brian Paul
e77fc1279a mesa: add const qualifier in check_for_ending() to silence warning 2012-09-29 08:24:44 -06:00
Kenneth Graunke
225276c696 i965: Complain about variable index lowering when INTEL_DEBUG=perf.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:36:56 -07:00
Kenneth Graunke
33dbac78a8 i965: Dump linked shaders on MESA_GLSL=dump.
Often, the original shader IR isn't terribly interesting because a lot
of crucial optimizations haven't been done (such as inlining built-ins).

ir_to_mesa used to print this out for us, but since we don't use it, we
have to do it ourselves.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:36:45 -07:00
Kenneth Graunke
5cadb3ef7e glsl: Rename variable_entry2 back to variable_entry in struct splitting.
The anonymous namespace should keep these private classes to file scope,
preventing clashes with other symbols of the same name elsewhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:36:01 -07:00
Anuj Phogat
ea0d088727 intel/i965: Disable SampleAlphaToOne if dual source blending enabled
From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
DWord 1, Bit 30 (AlphaToOne Enable):
"If Dual Source Blending is enabled, this bit must be disabled"

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:10:09 -07:00
Vinson Lee
9549e55f11 scons: Disable build of assembly sources on Cygwin.
The assembly sources currently do not build on Cygwin.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-28 23:29:10 -07:00
Jordan Justen
00905dbf19 mesa: allow MESA_GL_VERSION_OVERRIDE to override the API type
Change the format to MAJOR.MINOR[FC]
For example: 2.1, 3.0FC, 3.1

The FC suffix indicates a forward compatible context, and
is only valid for versions >= 3.0.

Examples:
2.1:   GL Legacy/Compatibility context
3.0:   GL Legacy/Compatibility context
3.0FC: GL Core Profile context + Forward Compatible
3.1:   GL Core Profile context
3.1FC: GL Core Profile context + Forward Compatible

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 16:15:51 -07:00
Ian Romanick
e87c63f288 i965: brwInitVtbl needs to know the chipset generation
Fixes major regressions since de958de.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 15:39:17 -07:00
Ian Romanick
de958de71b i915: Don't free the intel_context structure when intelCreateContext fails.
intelDestroyContext will eventually be called, and it will clean things up.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
2012-09-28 15:05:24 -07:00
Ian Romanick
87f26214d6 i965: Don't free the intel_context structure when intelCreateContext fails.
intelDestroyContext will eventually be called, and it will clean things
up.  The call to brwInitVtbl is moved earlier so that
intelDestroyContext can call the device-specific destructor.  This also
makes the code look more like the i915 code.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
2012-09-28 15:05:24 -07:00
Ian Romanick
22897c7497 intel: Don't call intelDestroyContext if there is no context to destroy
Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
2012-09-28 15:05:24 -07:00
Ian Romanick
f93cb0bebb dri_util: Use calloc to allocate __DRIcontext
The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths.  Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
2012-09-28 15:05:24 -07:00
Jordan Justen
4c704e5949 main/version: add "(Core Profile) to version string for core profiles
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-28 14:17:12 -07:00
Eric Anholt
7ae332dc6d glx: Fix compile warnings since 99fee476a1
_glapi_table is a struct full of named function pointers, while the generated
code just wants to treat it as an array of function pointers.  Cast to avoid
the compiler warning.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 14:00:24 -07:00
Ian Romanick
66159f94a5 mesa/tests: Sanity check the ES2 dispatch table
This test is only built when shared-glapi is used.  Because of changes
elsewhere in the tree that were necessary to make shared-glapi work
correct with GLX, it's not feasible to make the test function both ways.

The list of expected functions originally came from the functions set by
api_exec_es2.c.  This file no longer exists in Mesa (but api_exec_es1.c
is still generated).  It was the generated file that configured the
dispatch table for ES2 contexts.  This test verifies that all of the
functions set by the old api_exec_es2.c (with the recent addition of VAO
functions) are set in the dispatch table and everything else is a NOP.

When adding ES2 (or ES3) extensions that add new functions, this test
will need to be modified to expect dispatch functions for the new
extension functions.

v2: Expect VAO functions be non-NOP.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 08:19:54 -07:00
Ian Romanick
d0e1428349 mesa/main: Make no-op dispatch function public
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 08:19:54 -07:00
Ian Romanick
9c59d11cd2 mesa/tests: Move stub function to a separate file
When building with shared-glapi, we can just use Mesa's _mesa_warning without
problems.  stubs.cpp is only used when shared-glapi is not used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 08:19:54 -07:00
Ian Romanick
6c01a0e770 mesa: Don't set uniform dispatch pointers for many things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
be66cf950e mesa: Don't set shaderapi dispatch pointers for many things in ES2 or core
v2: Allow GL_ARB_shader_objects functions in core profile because we
still expose the extension string there.  Don't allow
glBindFragDataLocation in GLES3 because it's not part of that API.
Based (mostly) on review comments from Eric Anholt.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
aa0f588e2d mesa: Don't set vtxfmt dispatch pointers for many things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
a13c07f752 mesa: Don't set loopback dispatch pointers for most things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
3ef9e43865 mesa: Pass GL context to _mesa_create_save_table
This isn't used by this patch, but it will be necessary for several
follow-on patches.  Separating this out will make it easier to reorder
patches later.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
ee77061277 mesa: Don't set dispatch pointer for glTexStorage in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
7f7268d385 mesa: Don't set dispatch pointer for glGetProgramivARB in ES2
This function is not the same as glGetProgramiv.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
a83b01371e mesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
1c0a44aaf5 mesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
2a3a68e4c7 mesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
11927bfc4a mesa: Don't set dispatch pointer for glGetBufferSubData in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
850412b8ab mesa: Don't set dispatch pointer for glGetDoublev in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
aa129b0833 mesa: Don't set dispatch pointer for glPointSize in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
66b956618e mesa: Set dispatch pointer for glShaderBinary
NOTE: This is a candiate for stable branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
23ff634c9c gles2: Alias glReadBufferNV with desktop glReadBuffer
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
2012-09-28 08:19:53 -07:00
Chad Versace
b589128620 intel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy
The most recent commit that touched this function,

    commit b1d0fe022d
    Author: Chad Versace <chad.versace@linux.intel.com>
    Date:   Wed Sep 26 11:05:12 2012 -0700

        intel: Fix segfault in intel_texsubimage_tiled_memcpy

did fix the segfault, but introduced yet another bug. From Anholt: """You
need to still test format/type, because that's the incoming format (e.g.
GL_RGBA/GL_FLOAT) that you're trying to memcpy."""

This patch re-introduces the checks on the incoming format and type.

Note: This is a candidate for the 9.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-28 05:04:33 -07:00
Vinson Lee
d239cb1ccf mesa: Fix typo in error message.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-09-27 22:32:10 -07:00
Vincent Lejeune
92b3a99ce5 r600g: add some members to radeon_llvm_context
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-28 01:46:38 +02:00
Vincent Lejeune
a1a3792b18 r600g: tgsi-to-llvm path is taken after declarations have been parsed
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-28 01:46:23 +02:00
Kenneth Graunke
3767b25bd3 meta: Use float for temporary images, not (un)signed normalized.
In commit 091eb15b69, Jordan changed get_temp_image_type() to use
_mesa_get_format_datatype() instead of returning GL_FLOAT.  That has
several possible return values: GL_FLOAT, GL_INT, GL_UNSIGNED_INT,
GL_SIGNED_NORMALIZED, and GL_UNSIGNED_NORMALIZED.

We do want to use GL_INT/GL_UNSIGNED_INT for integer formats.  However,
we want to continue using GL_FLOAT for the normalized fixed-point types.
There isn't any code in pack.c to handle GL_(UN)SIGNED_NORMALIZED.

Fixes oglconform's fboarb advanced.blit.copypix, which was regressed by
commit 091eb15b69.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 15:37:04 -07:00
Chad Versace
7dc0be8a8b intel: Don't advertise GLX_SWAP_COPY_OML
This patch removes all gl_config's with swapMethod=GLX_SWAP_COPY_OML. When
page flipping, we are unable to comply with swap-copy semantics.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-27 14:32:40 -07:00
Eric Anholt
e917ed6eee i965: Remove stale comment about rebuilding tnl_program.
It gets built in Mesa core before we're called these days.

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 13:22:52 -07:00
Eric Anholt
7f9e1a7720 i965: Add a comment explaining one of the brw_draw_upload.c loops.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 13:22:49 -07:00
Eric Anholt
0334e8dc25 i965: Remove broken non-interleaved-to-interleaved upload code.
This failed when all the uploads to occur were uniform-type vertex data (like
glColor4f being active across a DrawArrays), because it would upload 1 element
instead of 1 element per vertex.  There was no citation for how this code
helped any particular application, and it breaks ETQW, so just remove it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47170
NOTE: This is a candidate for the 9.0 and 8.0 branches.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 13:22:43 -07:00
Eric Anholt
f3984fbe33 intel: Remove dead intel_format_to_rb_datatype.
This was for some of the old spans-related code that is now gone.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
9ba6f4733c intel: Mark some file-local code as static.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
e0cd633f17 i965: Mark brw_disasm.c tables as static const.
v2: Make the strings in the tables const, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
837f06b42f i965: Use visibility cflags on the driver code.
The only symbols that need to be public (those in intel_screen.c that the
loader looks for) are already marked public.  Saves 100k of compiled driver
size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-27 12:52:53 -07:00
Eric Anholt
0f331bd385 i965/vp: Remove support for non-ARB_vp, non-NV_vp opcodes.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
57bd069849 i965/vp: Remove support for relative addressing of destination registers.
This was added for GLSL support back in the day.  It's prohibited by both
ARB_vp and NV_vp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
410197974b i965/vp: Remove support for reading destination registers.
It's prohibited by ARB_vp and NV_vp, and not used by fixed function t&l.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
7a7081c45a i965/vp: Remove support for GLSL flow control from the old VS backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Matt Turner
9ed00075d8 build: Link libglapi with pthreads
NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=839060
          https://bugs.gentoo.org/show_bug.cgi?id=435152
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-09-27 10:25:26 -07:00
Matt Turner
7da12426f7 build: Use AX_PTHREAD to detect pthreads
NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-09-27 10:25:20 -07:00
Marek Olšák
96f50d0cf7 r600g: fix EXP on Cayman
NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
fd5c538464 r600g: fix RSQ of negative value on Cayman
NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
836325bf7e r600g: fix instance divisor on Cayman
Not sure if this is the best way to fix it.

NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
933faae2b8 r600g: flush FMASK and CMASK when changing colorbuffers on Evergreen
This fixes rare graphical corruption.

NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
9f5d6320f2 r600g: use invalid DB hardware formats to disable depth/stencil 2012-09-27 19:14:44 +02:00
Chad Versace
b1d0fe022d intel: Fix segfault in intel_texsubimage_tiled_memcpy
The function segfaulted when a game called glTexSubImage2D on a texture
with internalformat/format/type = GL_SLUMINANCE8/GL_BGRA/GL_UNSIGNED_BYTE.

The function only supports MESA_FORMAT_ARGB8888 and returns early if it
detects an unsupported format. Clearly, its detection condition was
insufficient. This patch fixes it to explicity check for
MESA_FORMAT_ARGB8888.

Note: This is a candidate for the 9.0 branch (fixes 413c491).
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-27 07:35:53 -07:00
Kenneth Graunke
6d6aef7974 i965: Do texture swizzling in hardware on Haswell.
Haswell supports EXT_texture_swizzle and legacy DEPTH_TEXTURE_MODE
swizzling by setting SURFACE_STATE entries.  This means we don't have to
bake the swizzle settings into the shader code by emitting MOV
instructions, and thus don't have to recompile shaders whenever the
swizzles change.

Unfortunately, we can't handle GL_ALPHA this way: unlike all the others,
which store the comparison result in the .r channel (and possibly others
as well), GL_ALPHA puts it in the .a channel.  The GLSL 1.30+ style
functions which return a float always simply return the .r channel,
which would be zero if we handled this as a surface override.  In this
case, fall back to doing it the old way.  DEPTH_TEXTURE_MODE = GL_ALPHA
isn't an interesting performance path anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 22:58:30 -07:00
Kenneth Graunke
b5a042a657 i965: Refactor texture swizzle generation into a helper.
It's going to be reused in a second place soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 22:58:30 -07:00
Vincent Lejeune
ff947c6d65 radeon/llvm: improve select_cc lowering to generate CND* more often
v2: - Simplify isZero()
    - Remove a unused function prototype
    - Clean whitespace trails

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-27 01:43:35 +02:00
Chad Versace
bb7ecb29fb intel: Fix size of temporary etc1 buffer
Fixes valgrind errors in piglit test
oes_compressed_etc1_rgb8_texture-miptree: an invalid write in
_mesa_store_compressed_store_texsubimage() at line 4406 and invalid reads
in texcompress_etc_tmp.h:etc1_parse_block().

The calculation of the size of the temporary etc1 buffer allocated by
intel_miptree_map_etc1() was incorrect. Sometimes the allocated buffer was
too small, sometimes too large.  This patch corrects the size to that
expected by _mesa_store_compressed_store_texsubimage().

Note: This is candidate for the 9.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-26 09:47:46 -07:00
Alex Deucher
0aa47b2d8b radeonsi: fix truncated register define.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-26 10:07:46 -04:00
Brian Paul
3ba9dbbabf mesa: move _mesa_es_error_check_format_and_type() to glformats.c
Where the non-ES _mesa_error_check_format_and_type() function lives.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 07:43:49 -06:00
Brian Paul
8348076ae4 mesa: move GL_HALF_FLOAT_OES definition to glheader.h
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 07:43:49 -06:00
Brian Paul
b52e05cecb mesa: minor fix to glTexSubImage error message 2012-09-26 07:43:49 -06:00
Brian Paul
d3aa6a5c56 mesa: consolidate sub-texture error checking code
Do all error checking of glTexSubImage, glCopyTexSubImage and
glCompressedTexSubImage's xoffset, yoffset, zoffset, width, height, and
depth params in one place.
2012-09-26 07:43:49 -06:00
Brian Paul
7e1ad9cd37 mesa: consolidate glTexSubImage() error checking 2012-09-26 07:43:49 -06:00
Brian Paul
f830f10a37 mesa: consolidate glCompressedTexSubImage() error checking
Do all the checking in one function instead of two and fix up some of
the error checking.alignment check
2012-09-26 07:43:49 -06:00
Brian Paul
bd3caa50a5 mesa: consolidate subtexture xoffset/yoffset/width/height error checking code
This is the code that checks if a subtexture region is aligned to the
compressed format's block size.
2012-09-26 07:43:49 -06:00
Brian Paul
2558af7e93 mesa: consolidate glCopyTexSubImage error checking
Do all the checking in one function instead of two.
2012-09-26 07:43:49 -06:00
Brian Paul
1f586684d6 mesa: fix incorrect error for glCompressedSubTexImage
If a subtexture region isn't aligned to the compressed block size,
return GL_INVALID_OPERATION, not gl_INVALID_VALUE.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-26 07:43:49 -06:00
Christian Koenig
421eeff463 radeonsi: move draw cmds to si_commands.c
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:35 +02:00
Christian Koenig
7773c7109c radeonsi: start seperating commands into si_commands.c
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:31 +02:00
Christian Koenig
3c51c60ed0 radeonsi: get rid of evergreen_hw_context.c
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:27 +02:00
Christian Koenig
fcc9c125f4 radeonsi: remove unused code
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:23 +02:00
Christian König
04473db38a radeonsi: start reworking inferred state handling
Instead of tracking the inferred state changes separately
just check if queued and emitted states are the same.

This patch just reworks the update of the SPI map between
vs and ps, but there are probably more cases like this.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:04:36 +02:00
Paul Berry
112caa853d gles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.
GLES 3 supports sRGB functionality, but it does not expose the
GL_FRAMEBUFFER_SRGB enable/disable bit.  Instead the implementation
is expected to behave as though that bit is always enabled.

This patch ensures that ctx->Color.sRGBEnabled (the internal variable
tracking GL_FRAMEBUFFER_SRGB) is initially true in GLES 2/3 contexts,
and that it cannot be modified through the GLES 3 API.

This is safe for GLES 2, since ctx->Color.sRGBEnabled has no effect on
non-sRGB formats, and GLES 2 doesn't support any sRGB formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-25 15:02:43 -07:00
Paul Berry
414f69aaad meta: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.
Previously, meta logic was saving and restoring the value of
GL_FRAMEBUFFER_SRGB in an ad-hoc fashion.  As a result, it was not
properly disabled and/or restored for some meta operations.

This patch causes GL_FRAMEBUFFER_SRGB to be saved/restored in the
conventional way of meta-ops (using _mesa_meta_begin() and
_mesa_meta_end()).  It is now reliably saved/restored for
_mesa_meta_BlitFramebuffer, _mesa_meta_GenerateMipmap, and
decompress_texture_image, and preserved for all other meta ops.

Fixes piglit tests "ARB_framebuffer_sRGB/blit renderbuffer
{linear_to_srgb,srgb} scaled {disabled,enabled}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-25 15:01:13 -07:00
Paul Berry
8faa79764c enable: Create _mesa_set_framebuffer_srgb() function for use by meta ops.
GLES3 supports sRGB formats, but it does not support the
GL_FRAMEBUFFER_SRGB enable/disable flag (instead it behaves as if this
flag is always enabled).  Therefore, meta ops that need to disable
GL_FRAMEBUFFER_SRGB will need a backdoor mechanism to do so when the
API is GLES3.

We were already doing a similar thing for GL_MULTISAMPLE, which has
the same constraints.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-25 15:01:13 -07:00
Matt Turner
399a03fdd6 targets/xorg-i915: Rename driver to i915_drv.so.
modesetting_drv.so is undescriptive and collides with
xf86-video-modesetting.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-09-25 12:04:10 -07:00
Chad Versace
413c491412 intel: Improve teximage perf for Google Chrome paint rects (v3)
This patch reduces the time spent in glTexImage and glTexSubImage by
over 5x on Sandybridge for the workload described below.

It adds a new fast path for glTexImage2D and glTexSubImage2D,
intel_texsubimage_tiled_memcpy, which is optimized for Google Chrome's
paint rectangles. The fast path is implemented only for 2D GL_BGRA
textures for chipsets with a LLC.

=== Performance Analysis ===

Workload description:

    Personalize your google.com page with a wallpaper.  Start chromium
with flags "--ignore-gpu-blacklist --enable-accelerated-painting
--force-compositing-mode".  Start recording with chrome://tracing. Visit
google.com and wait for page to finish rendering.  Measure the time spent
by process CrGpuMain in GLES2DecoderImpl::HandleTexImage2D and
HandleTexSubImage2D.

System config:

    cpu: Sandybridge Mobile GT2+ (0x0126)
    kernel 3.4.9 x86_64
    chromium 21.0.1180.89 (154005)

Statistics:

                  | N   Median  Avg   Stddev
    --------------|-------------------------
    before (msec) | 8   472.5  463.75 72.6
    after  (msec) | 8    78.0   79.6   5.7

    Arithmetic difference at 95.0% confidence:
       -384.1  +/- 55.2 msec
        -82.8% +/- 11.9%

    Ratio at 95.0% confidence:
          5.81 +/- 0.119

v2:
    - Replace check for `intel->gen >= 6` with `intel->has_llc`, per
      danvet.
    - Fix typo in comment, s/throuh/through/.
    - Swap 'before' and 'after' rows in stat table.

v3:
    - If the current batch references the bo, then flush batch before mapping
      the bo. Found by Chris.
    - Restrict supported texture images to level 0 of target
      GL_TEXTURE_2D. This avoids an arithmetic bug in calculating image
      offsets within the miptree, found by Paul. This restriction does not
      diminish this patch's benefit to Chrome OS performance.
    - Use less instructions for bit6 swizzling, suggested by Paul.
    - Remove erroneous comment about Y-tiling, for Paul.
    - Print perf_debug messages when flushing and stalling.
    - Update stats in commit message; run workload under a release build
      rather than a debug build.

Note: This is a candidate for the 9.0 branch.
Acked-by: Eric Anholt <eric@anholt.net>
CC: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-25 10:58:45 -07:00
Tom Stellard
581619f5a7 clover: Fix build with libclang v3.2
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-25 14:36:51 +00:00
Tom Stellard
71682cf65b clover: Query device for CL_DEVICE_MAX_MEM_ALLOC_SIZE v2
v2:
  - Use driver reported values and don't correct them to the OpenCL
    required minimum.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-25 14:36:50 +00:00
Tom Stellard
0e3c30cd6f gallium: Add PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE v2
v2:
  - Add comment in screen.rst
  - Report OpenCL required minimum for r600g
2012-09-25 14:36:50 +00:00
Tom Stellard
b57eba3654 r600g: Handle multiple kernels in the same program v2
v2:
  - Use pc parameter of launch_grid
2012-09-25 14:36:46 +00:00
Blaž Tomažič
e59505e34b clover: Handle multiple kernels in the same program v2
v2: Tom Stellard
  - Use pc parameter of launch_grid()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-25 14:27:47 +00:00
Brian Paul
68a4bb553b mesa: remove 'struct' from texenv_fragment_program
texenv_fragment_program is declared as a class.  Fixes warnings with MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-25 08:23:18 -06:00
Kenneth Graunke
097b4a3b28 i965: Allow fast depth clears if scissoring doesn't do anything.
A game we're working with leaves scissoring enabled, but frequently sets
the scissor rectangle to the size of the whole screen.  In that case,
scissoring has no effect, so it's safe to go ahead with a fast clear.

Chad believe this should help with Oliver McFadden's "Dante" as well.

v2/Chad: Use the drawbuffer dimensions rather than the miptree slice
dimensions.  The miptree slice may be slightly larger due to alignment
restrictions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-and-tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-09-25 07:03:59 -07:00
Paul Berry
ab5ce2789f i965: Don't spill "smeared" registers.
Fixes an assertion failure when compiling certain shaders that need both
pull constants and register spilling:

brw_eu_emit.c:204: validate_reg: Assertion `execsize >= width' failed.

NOTE: This is a candidate for release branches.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-25 07:02:14 -07:00
Jay Cornwall
374925bec9 nv50/ir/ra: Fix register interference tracking.
See fdo bug 55224.
2012-09-25 14:00:51 +02:00
Paul Berry
124b214f09 i965/blorp: Fix sRGB MSAA resolves.
Commit e2249e8c4d (i965/blorp: Add
support for blits between SRGB and linear formats) changed blorp to
always configure surface states for in linear format (even if the
underlying surface is sRGB).  This allowed sRGB-to-linear and
linear-to-sRGB blits to occur without causing the image to be
inappropriately brightened or darkened.

However, it broke sRGB MSAA resolves, since they rely on the
destination buffer format being sRGB in order to ensure that samples
are averaged together in sRGB-correct fashion.

This patch fixes the problem by instead configuring the source buffer
to use the *same* format as the destination buffer.  This ensures that
the image won't be brightened or darkened, but preserves proper sRGB
averaging.

Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb".

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

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-24 17:03:36 -07:00
Jonas Maebe
5fdf1f784b darwin: do not create double-buffered offscreen pixel formats
http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-09-24 16:06:07 -07:00
Tom Stellard
92b033a89e radeon/llvm: Fix instruction encoding for r600 family GPUs
Tested-by: Michel Dänzer <michel.daenzer@amd.com>

https://bugs.freedesktop.org/show_bug.cgi?id=55217
2012-09-24 17:01:31 -04:00
Brian Paul
24a8e0c3da build: remove signbit check in configure.ac
We now have a fallback macro in imports.h
This reverts part of 0f3ba405.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-24 14:48:23 -06:00
Brian Paul
14ca76646a mesa: add signbit() macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-24 14:48:06 -06:00
Tom Stellard
defe8f0da2 r600g: Set RADEON_FLUSH_KEEP_TILING_FLAGS when emitting compute cs 2012-09-24 18:35:50 +00:00
Robert Bragg
dda49c3cb7 build: substitute X11_INCLUDES variable
There are a few automake files that reference $(X11_INCLUDES) such as
src/glx/Makefile.am but configure.ac wasn't declaring the variable for
substitution. This would break builds of glx if libxcb, for example, was
installed in its own prefix since AM_CFLAGS wouldn't coincidentally
list the needed include path in that case.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-24 09:49:53 -07:00
Matt Turner
0f3ba405ea Use signbit() in IS_NEGATIVE and DIFFERENT_SIGNS
signbit() appears to be available everywhere (even MSVC according to
MSDN), so let's use it instead of open-coding some messy and confusing
bit twiddling macros.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54805
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-24 09:45:17 -07:00
Francisco Jerez
959fe586fb clover: Silence narrowing conversion warnings in resource.cpp. 2012-09-24 18:36:34 +02:00
Tom Stellard
01877a6fd0 clover: Handle NULL value for clEnqueueNDRangeKernel local_work_size
[ Francisco Jerez: Slight simplification. ]
2012-09-24 18:35:43 +02:00
Paul Berry
a33ce665a5 i965/blorp: Increase Y alignment for multisampled stencil blits.
This patch is a band-aid fix for a bug in commit 5fd67fa (i965/blorp:
Reduce alignment restrictions for stencil blits), which causes
multisampled stencil blits to work incorrectly on Sandy Bridge.

When blitting to or from a normal stencil buffer, we have to use a
coordinate transformation that swizzles coordinates to account for the
fact that stencil buffers use W tiling, but the most similar tiling
format available for textures and render targets is Y tiling.  The
differences between W and Y tiling cause pixels to be scrambled within
a block of size 8x4 (width x height) as measured relative to a W tile,
or 16x2 as measured relative to a Y tile.  So in order to make sure
that pixels at the edges of the blit aren't lost, we need to align the
rendering rectangle (and the buffer sizes) to multiples of the 8x4
block size.  This alignment happens in the brw_blorp_blit_params
constructor, whereas the determination of how to swizzle the
coordinates happens during code generation, in the
brw_blorp_blit_program class.

When blitting to or from a multisampled stencil buffer, the coordinate
swizzling is more complex, because it has to account for the
interleaving pattern of samples, which uses 4x4 blocks for 4x MSAA and
8x4 blocks for 8x MSAA.  The end result is that if multisampling is in
use, the 16x2 block size (relative so a Y tile) needs to be expanded
to 16x4, and the corresponding size relative to a W tile expands to
8x8.

The problem doesn't affect Ivy Bridge severely enough to crop up in
Piglit tests because on Ivy Bridge we have to disable multisampling
when blitting *to* a multisampled stencil buffer (the blorp compiler
generates code to compensate for the fact that multisampling is
disabled).  However I suspect a bug is still present because we don't
disable multisampling when blitting *from* a multisampled stencil
buffer.

This patch fixes the problem by doubling the vertical alignment
requirement when blitting to or from a multisampled stencil buffer,
and multisampling has not been disabled.

In the long run I would like to rework the brw_blorp_blit_params
constructor--it's difficult to follow and has had several subtle bugs
like this one.  However this band-aid fix should be suitable for
cherry-picking to release branches.

Fixes Piglit tests "unaligned-blit {2,4} stencil {msaa,upsample}" on
Sandy Bridge.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-24 09:07:31 -07:00
Brian Paul
68060cfb2b upgrade glext.h to version 85
NOTE: This is a candidate for the stable branches.
2012-09-24 08:07:08 -06:00
Brian Paul
f1c448d2e5 st/mesa: check for zero-size image in st_TestProxyTexImage()
Fixes divide by zero issue in llvmpipe driver.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-09-24 07:58:45 -06:00
Kenneth Graunke
c432c86e6a mesa: Silence narrowing warnings in ff_fragment_shader's emit_texenv().
Recent version of GCC report a warning for the implicit conversion from
int to float:

  ff_fragment_shader.cpp:897:3: warning: narrowing conversion of '(1 << ((int)rgb_shift))' from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing]

This is because floats cannot precisely represent all possible 32-bit
integer values.  However, texenv code is all expected to be floating
point, so this should not be a problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-23 22:38:58 -07:00
Marek Olšák
60e610e042 docs: fixup GL4.3 TODO list
From the OpenGL Registry:
  "2012/08/13: specs named GL_ARB_debug_group, GL_ARB_debug_label, and
   GL_ARB_debug_output2 were published in error during the initial OpenGL 4.3
   release. All functionality in these documents was combined into
   the extension GL_KHR_debug. They have been withdrawn from the registry,
   and a few other extensions were renumbered to avoid holes in the numbering
   scheme."
2012-09-23 17:19:52 +02:00
Vincent Lejeune
fb40f88338 radeon/llvm: support for interpolation intrinsics
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-22 18:12:11 +02:00
Marek Olšák
2988fa940e draw: fix non-indexed draw calls if there's an index buffer
pipe_draw_info::indexed determines if it should be indexed and not
the presence of an index buffer.

This fixes crashes in r300g.

NOTE: This is a candidate for the stable branches.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-22 14:20:37 +02:00
Tom Stellard
bbb2ebe2fc r600g: Fix build with LLVM compiler 2012-09-21 20:07:14 -04:00
Marek Olšák
bfe489c76b r600g: set QUANT_MODE on Cayman too
This fixes piglit/fbo-blit-stretched.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:59 +02:00
Marek Olšák
11e2a41b84 r600g: use CS helpers to emit streamout state
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:59 +02:00
Marek Olšák
669bfaaa1e r600g: remove initialization of unused loop register tables
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:59 +02:00
Marek Olšák
b71701d43e r600g: remove now-unused SURFACE_BASE_UPDATE logic
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Marek Olšák
e3ecfecada r600g: remove unused CB registers from register lists
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Marek Olšák
c8b06dccff r600g: atomize framebuffer state
Tested on RS880, Evergreen and Cayman.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Marek Olšák
b652180107 r600g: don't snoop context state while building shaders
Let's use the shader key describing the state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Anuj Phogat
eb1d87fb94 meta: Add on demand compilation of per target shader programs
A call to glGenerateMipmap() follows the generation of a relevant
shader program in setup_glsl_generate_mipmap().

To support all texture targets and to avoid compiling shaders
everytime, per target shader programs are compiled on demand
and saved for the next call.

Fixes float-texture(mipmap.manual):
See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-21 13:31:58 -07:00
Tom Stellard
8ed9aaea51 clover: Initialize height and depth to 1 for transfers
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-21 19:45:17 +00:00
Tom Stellard
024e1732cb pipe-loader: Remove a few debug_printfs
On debug builds these were always being printed.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-21 19:45:07 +00:00
Tom Stellard
438b1da7e5 radeon/llvm: Handle loads from the constants address space.
Reading from constant memory is not supported yet, so constant reads use
global memory.
2012-09-21 19:30:58 +00:00
Tom Stellard
3882d7b5e4 radeon/llvm: Add support for v4f32 stores on R600 2012-09-21 19:30:58 +00:00
Tom Stellard
e866dbd1b5 radeon/llvm: Add support for i8 reads on R600 2012-09-21 19:30:57 +00:00
Tom Stellard
b282c9611e radeon/llvm: Expand vector fadd and fmul on R600 2012-09-21 19:30:57 +00:00
Tom Stellard
aa8367dd13 radeon/llvm: Add optimization for FP_ROUND 2012-09-21 19:30:57 +00:00
Tom Stellard
87decd6e66 radeon/llvm: Replace AMDGPU pow intrinsic with the llvm version 2012-09-21 19:30:53 +00:00
Paul Berry
aa3c2e3186 i965/blorp: Fix narrowing warnings.
Blorp has to convert rectangle coordinates from integers to floats in
order to send them down the GPU pipeline.  Recent versions of GCC
issue a warning for this, since a float is not capable of precisely
representing all possible 32-bit integer values.  Suppress the warning
with an explicit type cast in the case of blorp, since rectangle
coordinates will never be large enough to cause a loss of precision.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-21 10:53:25 +02:00
Kenneth Graunke
cd49025aff i965: Remove brw_set_predicate_inverse(p, true) from scratch offset code
Given that it exists between a push/pop of instruction state, this call
can only affect the MOV or ADD instruction generated just below it.
Neither of those instructions are predicated, so it makes no sense to
ask for the inverse predicate.

This fixes grumblings from the simulator debugger, which was
complaining about an invalid predicate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-21 01:29:40 -07:00
Kenneth Graunke
328961d955 mesa: Don't override S3TC internalFormat if data is pre-compressed.
Commit 42723d88d intended to override an S3TC internalFormat to a
generic compressed format when the application requested online
compression of uncompressed data.  Unfortunately, it also broke
pre-compressed textures when libtxc_dxtn isn't installed but the
extensions are forced on.

Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which
calls _mesa_choose_texture_format(), hitting this override code.  If we
have actual S3TC source data, we can't treat it as any other format, and
need to avoid the override.

Since glCompressedTexImage2D() passes in a format of GL_NONE (which is
illegal for glTexImage), we can use that to detect the pre-compressed
case and avoid the overrides.

Fixes a regression since 42723d88d3.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-20 14:49:19 -07:00
Kenneth Graunke
e2249e8c4d i965/blorp: Add support for blits between SRGB and linear formats.
Fixes colorspace issues in L4D2 when multisampling is enabled (the
scene was far too dark, but the flashlight area was way too bright).

The nVidia and AMD binary drivers both allow this kind of blit.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-20 14:48:02 -07:00
Kenneth Graunke
c96828ecb4 mesa: Ignore SRGB when determining compatible resolve formats.
MSAA resolves and other blit-like operations ignore SRGB state anyway,
so we should be able to safely allow resolves between compatible
SRGB/linear formats like SRGBA8 and RGBA8888.

This matches the behavior of the nVidia and AMD binary drivers.

Fixes completely black rendering when using multisampling in L4D2.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-20 14:47:23 -07:00
Andreas Boll
8504f18c3d docs: update some more FAQs
v2: remove mention of XFree86

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:37 +02:00
Andreas Boll
0188b9371f docs: remove utility.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:37 +02:00
Andreas Boll
19195781c8 docs: remove science.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:37 +02:00
Andreas Boll
19fe84d8df docs: remove modelers.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
ca6ff299c5 docs: remove libraries.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
b1c75e7257 docs: remove games.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
9e2af606b6 docs/contents: add autoconf.html link
make it easier to find the docs/autoconf.html site

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
7b314b3b14 docs: convert last traces of progs to mesa/demos repository
v2: fix typo

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
356a73145e docs: add IRC info
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
76d4f9e404 docs/egl: improve markup
replace unordered list <ul> with defined list <dl>

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
63eade4b60 docs/autoconf: improve markup
replace unordered list <ul> with defined list <dl>

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
ab06629d5d docs/autoconf: remove obsolete demo options
removed with commit 56c3cce2a1
two years ago

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
d61707d0f8 docs: improve quality of gears.png
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Brian Paul
58f386b20b gallium: mention PIPE_TIMEOUT_INFINITE in the fence_finish() comment 2012-09-20 09:49:12 -06:00
Brian Paul
0bcad02955 llvmpipe: fix overflow bug in total texture size computation
v2: use uint64_t for the total_size variable, per Jose.

Also add two earlier checks for exceeding the max texture size.
For example a 1K^3 RGBA volume would overflow the lpr->image_stride
variable.

Use simple algebra to avoid overflow in intermediate values.
So instead of "x * y > z" use "x > z / y".

This should work if we happen to be on a platform that doesn't have
64-bit types.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-20 09:47:09 -06:00
Alex Deucher
7b4aefd3c9 r600g/llvm: rs780/rs880 are r600 asics
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-20 11:17:52 -04:00
Ian Romanick
ae3023e967 mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT
This was already (correctly) supported for glGetSamplerParameter paths.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 11:42:56 +02:00
Tom Stellard
bd8fb9e805 r300/compiler: Use precomputed q values in the register allocator 2012-09-19 19:25:53 -04:00
Tom Stellard
886a4d4a6a r300g: Init regalloc state during context creation
Initializing the regalloc state is expensive, and since it is always
the same for every compile we only need to initialize it once per
context.  This should help improve shader compile times for the driver.
2012-09-19 19:25:53 -04:00
Tom Stellard
9282adcae9 r300/compiler: Don't create register classes for inputs 2012-09-19 19:25:53 -04:00
Tom Stellard
e0f64a837f ra: Add q_values parameter to ra_set_finalize()
This allows the user to pass precomputed q values to the allocator.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-19 19:25:53 -04:00
Tom Stellard
cfeb99c7da ra: Clarify usage of ra_set_node_reg()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-19 19:25:53 -04:00
Tom Stellard
69b387fbdc r600g: Invalidate texture cache when creating vertex buffers for compute v2
Compute shaders fetch data from vertex buffers via the texture cache, so
we need to make sure the texture cache is flushed.

v2:
  - Fix rebase mistake
  - Fix spelling in comment

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
810345492e r600g: Use LOOP_START_DX10 for loops
LOOP_START_DX10 ignores the LOOP_CONFIG* registers, so it is not limited
to 4096 iterations like the other LOOP_* instructions.  Compute shaders
need to use this instruction, and since we aren't optimizing loops with
the LOOP_CONFIG* registers for pixel and vertex shaders, it seems like
we should just use it for everything.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
3e3ca92718 r600g: Set the correct value of COLOR*_DIM for RATs
For buffers (which is what is being used for RATs), the
COLOR*_DIM.WIDTH_MASK field needs to be set to the low 16-bits of the
buffer size, and the COLOR*_DIM.HEIEGHT_MAX needs to be set to the
high bits.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
9db64530bb r600g: Make sure to initialize DB_DEPTH_CONTROL register for compute
The kernel CS checker will fail if this register is not initialized.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
69d814885b r600g: Add some comments and debug printfs to compute code
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
6bd11bc9d5 r600g: Add missing break to case statement 2012-09-19 15:27:32 -04:00
Michal Sciubidlo
0e0c21e00e radeon/llvm: Emit ISA for ALU instructions in the R600 code emitter
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-19 13:17:41 -04:00
Tom Stellard
d525ed1a84 radeon/llvm: Only support 512 constant registers on R600
This is necessary upcoming encoding changes, since we will only be
using 9-bits for register encoding.
2012-09-19 13:11:36 -04:00
Andreas Boll
5abb1f8bde docs: update faq 2012-09-19 18:23:45 +02:00
Andreas Boll
0aad2e400c docs: update sourcetree
- add OpenCL state tracker Clover

- add XvMC state tracker

- remove progs
  directory got moved into its own repository mesa/demos

- remove vf
  directory removed with abda64efce
2012-09-19 18:23:45 +02:00
Andreas Boll
7a40dc1992 docs: remove obsolete r300c traces 2012-09-19 18:23:45 +02:00
Brian Paul
ead9cfdcc4 Revert "mesa: consolidate subtexture x/y/width/height error checking code"
This reverts commit 5b807400a8.

accidentally pushed.
2012-09-19 10:07:45 -06:00
Brian Paul
e1e302c7f6 Revert "more comment"
This reverts commit 5205db6a7c.

accidentally pushed
2012-09-19 10:07:34 -06:00
Brian Paul
f51d232e5f Revert "mesa: clean-up and fix glCompressedTexSubImage error checking"
This reverts commit 0c67fe5d2d.

accidentally pushed.
2012-09-19 10:07:22 -06:00
Brian Paul
7c8c90c4e4 docs: fix "Cppyright" typo 2012-09-19 10:01:04 -06:00
Brian Paul
0c67fe5d2d mesa: clean-up and fix glCompressedTexSubImage error checking 2012-09-19 09:21:03 -06:00
Brian Paul
5205db6a7c more comment 2012-09-19 09:21:03 -06:00
Brian Paul
5b807400a8 mesa: consolidate subtexture x/y/width/height error checking code
This is the code that checks if a subtexure region is aligned to the
compressed format's block size.
2012-09-19 09:21:03 -06:00
Andreas Boll
a73c59b7a6 docs: remove obsolete target attribute 2012-09-19 17:15:48 +02:00
Andreas Boll
7b09254883 docs: news.html is the new index.html 2012-09-19 17:15:47 +02:00
Andreas Boll
ac5cee934f docs: remove obsolete frame layout 2012-09-19 17:15:47 +02:00
Andreas Boll
b5da52ac58 docs: add new iframe layout 2012-09-19 17:15:47 +02:00
Andreas Boll
ad05f2e429 docs/news: linkify some active links 2012-09-19 17:15:45 +02:00
Andreas Boll
cc7eea955a docs/news: deactivate dead links
I have left the links as <code> elements for the purpose of
documentation.
2012-09-19 17:15:39 +02:00
Andreas Boll
6e0c2702e3 docs/news: drop redundant link 2012-09-19 17:15:34 +02:00
Andreas Boll
9ddf74d443 docs/news: update link 2012-09-19 17:15:31 +02:00
Andreas Boll
83937a2c0f docs/news: remove link to a non-existent page 2012-09-19 17:15:24 +02:00
Andreas Boll
6fb8aeb2c5 docs: fix some issues in relnotes
improve markup
fix link to relnotes-9.0
add missing relnotes links
2012-09-19 12:12:38 +02:00
Andreas Boll
abb1c847ac docs/devinfo: fix typo 2012-09-19 12:10:32 +02:00
Vadim Girlin
9aa8bac98b winsys/radeon: fix relocs caching
Don't cache pointers to elements of reallocatable array.
In some circumstances it caused false cache hits resulting in incorrect
command stream and gpu lockup.

Note: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 04:48:16 +04:00
Vincent Lejeune
175fdd7b86 radeon/llvm: Add a fdiv pattern.
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-09-18 18:00:20 +02:00
Vincent Lejeune
12c4526157 radeon/llvm: reserve also corresponding 128bits reg
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-09-18 17:59:51 +02:00
Andreas Boll
88c3647e0b docs: drop obsolete sourceforge link
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-18 08:32:50 -06:00
Brian Paul
7d624799b9 softpipe: implement the new can_create_resource() function
And define a SP_MAX_TEXTURE_SIZE value as we do in llvmpipe.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
b9e88c5592 llvmpipe: implement the new can_create_resource() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
ead8847d44 st/mesa: implement new proxy texture code
If the gallium driver implements the can_create_resource() function, call
it to do proxy texture size checks.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
bd8b43a9f4 gallium: add new pipe_screen::can_create_resource() function
Used to implement proxy textures.  If a gallium driver doesn't implement
this function we'll just continue to use the core Mesa fallback code.

Without this hook we really have no good way to implement OpenGL proxy
textures with gallium drivers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
a0fc7620f5 mesa: take cube faces into account in _mesa_test_proxy_teximage()
There will always be six cube faces so take that into consideration when
computing the texture size and comparing against the limit.
2012-09-17 19:49:27 -06:00
Brian Paul
90ca4c0c62 mesa: handle GL_PROXY_TEXTURE_CUBE_MAP in _mesa_num_tex_faces() 2012-09-17 19:49:27 -06:00
Brian Paul
df73be9105 llvmpipe: set max cube texture size to 4K x 4K
Before, the limit was 8K.  For 32-bit RGBA that would be require 1.5 GB
of memory (w/out mipmaps).  That's well beyond the LP_MAX_TEXTURE_SIZE
of 1GB.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
7dc76e9424 mesa: move/fix levels check for glTexStorage()
Fix copy&paste error and move min levels check closer to max levels check.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
ff24ed09fa mesa: rewrite glTexStorage() code
Simplify the code and make it more like the other glTexImage commands.
Call _mesa_legal_texture_dimensions() to validate width, height, depth.
Call ctx->Driver.TestProxyTexImage() to make sure texture is not too large.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
e6eaa85a43 mesa: rework texture size error checking
There are two aspects to texture image size checking:
1. Are the width, height, depth legal values (not negative, not larger
   than the max size for the mipmap level, etc)?
2. Is the texture just too large to handle?  For example, we might not be
   able to really allocate memory for a 3D texture of maxSize x maxSize x
   maxSize.

Previously, we did (1) via the ctx->Driver.TestProxyTextureImage() hook
but those tests are really device-independent.  Now we do (2) via that
hook since the max texture memory and texture shape are device-dependent.

Also, (1) is now done outside the general texture parameter error checking
functions because of the special interaction with proxy textures.  The
recently introduced PROXY_ERROR token is removed.

The teximage() and copyteximage() functions are bit simpler now (less
if-then nesting, etc.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
ce2ae3c3a2 mesa: refactor _mesa_test_proxy_teximage() code
Basically, move the body into a new _mesa_legal_texture_dimensions() function.
More refactoring to come.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
b1874ec931 mesa: move glTexImage 'level' error checking
Move level checking out of _mesa_test_proxy_teximage() and into
the other error-checking functions.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
35f16600b3 mesa: change create_version_string() return type to void
Fixes "warning: no return statement in function returning non-void"
2012-09-17 19:46:20 -06:00
Dave Airlie
1ce9f25fde glsl: make _mesa_builtin_uniform_desc static
I can't see any reason this is global (unless for debugging)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-18 07:57:42 +10:00
Tom Stellard
bfd55711c1 radeon/llvm: Inital flow control support for SI
This adds basic flow control support for If-Then-Else blocks using
predicates (stored in the EXEC register) and a predicate stack for
nested flow control.
2012-09-17 21:09:43 +00:00
Xinya Zhang
ef0d7e13d7 r600g: Close a memory leak of llvm byte streams
No regressions found in the tests of opencl-example/run_tests.sh.

Signed-off-by: Xinya Zhang <zxy_thf@hotmail.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 21:09:43 +00:00
Tom Stellard
0b1a182905 radeon/llvm: Fix unused variable warning 2012-09-17 21:09:43 +00:00
Tom Stellard
059a56bddb radeon/llvm: Move kernel arg lowering into R600TargetLowering class 2012-09-17 21:09:43 +00:00
Jordan Justen
9fac1d1c3a main/version: consolodate version string creation for ES/Desktop GL
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-17 13:42:09 -07:00
Eric Anholt
81dff4f752 i965: Stop putting 8 NOPs after each prorgam.
As far as I can see, the intention of the requirement that we do so is to
prevent instruction prefetch from wandering out into either unmapped memory or
memory with a different caching type, and hanging the chip.  The kernel makes
sure that the page after your BO has a valid page of the same caching type,
which meets this requirement, so there's no need to waste space between our
programs (and in instruction cache) on this.

Saves another 9kb instructions in l4d2 shaders.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-17 12:32:52 -07:00
Eric Anholt
3e165ba62c i965: Test instruction compaction on gen7 2012-09-17 12:32:52 -07:00
Kenneth Graunke
bce72170ea i965: Add support for instruction compaction on Gen7.
Reduces l4d2 program size from 1195kb to 919kb.  Improves performance by 0.22%
+/- 0.11% (n=70).

v2: Rebase on compaction v2, fix up flag reg handling (by anholt).
v3: Fix uncompaction of the flag register number.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-17 12:32:52 -07:00
Eric Anholt
f25aefcebe i965: Support instruction compaction between control flow.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
077d01b673 i965: Add support for instruction compaction.
This reduces program size by using some smaller encodings for common bit
patterns in the Gen ISA, with the hope of making programs fit in the
instruction cache better.

v2: Use larger bitshifts for the uncompressed field setups, in line with the
    way it's described in the spec.  Consistently name a brw_compile "p" like
    all other code.  Add a couple more tests.  Consistently call things
    "compacted" not "compressed" (which is a different feature).  Drop the
    explicit check for not compacting SENDs, which is unjustified and already
    implied by our lack of support for immediate values.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
f5e2706395 i965: Prepare the break/cont uip/jip setting for compacted instructions.
The first cut at instruction compaction won't compact things that
would change control flow jump distances, but we do need to still be
able to walk the instruction stream, which involves jumping by 8 or 16
bytes between instructions.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
f2bd3e70b5 i965: Move program dump to a helper function in brw_eu.c.
It's going to get more complicated when we do instruction compaction.  This
also introduces putting the program offset in the output.

v2: Use next_insn_offset in brw_get_program(), too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
826ecbbe6e i965: Make a linkable library for the contents of i965_dri.so.
To do unit testing of i965, we want to be able to link against the
driver's symbols and prod them.  If we don't have a separate lib from
our loadable module, libtool gets super whiny.

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
5dafee1853 dri: Reuse dri_test.c for stub glapi symbols for unit testing.
This file is used to provide stubs for the link test in gallium dri drivers.
But the same stubs without the main can be used for making unit tests for code
in a dri driver.

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
3f98ba9c43 i965: Clear brw_compile on setup.
I noticed in valgrind that p->single_program_flow was used while
uninitialized.  Everything else zeroed out brw_compile, but this is better
API.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Andreas Boll
99f14bc789 docs: remove obsolete mesa subset documentation
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-17 10:34:12 -06:00
Michel Dänzer
14c12ca331 radeon/llvm: Match integer add/sub for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:05:49 +02:00
Michel Dänzer
8d7dd68d2a radeon/llvm: Complete integer comparison patterns for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:03:41 +02:00
Michel Dänzer
97d3d25e1c radeon/llvm: Match AMDGPUfract on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:02:01 +02:00
Michel Dänzer
39fb7faf95 radeon/llvm: Match int_AMDGPU_floor for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 17:30:09 +02:00
Michel Dänzer
6d3a1a5361 radeon/llvm: Match vector logical operations on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 17:12:08 +02:00
Brian Paul
7b6b447fa3 softpipe: update SP_MAX_TEXTURE_3D_LEVELS comment
9 levels = max size of 256 texels.
2012-09-16 19:00:20 -06:00
Tomeu Vizoso
68d1a3afd4 mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs
instead of just for GL and ES1.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-16 12:03:29 -07:00
Chris Forbes
d30a7d2eb4 mesa: fix dropped && in glGetStringi()
This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously,
all extension names returned would be NULL.

NOTE: This is a candidate for release branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-16 01:47:00 -07:00
Kenneth Graunke
679c93ff89 meta: Don't _mesa_set_enable() invalid targets in ES 1.
GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and
GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops
that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL
errors.  One such operation is _mesa_meta_Clear().

On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead.

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comment.
v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-15 20:13:09 -07:00
José Fonseca
b6c2234c22 Temporarily revert "mesa: remove remaining FEATURE_* defines where protected by API check."
This reverts commit 9f37b405a3.

Fixes windows builds.
2012-09-15 18:18:39 +01:00
Brian Paul
e78ebbc5f9 scons: add new -p (prefix) options for yacc
These were recently added to the Makefiles.
2012-09-15 09:01:15 -06:00
Brian Paul
2f5f7bd687 swrast: remove unused ati_fs_opcodes array 2012-09-15 08:29:47 -06:00
Brian Paul
e656c4a074 mesa: remove FEATURE_ES test in texcompress_cpal.c
Fixes a regression after removing the #if FEATURE_x tests.
2012-09-15 08:28:21 -06:00
Oliver McFadden
2bc8f03f49 mesa: remove never-defined FEATURE_histogram conditional.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:59 +03:00
Oliver McFadden
9f37b405a3 mesa: remove remaining FEATURE_* defines where protected by API check.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:57 +03:00
Oliver McFadden
ab1a9430c3 mesa: remove obsolete comments from mfeatures.h
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:55 +03:00
Oliver McFadden
961fcc45ad mesa: remove FEATURE_ATI_fragment_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:52 +03:00
Oliver McFadden
dd44f80f81 mesa: remove FEATURE_APPLE_object_purgeable define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:51 +03:00
Oliver McFadden
dda982f1a7 mesa: remove FEATURE_EXT_transform_feedback define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:49 +03:00
Oliver McFadden
88233b0bc3 mesa: remove FEATURE_EXT_texture_sRGB define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:48 +03:00
Oliver McFadden
e9ccb5fe52 mesa: remove FEATURE_EXT_framebuffer_blit define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:46 +03:00
Oliver McFadden
d05d5d9a91 mesa: remove FEATURE_ARB_sync define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:45 +03:00
Oliver McFadden
02a19684f9 mesa: remove FEATURE_ARB_sampler_objects define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:43 +03:00
Oliver McFadden
c609bf9786 mesa: remove FEATURE_ARB_pixel_buffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:42 +03:00
Oliver McFadden
e8ba24cbfd mesa: remove FEATURE_ARB_map_buffer_range define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:41 +03:00
Oliver McFadden
32c3ba8753 mesa: remove FEATURE_ARB_framebuffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:39 +03:00
Oliver McFadden
e8a72d8282 mesa: remove FEATURE_ARB_(fragment|vertex)_program defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:38 +03:00
Oliver McFadden
b7d15977f6 mesa: remove FEATURE_NV_(fragment|vertex)_program defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:36 +03:00
Oliver McFadden
ae241747c8 mesa: remove unused FEATURE_NV_fence define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:26 +03:00
Oliver McFadden
b874db09cf mesa: remove unused FEATURE_OES_framebuffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:24 +03:00
Oliver McFadden
740cdfdea3 mesa: remove unused FEATURE_OES_mapbuffer define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:22 +03:00
Oliver McFadden
f88393afbe mesa: remove FEATURE_OES_EGL_image define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:20 +03:00
Oliver McFadden
cd28a19bd9 mesa: remove FEATURE_EXT_pixel_buffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:19 +03:00
Oliver McFadden
0c1ff721e1 mesa: remove FEATURE_EXT_framebuffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:18 +03:00
Oliver McFadden
528f48432e mesa: remove FEATURE_ARB_shader_objects and related defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:16 +03:00
Oliver McFadden
7ada8d371e mesa: remove FEATURE_ARB_fragment_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:14 +03:00
Oliver McFadden
6c4cddadaa mesa: remove FEATURE_ARB_vertex_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:13 +03:00
Oliver McFadden
5489fc7b9f mesa: remove FEATURE_OES_draw_texture define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:11 +03:00
Oliver McFadden
009250a096 mesa: remove FEATURE_es2_glsl and related defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:10 +03:00
Oliver McFadden
d09428c9cc mesa: remove FEATURE_point_size_array define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:07 +03:00
Oliver McFadden
fd232c6bd4 mesa: remove unused FEATURE_extra_context_init define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:06 +03:00
Oliver McFadden
ab8d76357f mesa: remove FEATURE_texture_s3tc define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:04 +03:00
Oliver McFadden
beb293e4cd mesa: remove FEATURE_texture_fxt1 define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:02 +03:00
Oliver McFadden
d4c2b1e8f8 mesa: remove FEATURE_rastpos define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:00 +03:00
Oliver McFadden
25ee9617ff mesa: remove FEATURE_queryobj define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:53 +03:00
Oliver McFadden
0ba82f9108 mesa: remove FEATURE_pixel_transfer define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:52 +03:00
Oliver McFadden
26a26e9992 mesa: remove FEATURE_feedback define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:50 +03:00
Oliver McFadden
fa9fc2332b mesa: remove FEATURE_evaluators define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:48 +03:00
Oliver McFadden
24c3d16f3b mesa: remove FEATURE_drawpix define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:46 +03:00
Oliver McFadden
53514b0326 mesa: remove FEATURE_draw_read_buffer define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:44 +03:00
Oliver McFadden
09df07373b mesa: remove FEATURE_dlist define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:42 +03:00
Oliver McFadden
dce8602251 mesa: remove FEATURE_convolve define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:40 +03:00
Oliver McFadden
97a8ca47ae mesa: remove FEATURE_colortable define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:37 +03:00
Oliver McFadden
004f032baf mesa: remove FEATURE_beginend define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:35 +03:00
Oliver McFadden
985b0cb22f mesa: remove FEATURE_attrib_stack define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:33 +03:00
Oliver McFadden
d6543599da mesa: remove FEATURE_arrayelt define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:31 +03:00
Oliver McFadden
016ba4cc2c mesa: remove FEATURE_accum define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:29 +03:00
Oliver McFadden
fc66313c96 mesa: remove FEATURE_userclip define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:27 +03:00
Oliver McFadden
eeed210c7d mesa: remove FEATURE_texgen define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:22 +03:00
Oliver McFadden
e5870d97eb mesa: remove FEATURE_dispatch define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:09 +03:00
Dave Airlie
72f657c950 vbo: add a prefix to count_tessellated_primitives
Just to make it consistent with the rest of vbo, since it would
be an exported symbol anyways.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:04:09 +10:00
Dave Airlie
ee9f576637 mesa/fxt1: make fxt1_decode_1 static
No users outside this file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:37 +10:00
Dave Airlie
da86e62d3c mesa/ati_fragshader: no need for opcodes to be global.
I can't see these in use anywhere outside this file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:30 +10:00
Dave Airlie
14b4e727fb glsl: make tex_opcode_strs static
No reason for this to be global from what I can see

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:24 +10:00
Dave Airlie
7b10d81fc8 mesa/dxtn: make function pointers static
These aren't used outside thie file from what I can see.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:10 +10:00
Dave Airlie
36639ec6e9 meta: make mem_ctx non-global.
I can't see any external users, and this is a global symbol,

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:03 +10:00
Dave Airlie
7056193a43 glsl: make builtin_mem_ctx a static
This isn't used outside the generated file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:02:46 +10:00
Dave Airlie
0b45bd146a ir_to_mesa: make some global variable static
nothing outside this file uses these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:02:20 +10:00
Dave Airlie
6f3deeae96 mesa: make global perm variable static const
this array doesn't look like it needs to be global or unconst.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:01:02 +10:00
Mike Frysinger
8f9bae615d mklib: clean up abi flags for x86 targets
The current code is duplicated in two places and relies on `uname` to
detect the flags.  This is no good for cross-compiling, and the current
logic uses -m64 for the x32 ABI which breaks things.

Unify the code in one place, avoid `uname` completely, and add support
for the new x32 ABI.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-09-14 15:27:16 -07:00
Dave Airlie
88b0790b1a mesa/glsl: rename preprocess to glcpp_preprocess
This symbol with dricore escapes into the namespace, its too generic,
we should prefix it with something just to be nice.

Should be applied to stable + 9.0

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 08:22:55 +10:00
Dave Airlie
53d46bc787 glcpp: fix abuse of yylex
So glcpp tried to workaround yylex its own way, but failed,
do it properly.

This fixes another crash found after fixing the first crash.

this is a candidate for 9.0 and stable branches

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 08:20:56 +10:00
Dave Airlie
cc943c8470 mesa: use a prefix for the program lex
This avoids us making a global yylex symbol which will interfere will
all sorts of apps.

with libdricore which can't do symbol visibility currently we pollute
the namespace with this.

This is a candidate for 9.0 & stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 08:20:56 +10:00
Paul Berry
a29a456635 meta: Refactor handling of GL_MULTISAMPLE.
In commit 055093e (meta: remove call to _meta_in_progress(), fix
multisample enable/disable), we created a meta_set_enable() function
that could be used by meta ops to enable and disable GL_MULTISAMPLE
even when the GLES API was in use (the GLES API doesn't support
GL_MULTISAMPLE; it behaves as if it is always enabled).  This created
some unfortunate code duplication between meta_set_enable() and the
existing _mesa_set_enable() function.

This patch eliminates the duplication by creating a
_mesa_set_multisample() function, which is used by both meta ops and
_mesa_set_enable() to enable/disable GL_MULTISAMPLE.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-14 14:50:41 -07:00
Anuj Phogat
15bf3103b4 _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130
glsl version of _mesa_meta_GenerateMipmap() would require separate
shaders for glsl 120 and 130.

V2: Removed the code for integer textures as ARB is planning to
    disallow automatic mipmap generation for integer textures.

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-14 11:23:03 -07:00
Anuj Phogat
299acac849 _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime
glsl path of _mesa_meta_GenerateMipmap() function would require different fragment
shaders depending on the texture target. This patch adds the code to generate
appropriate fragment shader programs at run time.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296

V2: Removed the code for integer textures as ARB is planning to
    disallow automatic mipmap generation for integer textures.
    Now using ralloc_asprintf in setup_glsl_generate_mipmap().

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-14 11:23:03 -07:00
Christian König
fb541662eb radeon/llvm: Support frint on SI
Gets VDPAUs shaders working again.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-14 17:03:24 +02:00
Marek Olšák
fac7031a04 r600g: consolidate decompression code for the blitter 2012-09-14 05:55:00 +02:00
Marek Olšák
df5e2c058f r600g: do not require MSAA renderbuffer support if not asked for
to allow stencil-only sampler-only formats (like X24S8)

NOTE: This is a candidate for the stable branches.
2012-09-14 05:55:00 +02:00
Marek Olšák
61706915a3 gallium/u_blitter: fix stencil-only blits
NOTE: This is a candidate for the stable branches.
2012-09-14 05:55:00 +02:00
Marek Olšák
1e51d368eb r300g: fix colormask with non-BGRA formats
NOTE: This is a candidate for the stable branches.
2012-09-14 05:55:00 +02:00
Alex Deucher
b33d7eaa5e r600g: reduce quant mode on evergreen+
Seems to have an affect on the allowable range of
values.  Set evergreen+ to 1/256 to match 6xx/7xx.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-13 17:33:35 -04:00
Marek Olšák
ee50d365ea radeonsi: don't use a staging resource for large transfers
It kills performance if the resource is linear.
2012-09-13 20:26:21 +02:00
Marek Olšák
e386972f5b r600g: don't use a staging resource for large transfers
It kills performance if the resource is linear.
2012-09-13 20:25:47 +02:00
Marek Olšák
1f5a7567e8 r600g: convert the remnants of VGT state into immediate register writes/atoms v4
v2: Group vgt register together to avoid lockup
v3: Split multi primitive register and index bias register
v4: Bump R600_NUM_ATOMS

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
150decffb4 r600g: emit the primitive type and associated regs only if the type is changed
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
c56dca909a r600g: add clip_misc_state for clip registers emitted in draw_vbo
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
51d839edc8 r600g: fix computing how much space is needed for a draw command
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
8faf3bcf07 r600g: fix the number of CS dwords of cb_misc_state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
2b8d39bbfc r600g: atomize clip state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
de89fe1e5d r600g: atomize blend color
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
605fd0c14a r600g: atomize viewport state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
63bf0f905a r600g: atomize stencil ref state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
fd19aa4e12 r600g: remove unused state ID definitions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
c383a3cfb2 r600g: initialize the first CS just like any other CS
by reusing the CS initialization in r600_context_flush.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
263045afbc r600g: add support for geometry shader samplers and constant buffers
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
f2eac1423a r600g: put sampler states and views into an array indexed by shader type
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
3fe78594b1 r600g: do fine-grained sampler state updates
Update only those sampler states which are changed in a shader stage,
instead of always updating all sampler states in the shader stage.
That requires keeping a bitmask of those states which are enabled, and those
states which are dirty at a given point (subset of enabled states).

This is similar to how sampler views, constant buffers, and vertex buffers
are handled.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
6c86124157 r600g: consolidate set_viewport_state functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
48de30e760 r600g: consolidate set_sampler_views functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
1bce17ee01 r600g: put constant buffer state into an array indexed by shader type
to easily and robustly handle multiple shader stages

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
3bffd8a5eb r600g: cleanup state function names
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
f96df32d62 r600g: consolidate initialization of common state functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
fd2e34d557 r600g: simplify flushing
Based on the patch called "simplify and fix flushing and synchronization"
by Jerome Glisse.

Rebased, removed unneded code, simplified more and cleaned up.

Also, SH_ACTION_ENA is not set when changing shaders (hw doesn't seem
to need it). It's only used to flush constant buffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Tom Stellard
6a5a4d59ce radeon/llvm: Fix lowering of vbuild
Some of the old AMDIL code was hard-coding subreg indices when creating
the VBUILD node, which was making it difficult to match the
vector_insert patterns.
2012-09-13 10:38:02 -04:00
Tom Stellard
70a50685a8 radeon/llvm: Support fmul on SI 2012-09-13 10:38:02 -04:00
Kenneth Graunke
28f4be9eb9 i965: Fix out-of-order sampler unit usage in ARB fragment programs.
ARB fragment programs use texture unit numbers directly, unlike GLSL
which has an extra indirection.  If a fragment program only uses one
texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single
bit, which would make us only upload a single surface/sampler state
entry.  However, it needs to be the second entry.

Using _mesa_fls() instead of _mesa_bitcount() solves this.  For ARB
programs, this makes num_samplers the ID of the highest texture unit
used.  Since GLSL uses consecutive integers assigned by the linker,
_mesa_fls() should give the same result as _mesa_bitcount()..

Fixes a regression since 85e8e9e000,
which caused GPU hangs in ETQW (and probably others), as well as
breaking piglit test fp-fragment-position.

v2: Add a comment, as suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: meng <mengmeng.meng@intel.com>
2012-09-12 22:13:05 -07:00
Kenneth Graunke
0fc163408e mesa: Add a _mesa_fls() function to find the last bit set in a word.
ffs() finds the least significant bit set; _mesa_fls() finds the /most/
significant bit.

v2: Make it an inline function in imports.h, per Brian's suggestion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-12 22:13:05 -07:00
Paul Berry
1a5d4f7cb2 i965/blorp: Fix offsets and width/height for stencil blits.
Fixes piglit test "framebuffer-blit-levels draw stencil".

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
5fd67fac14 i965/blorp: Reduce alignment restrictions for stencil blits.
Previously, we aligned all stencil blit operations to multiples of the
size of a tile, since stencil buffers use W-tiling, and blorp has to
approximate this by configuring the 3D pipeline for Y-tiling and
swizzling coordinates.

However, this was unnecessarily conservative; it turns out that the
differences between W-tiling and Y-tiling are confined to 32-byte
sub-tiles within the 4k tiling pattern; the layout of these 32-byte
sub-tiles within the larger 4k tile is the same (8 sub-tiles across by
16 sub-tiles down, in column-major order).  Therefore we only need to
align stencil blit operations to multiples of the sub-tile size.

Note: although the performance improvement of this change is probably
quite small, the fact that W-tiling and Y-tiling formats only differ
within 32-byte sub-tiles will be essential in a future patch to ensure
that stencil blits work correctly between parts of the miptree other
than level/layer 0.  Making this change provides handy documentation
(and validation) of this fact.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
1a75063d5f i965/blorp: don't reduce stencil alignment restrictions when multisampling.
When blitting to a stencil buffer, we need to align the rectangle we
send down the rendering pipeline, to account for the fact that the
stencil buffer uses a W-tiled layout, but we are configuring its
surface state as Y-tiled.

Previously, when the stencil buffer was multisampled, we assumed that
we could reduce the amount of alignment that was necessary, since each
pixel occupies a block of 2x2 or 4x2 samples in the stencil buffer.
That would have been correct if the coordinates we were adjusting were
measured in pixels.  However, the conversion from pixel coordinates to
coordinates within the interleaved buffer has already been done;
therefore the full alignment restriction applies.

Note: the reason this mistake wasn't previously uncovered by piglit
tests is because it is being masked by another mistake: the blorp
engine is using overly conservative alignment restrictions when doing
stencil blits.  The overly conservative alignment restrictions will be
removed in the patch that follows.  Doing this fix now will prevent
the subsequent patch from introducing regressions.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
b760c9913d intel: Add map_stencil_as_y_tiled to intel_region_get_aligned_offset.
This patch modifies intel_region_get_aligned_offset() to make the
appropriate calculation when the blorp engine sets up a W-tiled
stencil buffer using a Y-tiled SURFACE_STATE.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
50dec7fc2d intel: Add map_stencil_as_y_tiled to intel_region_get_tile_masks.
When the blorp engine is performing a blit from one stencil buffer to
another, it sets up the surface state for these buffers as Y-tiled, so
it needs to be able to force intel_region_get_tile_masks() to return
the appropriate masks for a Y-tiled region.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
f04f219906 i965/blorp: Account for offsets when emitting SURFACE_STATE.
Fixes piglit tests "framebuffer-blit-levels {read,draw} depth".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
3123f06215 i965/blorp: Thread level and layer through brw_blorp_blit_miptrees().
Previously, when performing a blit using the blorp engine, we failed
to account for the level and layer of the source and destination.  As
a result, all blits would occur between miplevel 0 and layer 0 of the
corresponding textures, regardless of which level/layer was bound to
the framebuffer.

This patch passes the correct level and layer through
brw_blorp_miptrees() into the brw_blorp_blit_params data structure.

Further patches in the series will adapt
gen{6,7}_blorp_emit_surface_state to make use of these parameters.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
bc6cafa045 i965/blorp: Don't create a dummy renderbuffer just to fetch image offsets.
This is unnecessary--the image offsets can be read directly out of the
miptree using intel_miptree_get_image_offset.
2012-09-12 14:44:12 -07:00
Paul Berry
c130ce7b2b i965/blorp: store x and y offsets in brw_blorp_mip_info.
Currently, gen{6,7}_blorp_emit_surface_state assumes that the src and
dst surfaces are mapped to miplevel 0 and layer 0 (thus no surface
offset is required).  This is a bug, since the user might try to blit
to and from levels/layers other than 0.

To fix this bug, it will not be sufficient to have
gen6_{6,7}_blorp_emit_surface_state look up the surface offset at the
time they set up the surface state, since these offsets will need to
be tweaked when blitting stencil buffers (due to the fact that stencil
buffer blits have to swizzle between W and Y tiling formats).

So, to pave the way for the bug fix, this patch causes the x and y
offsets to be computed during blit setup and stored in
brw_blorp_mip_info.

As a result of this change, brw_blorp_mip_info doesn't need to store
the level and layer anymore.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
09b0fa8499 i965/blorp: store surface width/height in brw_blorp_mip_info.
Previously, gen{6,7}_blorp_emit_surface_state would look up the width
and height of the surface at the time they set up the surface state,
and then tweak it if necessary (it's necessary when a W-tiled surface
is being mapped as Y-tiled).  With this patch, we look up the width
and height when setting up the blit, and store them in
brw_blorp_mip_info.  This allows us to do the necessary tweak in the
brw_blorp_blit_params constructor (where it makes more sense).  It
also reduces the need to keep track of level and layer in
brw_blorp_mip_info, so that a future patch can eliminate them
entirely.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
e14b1288ef i965/blorp: Change gl_renderbuffer* params to intel_renderbuffer*.
This makes it more convenient for blorp functions to get access to
Intel-specific data inside the renderbuffer objects.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
32c7b2769c i965/blorp: Clarify why width/height must be adjusted for Gen6 IMS surfaces.
Also add a clarifying comment for why the width/height doesn't need
adjustment for Gen7.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
bde833c9d0 i965/gen6+: Adjust stencil buffer size after computing miptree layout.
Since Gen6+ stencil buffers use W-tiling (a tiling arrangement which
drm and the kernel are not aware of) we need to round up the width and
height of a stencil buffer to multiples of the W-tile size (64x64)
before allocating a stencil buffer.  Previously, we rounded up the
size of the base miplevel, and then computed the miptree layout based
on the rounded up size.  This was incorrect, because it meant that the
total size of the miptree would not be properly W-tile aligned, and
therefore we would not always allocate enough pages.

(Note: even though the GL API doesn't allow creation of mipmapped
stencil textures, it does allow mipmapping of a combined depth/stencil
texture, and on Gen6+, a combined depth/stencil texture is internally
implemented as a pair of separate depth and stencil buffers.)

For example, on Sandy Bridge, when allocating a mipmapped stencil
texture of size 128x128, we would first round up to the nearest
multiple of 64x64 (causing no change to the size), and then compute
the miptree layout (whose size worked out to 128x196).  Then we would
request an allocation of 128*196 bytes (6.125 pages), causing 7 pages
to be allocated to the texture.  However, the texture needs 8 pages,
since each W-tile occupies a page, and it takes 2 W-tiles to cover a
width of 128 and 4 W-tiles to cover a height of 196.

This patch changes the order of operations so that the miptree layout
is computed first and then the total size of the miptree is rounded up
to be W-tile aligned.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Matt Turner
af6aeae4e1 build: Don't list glproto and dri2proto in pkg-config file
No files provided by glproto or dri2proto are needed for building
something with Mesa.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=342393
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-09-12 11:26:28 -07:00
Michel Dänzer
7443e4e697 radeonsi: Properly handle NULL sampler views.
Fixes piglit shaders/glsl-fs-uniform-sampler-array and many other similar
tests.

In fact, I just completed a piglit quick-driver.tests run without any GPU
lockups or even VM protection faults. Yay!

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-12 15:53:51 +02:00
Michel Dänzer
d67d8e2471 radeonsi: Fix calculation of number of records in buffer resource.
The value was too small by 1 in some cases (non-first of several vertex
elements interleaved in a single buffer).

Fixes intermittent incorrect geometry in many apps, e.g. piglit
spec/EXT_texture_snorm/fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-12 13:23:09 +02:00
Imre Deak
9f30cbe9ee mesa: glGet: fix API check for EGL_image_external enums
These enums are valid only in ES1 and ES2. So far they were marked valid
incorrectly, depending on the previous API mask in the enum list.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Imre Deak
ae310e37fb mesa: glGet: fix indentation of print_table_stats
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Imre Deak
97a693d1fa mesa: glGet: fix indentation of find_value
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Imre Deak
746e82fff4 mesa: glGet: fix indentation of _mesa_init_get_hash
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Brian Paul
35c75f6777 mesa: fix proxy texture error handling in glTexStorage()
This is basically a follow-on to 1f5b1f9846.
Basically, generate GL errors for ordinary invalid parameters for proxy
targets the same as for non-proxy targets.  Only texture size and OOM
errors should be handled specially for proxies.

Note: This is a candidate for the stable branches.
2012-09-11 17:38:21 -06:00
Brian Paul
d17440dcaa mesa: make _mesa_get_proxy_target() non-static
Needed for the next patch.

Note: This is a candidate for the stable branches.
2012-09-11 17:38:21 -06:00
Brian Paul
2e4fc54977 mesa: do internal format error checking for glTexStorage()
Turns out we weren't doing any format checking before.  Now check
the internal format and, in particular, make sure that unsized internal
formats aren't accepted.

Note: This is a candidate for the stable branches.
2012-09-11 17:38:21 -06:00
Paul Berry
5d5f0f3491 mesa/msaa: Allow X and Y flips in multisampled blits.
From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles":

    If SAMPLE_BUFFERS for either the read framebuffer or draw
    framebuffer is greater than zero, no copy is performed and an
    INVALID_OPERATION error is generated if the dimensions of the
    source and destination rectangles provided to BlitFramebuffer are
    not identical, or if the formats of the read and draw framebuffers
    are not identical.

It is not clear from the spec whether "dimensions" should mean both
sign and magnitude, or just magnitude.

Previously, Mesa interpreted "dimensions" as meaning both sign and
magnitude, so any multisampled blit that attempted to flip the image
in the X and/or Y direction would fail.

However, Y flips are likely to be commonplace in OpenGL applications
that have been ported from DirectX applications, as a result of the
fact that DirectX and OpenGL differ in their orientation of the Y
axis.  Furthermore, at least one commercial driver (nVidia) permits Y
filps, and L4D2 relies on them being permitted.  So it seems prudent
for Mesa to permit them.

This patch changes Mesa to allow both X and Y flips, since there is no
language in the spec to indicate that X and Y flips should be treated
differently.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-09-11 15:50:55 -07:00
Tom Stellard
843ac06ad2 radeon/llvm: Fix operand order of V_CNDMASK in custom inserter
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:48 -04:00
Tom Stellard
d399ce7615 radeon/llvm: Assert if we try to encode an unknown register
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:48 -04:00
Tom Stellard
0df2753ad2 radeon/llvm: Add register encoding for VCC
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
056d9c6ef1 radeon/llvm: Ignore special registers when calculating reg count
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
0fb1e68a0b radeonsi: Handle position input parameter for pixel shaders v2
v2:
  - Don't increment ninterp or set any of the have_* flags for
    TGSI_SEMANTIC_POSITION

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
0410e9e8c7 radeon/llvm: Coding style fixes
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
d3e58f75d2 radeonsi: Move interpolation mode check into the compiler
The compiler needs to know which interpolation modes are enabled, so
it knows which values will be preloaded into the VGPRs.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
5fff032dd5 radeonsi: Add missing interpolation mode to check for enabled modes
At least one interpolation mode must be enable, but the code that checks
this was not checking for perspective center.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
cc571a367e radeonsi: Pass shader type to the compiler
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
dfd3d61abf radeon/llvm: Add SHADER_TYPE instruction
This allows the program to specify the type of shader being compiled
(e.g. PXEL, VERTEX, etc.)

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Jerome Glisse
841c1b5f54 r600g: avoid GPU doing constant preload from random address
Previous command stream might have set any of the constant buffer
and the previous address might no longer be valid thus GPU might
preload constant from random invalid address and possibly triggering
lockup.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-11 12:57:54 -04:00
Michel Dänzer
9ccaa24f84 radeonsi: Texture border colour fixes.
* Handle arbitrary border colours.
* Use correct packing format for detecting special border colours.

Fixes piglit tex-border-1 and probably many other tests using border colours.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-11 11:06:56 +02:00
Michel Dänzer
03dfa30596 radeonsi: Handle NULL sampler states.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-11 11:06:16 +02:00
Kenneth Graunke
23cd6c43da i965: Remove incorrect comment above opt_algebraic.
The comment was cut-and-pasted from propagate_constants(), and had no
relation at all to opt_algebraic().
2012-09-10 22:58:25 -07:00
Kenneth Graunke
354f2cb5c7 glsl: Generate compile errors for explicit blend indices < 0 or > 1.
According to the GLSL 4.30 specification, this is a compile time error.
Earlier specifications don't specify a behavior, but since 0 and 1 are
the only valid indices for dual source blending, it makes sense to
generate the error.

Fixes (the fixed version of) piglit's layout-12.frag.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-10 20:56:11 -07:00
Marek Olšák
87389d4e5c r600g: remove unused function 2012-09-11 00:02:58 +02:00
Marek Olšák
830b6f3273 r600g: fix printf warning 2012-09-11 00:02:58 +02:00
Andreas Boll
e81ee67b51 mesa: bump version to 9.1 (devel)
Now that branch 9.0 is created, bump the minor version in
master.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-09 03:00:17 -07:00
Johannes Obermayr
10a96f4a4d Set OSMESA_VERSION=8.
VERSION_NUMBER is not required anymore. So it will be removed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-09-07 14:44:48 -04:00
Christoph Bumiller
3433471e8b nvc0/ir: add initial code to support GK110 ISA encoding 2012-09-07 19:03:40 +02:00
Michel Dänzer
8a497e5955 radeonsi: Float format fixups.
Fixes piglit spec/ARB_texture_float/fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-07 18:23:08 +02:00
Michel Dänzer
15c009af28 radeonsi: Handle more SNORM formats.
Fixes piglit spec/EXT_texture_snorm/fbo-generatemipmap-formats (except for
what seems like a random fluke).

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-07 18:23:08 +02:00
Eric Anholt
39aca5076f i965: Fix virtual_grf_interferes() between calculate_live_intervals() and DCE.
This fixes the blue zombies bug in l4d2.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-07 08:29:49 -07:00
Eric Anholt
7b3fe776e2 i965: Make the param pointer arrays for the VS dynamically sized.
Saves 96MB of wasted memory in the l4d2 demo.

v2: Rebase on compare func change, change brace style.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-07 08:29:49 -07:00
Eric Anholt
f144b78dfb i965: Make the param pointer arrays for the WM dynamically sized.
Saves 26.5MB of wasted memory allocation in the l4d2 demo.

v2: Rebase on compare func change, fix comments.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-07 08:29:48 -07:00
Eric Anholt
99596cba78 i965: Add functions for comparing two brw_wm/vs_prog_data structs.
Currently, this just avoids comparing all unused parts of param[] and
pull_param[], but it's a step toward getting rid of those giant statically
sized arrays.

v2: Actually use the new function instead of just looking at its
    address.  This required changing the args to const pointers.
    (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-07 08:29:48 -07:00
Eric Anholt
5bb94f2bc4 glsl: Count builtin uniforms against uniform component limits.
We don't fully process the builtin uniforms, but at least
num_uniform_components reflects reality now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-07 08:29:48 -07:00
Michel Dänzer
30b303743d radeonsi: Handle TGSI_SEMANTIC_FOG.
Fixes exponential fog. The pixel shaders for linear fog seem to get
miscompiled still somehow.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-07 16:12:04 +02:00
Michel Dänzer
3144821ef6 radeon/llvm: Match fexp2 for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-07 12:16:32 +02:00
Brian Paul
043f66204b glapi/glx: rename 'table' variable to 'disp_table'
This fixes an issue where the local 'table' variable was hiding the
function parameter name in glGetColorTable(..., void *table).

This should be OK as long as there's never a GL entrypoint that uses
'disp_table' as a parameter name.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-06 18:58:49 -06:00
Brian Paul
14f55869a4 glx: move 'prime' var into #ifdef'd code block
To silence unused var warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-06 18:58:49 -06:00
Kenneth Graunke
815d9d405c i965: Fix primitive restart on Haswell.
Haswell moved the "Cut Index Enable" bit from the INDEX_BUFFER packet to
a new 3DSTATE_VF packet, so we need to emit that.  Also, it requires us
to specify the cut index rather than assuming it's 0xffffffff.

This adds a new Haswell-specific tracked state atom to gen7_atoms.
Normally, we would create a new generation-specific atom list, but since
there's only one difference over Ivybridge so far, I chose to simply
make it return without doing any work on non-Haswell systems.

Fixes five piglit tests:
- general/primitive-restart-DISABLE_VBO
- general/primitive-restart-VBO_COMBINED_VERTEX_AND_INDEX
- general/primitive-restart-VBO_INDEX_ONLY
- general/primitive-restart-VBO_SEPARATE_VERTEX_AND_INDEX
- general/primitive-restart-VBO_VERTEX_ONLY

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-06 16:39:48 -07:00
Matt Turner
058fb00716 build: Disable building of d3d1x
It's broken and unmaintained, and I'm tired of seeing bug reports about
it.
2012-09-06 16:20:18 -07:00
Paul Berry
78a34d868d intel: avoid undefined variable warnings in intel_screen.c
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-06 14:49:25 -07:00
Jerome Glisse
5ceb87286f r600g: order atom emission v3
To avoid GPU lockup registers must be emited in a specific order
(no kidding ...). This patch rework atom emission so order in which
atom are emited in respect to each other is always the same. We
don't have any informations on what is the correct order so order
will need to be infered from fglrx command stream.

v2: add comment warning that atom order should not be taken lightly
v3: rebase on top of alphatest atom fix

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-06 15:09:17 -04:00
Jerome Glisse
935a729447 r600g: fix num of dwords needed for alphatest_state atom
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-06 15:09:14 -04:00
Chad Versace
f29a4b0157 mesa: Don't advertise GLES extensions in GL contexts
glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so
returned all internally enabled GLES extensions from a GL context.
Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the
context's API.

Note: This is a candidate for the 8.0 and 9.0 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-06 11:46:04 -07:00
José Fonseca
edc0a00377 llvmpipe: Make driver name more informative.
Such as

  "llvmpipe (LLVM 3.1, 128 bits)"

or

  "llvmpipe (LLVM 3.1, 256 bits)"

when leveraging AVX 8-wide registers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-09-06 16:35:25 +01:00
Michel Dänzer
694617a5b4 radeonsi: Handle more L/I/A format cases.
Fixes piglit fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-06 16:48:16 +02:00
Michel Dänzer
cfebaf9dbd radeonsi: Enable whole quad mode for pixel shaders.
Fixes wrong mipmap level being sampled at some triangle edges.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:46:55 +02:00
Michel Dänzer
5edb80cee0 radeon/llvm: Add intrinsic for enabling whole quad mode in SI pixel shaders.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:46:42 +02:00
Michel Dänzer
e7383b74ef radeon/llvm: SI shader vector instructions implicitly use the EXEC register.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:46:27 +02:00
Michel Dänzer
ab162f80c3 radeon/llvm: Extend SI EXEC register support.
Add 32 bit lo and hi variants, and binary encodings.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:15:44 +02:00
Tom Stellard
2baaa5c7eb radeon/llvm: Remove R600InstrInfo.td from TD_FILES
Fixes build bug introduced by
cebbdd4ac2
2012-09-06 14:16:59 +00:00
Michel Dänzer
d0f51fe567 radeonsi: Enable NPOT textures again.
Should be at least mostly working now (with the corresponding fixes in
libdrm_radeon).

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:39:20 +02:00
Michel Dänzer
cf697e875c radeonsi: Mipmaps require memory footprint to be padded to powers of two.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:39:13 +02:00
Michel Dänzer
b7d96ca35e radeonsi: Sampler view state simplification.
We can always use the offset and tiling mode from level 0 and restrict the
first and last mipmap level to be used in the sampler resource.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:39:01 +02:00
Michel Dänzer
396af00ffe radeonsi: Untiled textures are linear aligned, not linear general.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:38:45 +02:00
Tom Stellard
cebbdd4ac2 radeon/llvm: Cleanup makefile
Hopefully, this will fix all the parallel make problems people have
been having.
2012-09-06 13:30:42 +00:00
Matt Turner
b6109de34f Remove useless checks for NULL before freeing
Same as earlier commit, except for "FREE"

This patch has been generated by the following Coccinelle semantic
patch:

// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ FREE (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   FREE(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
type T;
@@
+ FREE ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   FREE((T) E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ FREE (E);
- if (unlikely (E != NULL)) {
-   FREE (E);
- }

@@
expression E;
type T;
@@
+ FREE ((T) E);
- if (unlikely (E != NULL)) {
-   FREE ((T) E);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
da3282b6e2 Replace another malloc/memset-0 combination with calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
52789496a7 Remove useless memset after calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
6bda027e01 Use calloc instead of malloc/memset-0
This patch has been generated by the following Coccinelle semantic
patch:

@@
expression E;
identifier I;
@@
- I = malloc(E);
+ I = calloc(1, E);
...
- memset(I, 0, sizeof *I);

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
5067506ea6 Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic
patch:

// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
type T;
@@
+ free ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free((T) E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }

@@
expression E;
type T;
@@
+ free ((T) E);
- if (unlikely (E != NULL)) {
-   free ((T) E);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
a9e8054fff glX_proto_send.py: Don't cast the return value of malloc 2012-09-05 22:28:50 -07:00
Matt Turner
2b7a972e3f Don't cast the return value of malloc/realloc
This patch has been generated by the following Coccinelle semantic
patch:

// Don't cast the return value of malloc/realloc.
//
// Casting the return value of malloc/realloc only stands to hide
// errors.

@@
type T;
expression E1, E2;
@@
- (T)
(
_mesa_align_calloc(E1, E2)
|
_mesa_align_malloc(E1, E2)
|
calloc(E1, E2)
|
malloc(E1)
|
realloc(E1, E2)
)
2012-09-05 22:28:50 -07:00
Matt Turner
812931f602 glX_proto_send.py: Remove deprecated Xmalloc/Xfree calls
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:49 -07:00
Matt Turner
7c7b7b068b Remove Xcalloc/Xmalloc/Xfree calls
These calls allowed Xlib to use a custom memory allocator, but Xlib has
used the standard C library functions since at least its initial import
into git in 2003. It seems unlikely that it will grow a custom memory
allocator. The functions now just add extra overhead. Replacing them
will make future Coccinelle patches simpler.

This patch has been generated by the following Coccinelle semantic
patch:

// Remove Xcalloc/Xmalloc/Xfree calls

@@ expression E1, E2; @@
- Xcalloc (E1, E2)
+ calloc (E1, E2)

@@ expression E; @@
- Xmalloc (E)
+ malloc (E)

@@ expression E; @@
- Xfree (E)
+ free (E)

@@ expression E; @@
- XFree (E)
+ free (E)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:49 -07:00
Vinson Lee
17a574d7cd Use the correct macro _WIN32 for Windows.
The correct predefined macro for Windows is _WIN32, not WIN32 or
__WIN32__.  _WIN32 is defined for 32-bit and 64-bit version of Windows
by both MSVC and MinGW compilers.

http://sourceforge.net/p/predef/wiki/OperatingSystems
http://msdn.microsoft.com/en-us/library/b0084kay.aspx

This patch also fixes a MinGW automake build error.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:14:32 -07:00
Brian Paul
df5eb0c9bc mesa: remove #undef CONST in get.c
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:31 -06:00
Brian Paul
97992b05fb mesa: remove now unused CONST macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:27 -06:00
Brian Paul
2e23a76eb9 mesa: s/CONST/const/ in a comment
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:21 -06:00
Brian Paul
9f2a7a38e8 mesa: s/CONST/const/ in math/ files
The CONST macro hack will go away soon.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:03 -06:00
Tom Stellard
d220e2de7f radeon/llvm: Fix operand ordering for V_CNDMASK_B32
This fixes several hundred piglit tests.
2012-09-05 13:17:49 -04:00
Tom Stellard
12d3d6f6ab radeon/llvm: Use correct float->int conversion opcode on SI.
V_CVT_I32_F32 converts floats to signed integers, but we were using
V_CVT_F32_I32 which convertes signed integers to float.
2012-09-05 13:17:17 -04:00
Tom Stellard
d68e337c60 configure.ac: Don't link gallium drivers with libdricore
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 14:01:56 -04:00
Paul Berry
e42f16c192 i965/blorp: Fix incorrect indentation. 2012-09-05 10:42:06 -07:00
Paul Berry
772ea84b35 mapi: Add shared-glapi-test to .gitignore 2012-09-05 10:41:42 -07:00
Brian Paul
771e7b6d88 mesa: fix per-level max texture size error checking
This is a long-standing omission in Mesa's texture image size checking.
We need to take the mipmap level into consideration when checking if the
width, height and depth are too large.

Fixes the new piglit max-texture-size-level test.
Thanks to Stéphane Marchesin for finding this problem.

Note: This is a candidate for the stable branches.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-05 08:44:26 -06:00
Kenneth Graunke
456c7355e0 i965: Don't use brw->fragment_program in the old brw_wm_pass2.c.
According to Eric, this shouldn't matter since we don't do precompiles
using the old backend.  In other words, brw->fragment_program (the
currently active program) should equal c->fp (the program currently
being compiled).

However, it's just not a good idea to access brw->fragment_program
directly in compiler code.  It's totally illegal in the new backend, so
let's just not do it here either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Paul Berry <stereotype441@gmail.com>
2012-09-05 06:50:10 -07:00
Tom Stellard
446d19c12a radeon/llvm: Fix lowering of SI_V_CNDLT
SREG_LIT_0 is a scalar register, so it can only be used in the
first argument of vector instructoins.
2012-09-04 14:21:10 -04:00
Tom Stellard
f9fede884b radeon/llvm: Fix encoding of V_CNDMASK_B32
The CodeEmitter was not setting the VGPR bit for src0, because the
instruction definition had the VCC register in the src0 slot, instead of
the actual src0 register.  This has been fixed by moving the VCC
register to the end of the operand list.
2012-09-04 14:21:10 -04:00
Brian Paul
f73ffacbf0 mesa: fix DIFFERENT_SIGNS() function
Looks like converting this to a macro, returning bool, caused us to
lose the high (31st) bit result.  Fixes piglit fbo-1d test.  Strange
that none of the other tests I ran caught this.

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

Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-09-04 11:36:58 -06:00
Vincent Lejeune
8eaa36317a radeon/llvm: do not convert f32 operand of select_cc node
v2:-use camel coding style

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:54:37 +02:00
Vincent Lejeune
a4325b3229 radeon/llvm: custom lowering for FP_TO_UINT when dst is i1 (bool)
v2:-wrap line at 80 characters

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:54:01 +02:00
Vincent Lejeune
d9e135e18c radeon/llvm: support setcc on f32
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:52:53 +02:00
Vincent Lejeune
a383142436 radon/llvm: br_cc f32 now lowered without cast
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:50:44 +02:00
Vincent Lejeune
6a85725f13 radeon/llvm: swap wrong OPCODE_IS_*_ZERO_* opcode and use
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:44:48 +02:00
Christian König
73dd82061e winsys/radeon: create only one winsys for each fd
Fixing problems with GLAMOR.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:38 +02:00
Christian König
88a4fd8fe6 radeonsi: stop big offsets from hanging the GPU v2
v2: rebased of radeon/llvm fix.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:32 +02:00
Christian König
de7d3825a0 radeonsi: adjust PIPE_SHADER_CAP_MAX_CONSTS
So it matches what we really can do.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:26 +02:00
Christian König
8758183f0a radeon/llvm: fix SelectADDR8BitOffset
The offset is unsigned, not signed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:11 +02:00
José Fonseca
7eb5040197 gallivm,llvmpipe: Use 4-wide vectors on AMD Bulldozer.
8-wide vectors is slower.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-09-04 08:49:00 +01:00
Brian Paul
9a31e090ef mesa: add missing return statements after recording errors
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-03 18:07:41 -06:00
Brian Paul
2ffc7fd2d2 mesa: remove more null pointer checks before free() calls
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-03 18:07:41 -06:00
Brian Paul
2276bb991a mesa: remove null pointer checks before free() calls
Since free(NULL) is fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-03 18:07:41 -06:00
Brian Paul
56ccdf7e30 mesa: remove SQRTF, use sqrtf. Convert INV_SQRT() to inline function.
We were already defining sqrtf where we don't have the C99 version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-03 18:07:41 -06:00
Vadim Girlin
f44bda17f5 r600g: adjust QUANT_MODE for higher precision
Use 1/256 for R6xx/7xx, 1/4096 for evergreen, instead of default 1/16.

Helps to pass some piglit tests (fbo, multisample).

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-04 00:18:13 +04:00
Vinson Lee
19b3910bd5 util: Add cpuid for Solaris Studio.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-03 12:28:07 -07:00
Ian Romanick
51b069e7aa meta: Don't save and restore fog state when there is no fog state
I wonder if the better solution is to have _mesa_meta_GenerateMipmap not
use MESA_META_ALL for the GLSL path.  Even on compatibility profiles
there is no reason to save and restore fog on this path.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54295
2012-09-03 10:33:54 -07:00
Brian Paul
0b90da3252 mesa: remove accidentally committed __SUNPRO_C sqrtf() code 2012-09-03 08:03:07 -06:00
Christian König
e1673d2001 radeonsi: disable array-textures for now
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-09-03 11:23:25 +02:00
Christian König
aa5daa61a1 radeonsi: disable Z16 for now
It's causing crashes.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-03 11:23:20 +02:00
Christian König
74a55392b6 radeonsi: disable NPOT textures for now
Looks like we have an alignment issue with NPOT textures
and mipmaps. So disable NPOT textures until we figure out
what is going wrong here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-03 11:23:14 +02:00
Christian König
e7723b5bdf radeonsi: handle indirect constants gracefully
It's not supported yet, so at least don't try to crash the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-03 11:23:08 +02:00
Brian Paul
a96119cc8c radeon: fix free/FREE mistake 2012-09-01 09:47:29 -06:00
Brian Paul
12bf268aab vega: include u_debug.h for assert() 2012-09-01 09:03:24 -06:00
Brian Paul
fe72a069d1 mesa: s/FREE/free/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul
4fdac659f8 mesa: s/CALLOC/calloc/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul
33bb8c051d mesa: s/MALLOC/malloc/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul
66d6ba2d83 util: remove u_debug.h from u_math.h
No debug code is used in u_math.h
2012-09-01 07:41:26 -06:00
Brian Paul
a7663729d2 util: include u_debug.h 2012-09-01 07:41:26 -06:00
Brian Paul
b114e37179 tgsi: include u_debug.h 2012-09-01 07:41:26 -06:00
Brian Paul
36f3f7ebfa mesa: clean-up LOG2() function 2012-09-01 07:41:26 -06:00
Brian Paul
c8a86f717f mesa: move IS_NEGATIVE() and DIFFERENT_SIGNS() to macros.h 2012-09-01 07:41:26 -06:00
Brian Paul
a2cf265c8d mesa: clean up F_TO_I, IFLOOR, ICEIL functions
Put all the #ifdef stuff inside the function bodies instead of outside.
2012-09-01 07:41:26 -06:00
Kenneth Graunke
4d9abd96cc i965/fs: Don't use brw->fragment_program in calculate_urb_setup().
Reading brw->fragment_program is nonsensical in compiler code: it
contains the currently active program (if any), not the one currently
being compiled.  Attempting to access it may either lead to crashes
(null pointer dereference if no program is active) or wrong results.

Fixes piglit regressions since 9ef710575b
on pre-Sandybridge hardware.  The actual bug was created in commit
7b1fbc6889.

NOTE: This is a candidate for the 9.0 and 8.0 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-31 16:36:09 -07:00
Matt Turner
e0f510b1c9 build: Remove left over echo from GLU removal 2012-08-31 15:12:21 -07:00
Vadim Girlin
b05a1fc156 mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
From ARB_sync spec:

    If the value of <timeout> is zero, then ClientWaitSync does not
    block, but simply tests the current state of <sync>. TIMEOUT_EXPIRED
    will be returned in this case if <sync> is not signaled, even though
    no actual wait was performed.

Fixes random fails of the arb_sync-timeout-zero piglit test on r600g.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-01 01:02:24 +04:00
Matt Turner
b95d598323 Remove libGLU
It's been moved to its own repository, found at
	http://cgit.freedesktop.org/mesa/glu/

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-31 10:58:15 -07:00
Jakob Bornecrantz
6a7dea93fa dri: Rework planar image interface
As discussed with Kristian on #wayland. Pushes the decision of components into
the dri driver giving it greater freedom to allow t to implement YUV samplers
in hardware, and which mode to use.

This interface will also allow drivers like SVGA to implement YUV surfaces
without the need to sub-allocate and instead send 3 seperate buffers for each
channel, currently not implemented.

I have tested these changes on Gallium Svga. Scott tested them on both intel
and Gallium Radeon. Kristan and Pekka tested them on intel.

v2: Fix typo in dri2_from_planar.
v3: Merge in intel changes.

Tested-by: Scott Moreau <oreaus@gmail.com>
Tested-by: Pekka Paalanen <ppaalanen@gmail.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-31 19:51:02 +02:00
Tom Stellard
022f6d8861 radeon/llvm: Rework how immediate operands are handled with SI
Immediate operands were previously handled in the CodeEmitter, but that
code was buggy and very confusing.  This commit adds a pass that simplifies
the handling of immediate operands by spliting the loading of the
immediate into a sperate insruction that is bundled with the original.
2012-08-31 12:54:58 -04:00
Tom Stellard
1cee70c5d8 radeon/llvm: Fix typo in assert 2012-08-31 12:54:58 -04:00
Tom Stellard
1247549734 radeon/llvm: Fix isEG tablegen predicate
This predicate incorrectly included SI GPUs, so some Evergreen
instructions were being emmitted on SI.
2012-08-31 12:54:58 -04:00
Tom Stellard
ee45dec7c4 radeon/llvm: Add support for RCP instruction on SI 2012-08-31 12:54:58 -04:00
Tom Stellard
fc8b4765d0 radeon/llvm: Support AMDGPUfmin DAG node on SI 2012-08-31 12:54:57 -04:00
Tom Stellard
c3c323a164 radeonsi: Handle TGSI_SEMANTIC_PSIZE
The relevant POINT_SIZE registers are being set using the
pipe_rasterizer_state, so we just need to tell the shader compiler which
export type to use.

This fixes several of the glean glsl tests.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-31 12:53:51 -04:00
Tapani Pälli
d58ca43b80 android: do not expose single buffered eglconfigs
On Android we want to add only double buffered configs for visuals.
Earlier implementation set the SurfaceType as 0 for single buffered
configs but driver still exposed these configs that were not compatible
with any egl surface type.  This caused Khronos conformance test runs to
fail on Android. This patch fixes the issue by skipping single buffered
configs earlier and not exposing them.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31 09:47:02 -07:00
Tapani Pälli
29d394b9ba android: fix liblog API changes
android logging macros changed their name in JellyBean.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31 09:45:56 -07:00
Tapani Pälli
4d02b018f4 xmlconfig: use __progname when building for Android
__progname symbol and strrchr are available with bionic.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31 09:45:49 -07:00
Vinson Lee
f3bb6bd9b3 scons: Remove leftover print statement.
Remove print statement left over from commit
c57fb034b1.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-08-31 08:26:29 -07:00
Andreas Boll
0dcf555104 docs: update relnotes-9.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 09:22:18 -06:00
Andreas Boll
3678f8904c mesa: also bump version in Makefile.am and configure.ac to 9.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 09:22:16 -06:00
Vinson Lee
c57fb034b1 scons: Add default libraries to Solaris build.
Fixes SCons build on Solaris.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54293
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 08:24:38 -06:00
Brian Paul
43ed822a50 st/mesa: s/CALLOC/calloc/ to fix allocation bug
The CALLOC() macro only takes one argument so this was being treated
as a comma expression.  Simply use calloc() instead.

A follow-on patch will replace all CALLOC() calls with calloc().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
2012-08-31 08:05:38 -06:00
Brian Paul
c5f9cf8232 util: add casts to silence signed/unsigned comparison warnings 2012-08-31 08:04:40 -06:00
Brian Paul
8472bb4508 mesa: fix-up and use _mesa_delete_renderbuffer()
_mesa_delete_renderbuffer() should free the mutex (though that may be a
no-op) and then free the renderbuffer object itself.  Subclasses of
gl_renderbuffer can use this function too.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-31 08:04:40 -06:00
Ian Romanick
2d2f1fd164 docs: Add some missing features to 9.0 release notes and GL3.txt
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-30 18:23:29 -07:00
Ian Romanick
0791484c42 mesa: Bump version to 9.0
Now that OpenGL 3.1 is supported by at least one driver, follow
tradition and bump the major version number.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-30 18:23:28 -07:00
Marek Olšák
0e470533ad r600g: enable transform feedback on Cayman
There doesn't seem to be anything wrong with it.
2012-08-31 01:19:03 +02:00
Marek Olšák
64db3cc6ad r600g: implement MSAA for Cayman
Everything works except for blitting MSAA colorbuffers, which isn't
so trivial on Cayman. It's a rarely-used feature anyway.
2012-08-31 01:19:03 +02:00
Anuj Phogat
f8a8f069ee i965/msaa: flag _NEW_MULTISAMPLE in the brw_tracked_state
This is required to get the program recompiled when SampleAlphaToCoverage
is enabled.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-30 11:10:50 -07:00
Marek Olšák
c2e9dd0276 r600g: enable MSAA on r6xx by default
DRM 2.22.0 is required though. Also require the new DRM for r700, as
there are some important fixes for that generation too.
2012-08-30 19:43:56 +02:00
Marek Olšák
2f6eb3afb7 r600g: disable MSAA depth decompression on r6xx 2012-08-30 19:43:56 +02:00
Marek Olšák
78354011f9 r600g: implement color resolve for r600
The blend state is different and the resolve single-sample buffer must have
FMASK and CMASK enabled. I decided to have one CMASK and one FMASK
per context instead of per resource.

There are new FMASK and CMASK allocation helpers and a new buffer_create
helper for that.
2012-08-30 19:43:56 +02:00
Marek Olšák
863e2c85b9 r600g: fix CB_SHADER_MASK and CB_TARGET_MASK for r6xx 2012-08-30 19:43:56 +02:00
Marek Olšák
187d7fb2fe r600g: implement draw_rectangle callback
The color resolve on r6xx needs PT_RECTLIST. Using conventional primitive
types (triangles and quads) produces an ugly line between two diagonally
opposite corners. I guess a rectangular point sprite would work too.
2012-08-30 19:43:55 +02:00
Marek Olšák
8698a3b85d r600g: implement MSAA for r700
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-30 19:43:55 +02:00
Marek Olšák
edf22a5c6d r600g: change programming of CB_SHADER_MASK on r600-r700
This one actually makes more sense and gives the expected value
for MSAA resolve.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-30 19:43:55 +02:00
Marek Olšák
1ff5f08823 configure.ac: require libdrm_radeon 2.6.39 for MSAA 2012-08-30 19:43:55 +02:00
Brian Paul
055093e33f meta: remove call to _meta_in_progress(), fix multisample enable/disable
This partially reverts d638da23d2.

With gallium the meta code is not always built so the call to
_meta_in_progress() was unresolved.  Simply special-case the
GL_MULTISAMPLE case in the meta code.  There might be other special
cases in the future given all the differences between legacy GL,
core GL, GLES, etc.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54234
and https://bugs.freedesktop.org/show_bug.cgi?id=54239

v2 (Paul Berry <stereotype441@gmail.com>): keep _meta_in_progress
function, since it's needed by the i965 driver, but don't call it from
core mesa.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-30 08:28:19 -07:00
Brian Paul
aad7ccd261 meta: add parenthesis to silence compiler warnings
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-30 09:26:51 -06:00
Tapani Pälli
9121460f13 scons : add HAVE_DLOPEN to build environment
fixes dlopen issue caused by 57c57df7b4

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-08-30 12:02:03 +01:00
Christian König
f1fd94f355 radeonsi: fix stupid bug added in commit 07838603b9
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-30 10:23:32 +02:00
Eric Anholt
8393360659 i965/fs: Remove a dead member from live variables analysis.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 20:46:51 -07:00
Kenneth Graunke
6928bea7ca i965/fs: Initialize output_components[] by filling it with zeros.
Prior to commit 2f1869822, emit_fb_writes() looped from 0 to 3, writing
all four components of a vec4 color output.  However, that broke for
smaller output types (float, vec2, or vec3).  To fix that, I introduced
a new variable (output_components[]) containing the size of the output
type for each render target.

Unfortunately, I forgot to actually initialize it in the constructor,
which meant that unless a shader wrote to gl_FragColor, or the specific
output for each render target, output_components would contain a garbage
value, and we'd loop for a completely non-deterministic amount of time.

Not actually emitting any color writes seems like the right approach.
We may still need to emit a render target write (to terminate the
thread), but don't have to put in any sensible values (the shader didn't
write anything, after all).

Fixes a regression since 2f18698220.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
2012-08-29 15:10:57 -07:00
Ian Romanick
42723d88d3 mesa: Do something sensible when on-line compression is requested but not possible
It is possible to force S3TC extensions to be enabled.  This is
generally done to support applications that will only supply
pre-compressed textures.  This accounts for the vast majority of
applications.

However, there is still the possibility of an application asking for
on-line compression.  In that case, generate a warning and substitute a
generic compressed format.  The driver will either pick an uncompressed
format or a compressed format that Mesa can handle on-line (e.g., FXT1).

This should only cause problems for applications that request on-line
compression and read the compressed texture back.  This is likely an
infinitesimal subset of an already infinitesimal subset.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 15:09:38 -07:00
Ian Romanick
0e0d664461 i965: Allow creation of OpenGL 3.1 contexts
v2: Fix API_OPENGL_CORE handling when TEXTURE_FLOAT_ENABLED is not
defined.  Based on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:38 -07:00
Ian Romanick
2a33a99737 i965: Advertise GLSL 1.40 and TexBOs in core contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:38 -07:00
Ian Romanick
91473485fc intel: Clean up bits of cruft in intelCreateContext
This and the previous three commits should probably be squashed together...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
bf8644e64d i965: Set context flags
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
ca2b1fcb30 mesa/dri: Allow creation of forward-compatible contexts
This is done by changing the API to API_OPENGL_CORE.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
36ceabfb74 mesa/es: Enable GL_OES_vertex_array_object
Functionally the same as GL_ARB_vertex_array_object.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:37 -07:00
Ian Romanick
35cf6aeb8c mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers
This is a purely software extension.  The drivers don't need to do any
work to support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:37 -07:00
Ian Romanick
d1cf5c77b7 meta: Don't use deprecated keyword in 1.30 shader
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
ae88281b7b mesa: Disallow alpha, luminance, and LA textures in core context
Also disallow the 1, 2, 3, and 4 formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
04d6ffa06d mesa: Disallow more deprecated functions in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
91107b4ccf mesa: Require names from Gen in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
843b876ba3 mesa: Allow NULL vertex pointer without a VBO
There is text in the OpenGL 3.x specs to explicitly allow this case.
Weird.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
792214e8d4 mesa: Disallow VertexAttribPointer without a VAO in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
29512df635 mesa: Disallow wide lines in forward compatible context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
7e1cab09a1 mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context
Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list
of deprecated functionality):

    "Separate polygon draw mode - PolygonMode face values of FRONT and
    BACK; polygons are always drawn in the same mode, no matter which
    face is being rasterized."

Also modify meta to not use FRONT or BACK in a core context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Paul Berry
d638da23d2 meta: Don't stray outside the confines of the API specified in the context
Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
8e7b6a69e9 mesa: Don't allow display lists or evaluators in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
2bcf555490 mesa: Don't allow GL_EXTENSIONS query in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
c85a9a9996 mesa: Non-sprite points are deprecated
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Eric Anholt
7d8d1c7819 mesa: Fix VAO deletion on GL 3.1 core.
We were calling through a dispatch table entry that was NULL, since the apple
variant is only on legacy desktop.  Just call the function we mean instead of
indirecting through the dispatch.
2012-08-29 15:09:36 -07:00
Eric Anholt
8a4d560796 mesa: Enable a bunch of missing getters on 3.1 core.
NOTE: maybe I enabled too many?
2012-08-29 15:09:36 -07:00
Eric Anholt
bb4a39ec95 mesa: Expose texture buffer objects when the context is GL 3.1 core.
v2: Use API_OPENGL_CORE.

v3: Only require desktop GL.  If a driver can't support TexBOs in a non-core
context, it should not enable them.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 15:09:36 -07:00
Ian Romanick
1b86a91c64 mesa: Allow PACK / UNPACK queries for ES2
These are part of the GL_EXT_unpack_subimage extension and ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
a010215463 mesa: Kill ES2 wrapper functions
v2: Fix completely broken condition around ClearColorIiEXT and
ClearColorIuiEXT.

v3: Add special VertexAttrib handling for ES2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
fc2219e448 mesa: glGetVertexAttribPointerv is part of core profile and ES2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
917f68071b mesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:36 -07:00
Ian Romanick
f778174ea1 mesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN
The comment in the code even says this is the right thing to do.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:36 -07:00
Ian Romanick
25ffb86893 mesa: Require that drivers supporting point sprites support point parameters
All drivers in Mesa do.  This allows a lot of extension checking code to be
gutted from the function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:35 -07:00
Ian Romanick
33e01d93ca mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
8a263b6efd mesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
d2b03f6e99 mesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
f329adfa49 mesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
0fa4ed05cf mesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
fb4f2d3425 mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
8df3f9bd5f mesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper
Fixes a bug that glGetMaterial[fx]v in ES1 contexts would (try to) allow
queries of GL_AMBIENT_AND_DIFFUSE.  This enum can only be used in glMaterial,
not in the get.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
9555d7bdc1 mesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile, GLES1, and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
d6c8913bc6 mesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
10e7db1ccf mesa/es: Validate glFog pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
b7c7e5e45a mesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
4114dee99e mesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
08be1d288f mesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper
Also handle glDisable, glIsEnabled, glEnableClientState, and
glDisableClientState.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
bca2cece02 mesa/es: Validate glHint target in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
2c87030a00 mesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Allow glGetVertexAttribfv(0, GL_CURRENT_VERTEX_ATTRIB_ARB, param) in
OpenGL 3.1, just like OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
c13f36ce4e mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
6a9b8f897a mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
72e076cb17 mesa: Refactor _mesa_valid_prim_mode to use a switch-statement
This makes the next change a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
01497a3560 mesa/es: Validate blend function enums in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

v3: Allow GL_SRC_ALPHA_SATURATE as a destination factor in GLES3.  Based
on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
e58c19a204 mesa/es: Validate glClear mask in Mesa code rather than the ES wrapper 2012-08-29 15:09:34 -07:00
Ian Romanick
f0c99d0a6a mesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Allow GL_RGB10_A2UI in GLES3 based on review feedback from Eric
Anholt.

v4: Arg.  Reject unsized RED and RG enums on GLES.  More feedback from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
ae86ebfcc9 mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:34 -07:00
Ian Romanick
0cdaa471ec mesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile, GLES1, and GLES3 filtering.

v3: Fix the GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query when the
attachment type is GL_NONE on GLES3.  Other cleanups.  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
5b44a77428 mesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Fix a typo in GL_TEXTURE_2D_ARRAY checking.

v4: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
7f991d26ad mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Tom Stellard
2809ae3d44 radeon/llvm: Fix encoding of FP immediates on SI 2012-08-29 15:52:10 -04:00
Tom Stellard
05113fd266 radeon/llvm: Create a register class for the M0 register
The Common Subexpression Elimination pass will not operate on
instructions with physical register defs, so we end up with
several redundant copies to M0 when using interpolation.

Adding a register class that only contains the M0 register allows
use to use a virtual register to represent M0, and makes it possible
for the Common Subexpression Elimination pass to remove the extra
copies.
2012-08-29 15:52:10 -04:00
Tom Stellard
733c28a0d9 radeon/llvm: Set the neverHasSideEffects bit on more instructions
This flag makes these instructions candidates for the dead code
elimination and common subexpression elimination.
2012-08-29 15:52:10 -04:00
Tom Stellard
cf4ac69928 radeon/llvm: Declare the interpolation intrinsics as ReadOnly
This signals to the Dead Code Elimination pass that it is safe to
remove these instructions when they are dead.
2012-08-29 15:52:10 -04:00
Tom Stellard
73a2c4b9db radeon/llvm: Mark M0 as a def when lowering interpolation instructions 2012-08-29 15:52:10 -04:00
Anuj Phogat
0fc11a24c8 meta: Add GLSL variant of _mesa_meta_GenerateMipmap() function
This reduces the overhead of using the fixed function internally
in the driver.

V2: Use setup_glsl_generate_mipmap() and setup_ff_generate_mipmap()
    functions to avoid code duplication.
    Use glsl version when ARB_{vertex, fragmet}_shader are present.
    Remove redundant code.

V3: Remove redundant border related code leaving the assertion.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-29 11:43:52 -07:00
Brian Paul
c824804c6f glsl: s/class/struct/ for ast_type_qualifier
To silence an MSVC compiler warning about class vs. struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 12:08:46 -06:00
Brian Paul
ec6478fd32 mesa: convert a few more macros to inline functions 2012-08-29 08:20:58 -06:00
Brian Paul
cf41d7c63a mesa: remove COPY_4V_CAST() macro
Only used in one place, and not really needed.
2012-08-29 08:20:58 -06:00
Brian Paul
fd9afb87d8 mesa: convert a bunch of math macros to inline functions 2012-08-29 08:20:58 -06:00
Brian Paul
454e23776d tnl: use INTERP_4F() instead of four INTERP_F() calls 2012-08-29 08:20:58 -06:00
Brian Paul
ba6f47132d swrast: fix wrong assignments in _swrast_add_spec_terms_line() 2012-08-29 08:20:58 -06:00
Brian Paul
1aee8803f8 mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.
2012-08-29 08:20:57 -06:00
Martin Pieuchot
c4c4d4ad1e mesa: Define CPU_TO_LE32 to work on OpenBSD
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-29 08:05:17 -06:00
Brian Paul
4aede0018a docs: remove mention of old driver maintenance
People who need old drivers can use older versions of Mesa.
2012-08-28 13:09:02 -06:00
Andreas Boll
6eaccbfeeb docs/utilities: add/update some useful utilities
the progs/util directory is now in mesa demos
replace glean with piglit
add ApiTrace

markup: replace the unordered list <ul> with a definition list <dl>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-28 13:08:56 -06:00
Eric Anholt
67e9ae8563 i965: Disable the swrast context setup on GL 3.1 core.
I've reviewed the code, and the swrast callsites remaining are all in
drawpixels/copypixels/bitmap/accum, or _swrast_BlitFramebuffer that shouldn't
be hit.  A piglit run with the context setup disabled on legacy GL and GLES2
showed regressions only in the copypixels and drawpixels tests.

If the context type is forced, this reduces the shader_runner maximum heap
size for glsl-algebraic-add-add-1.shader_test from 15,137,496b to 4,165,376b.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
993c52d0be i965: Replace general sw fallback support with a manual check for rendermode.
There were no other cases that set it any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
b0d23b66cf intel: Move RenderMode fallback func to i915 driver.
The Fallback field of the context struct doesn't work that way on i965, and
it's the only caller of FALLBACK() in the driver.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
628dfe9511 i965: Drop the old sw fallback for position array being disabled.
This code has been in the driver since the first commit.  I think it was
trying to stop rendering from happening with a disabled position array.  Core
mesa has since had changes to deal with disabled position arrays correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
5e3c093ff8 i965: Drop support for forcing drawing through sw fallbacks.
It turns out it hasn't worked since at least 8.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
bfae8650ec i965: Move depth resolve for span fallbacks to a simpler place.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
707f242c4b i965: Drop manual hiz resolves in span rendering.
swrast uses MapRenderbuffer, which leads to intel_miptree_map, which does the
depth resolve.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Michel Dänzer
70f9dbe298 radeon/llvm: Handle TGSI KIL opcode for SI.
Fixes piglit fp-kil and glBitmap() with radeonsi.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-28 20:27:23 +02:00
Michel Dänzer
16e42a5dd0 radeon/llvm: Basic support for SI EXEC register.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-28 20:26:50 +02:00
Michel Dänzer
6ca64393c9 radeonsi: Don't write to the PA_SC_RASTER_CONFIG register.
It should be initialized by the kernel as necessary.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-08-28 20:24:52 +02:00
Marek Olšák
999b7f6665 r600g: fix relative addressing on RS780 and RS880
They should be treated like RV670.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 18:27:03 +02:00
Andreas Boll
3e20605c16 docs/helpwanted: add radeonsi todo list
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 17:36:07 +02:00
Andreas Boll
17f09b664b configure.ac: add radeonsi to --with-gallium-drivers help string
the help string is used by ./configure --help

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 17:35:36 +02:00
José Fonseca
bc8509b43b llvmpipe: Bump the maximum texture size (in pixels).
But cap the size in bytes, to avoid depleting the whole system memory,
with humongus textures.

Tested with max-texture-size piglit test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-28 15:18:43 +01:00
Vadim Girlin
6463eb013f u_vbuf: avoid unnecessary update of the vertex elements
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-28 18:01:13 +04:00
Matt Turner
971750e1cd egl: fix invalid flag detection for EGL_KHR_create_context
We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-27 15:11:11 -07:00
Kenneth Graunke
77d675926a i965: Make VS programs obey the shader_precompile driconf option.
Now that it's on by default, we may as well make it obey the flag,
for consistency's sake if nothing else.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
9ef710575b i965: Reenable the fragment shader precompile.
Precompiling the shader at link time often allows us to avoid compiling
it at the first use.  This moves the expensive compilation and
optimization process to game or level load time, rather than at draw
time, where we really can't avoid any cycles and don't want to risk
stalling the GPU.

The downside is that we have to guess the non-orthagonal state the
program will have set when it draws with the shader.  Previously, we
guessed wrong for nearly every shader, so it wasn't useful.  With the
recent SamplerUnits rework and this series, we've either eliminated
state or made smarter guesses, and usually get it right now.

In the L4D2 time demo, I now have 39 fragment shader recompiles and no
vertex shader recompiles.  Before this series and the SamplerUnits
rework, I had 206 fragment shader recompiles and 192 vertex shader
recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
88b3850c27 i965: Set swizzle fields in the VS precompile program key.
This fixes a regression since 76d1301e8e:
I began setting SWIZZLE_XYZW for unused sampler units in the actual
program keys, since this matched the FS precompile behavior.  However,
the VS precompile was expecting zero, so that commit made essentially
every vertex shader (even those not using texturing) mismatch and need
to be recompiled.

Setting them in the VS precompile key solves the issue.  It also is an
improvement over our old behavior: previously we guessed that vertex
shaders didn't use any textures at all.  Now we actually look to see if
the VS had any sampler uniforms and guess based on that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
c20cb8d1f6 i965/vs: Add VS program key dumping to INTEL_DEBUG=perf.
Eric added support for WM key debugging.  This adds it for the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
85b24b0751 i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.
Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth
textures.  There are no Y, Z, or W components.

DEPTH_TEXTURE_MODE has three options:
- GL_LUMINANCE: <X, X, X, 1>
- GL_INTENSITY: <X, X, X, X>
- GL_ALPHA:     <0, 0, 0, X>

The default value is GL_LUMINANCE, and most applications don't seem to
alter DEPTH_TEXTURE_MODE.  Make that our precompile guess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
f3d0daf7ea i965: Index sampler program key data by linker-assigned index.
Now that most things are based on the linker-assigned index, it makes
sense to convert the arrays in the VS/WM program key as well.  It seems
silly to leave them indexed by texture unit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
ab17762c70 i965: Only set proj_attrib_mask for fixed function.
brw_wm_prog_key's proj_attrib_mask field is designed to enable an
optimization for fixed-function programs, letting us avoid projecting
attributes where the divisor is 1.0.

However, for shaders, this is not useful, and is pretty much impossible
to guess when building the FS precompile key.  Turning it off for
shaders should allow the precompile to work and not lose much.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
6cc14c2493 i965: Don't set stats_wm in the WM program key on Gen6+.
It's only needed for Gen4/5 IZ lookup workarounds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
b6b1fc1261 i965: Don't set vp_outputs_written in the WM program key on Gen6+.
It's only used by on pre-Sandybridge hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:39 -07:00
Kenneth Graunke
87cdefed40 i965: Double the size of the state cache.
We probably want to do something more sophisticated here, but this at
least makes it through L4D2 without dumping the program cache.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:39 -07:00
Julien Cristau
ac889b2410 glapi/glx: call __glEmptyImage if USE_XCB, not memcpy directly
We were stomping on the caller's buffer by ignoring their alignment
requests and other pixel store modes.  This patch makes the USE_XCB path match
the older one more closely.

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

Signed-off-by: Julien Cristau <julien.cristau@logilab.fr>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-27 13:32:53 -06:00
Brian Paul
f308c80490 gallium/util: implement tile code for PIPE_FORMAT_Z32_FLOAT
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-27 13:32:53 -06:00
Brian Paul
a971476cc7 st/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)
Fixes many failing cases in piglit copyteximage test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-27 13:32:53 -06:00
Chad Versace
88edbdf9f0 i965: Move hiz resolve to after renderbuffer resizing (v2)
Do all pre-draw hiz resolves *after* the renderbuffers are resized by
intel_prepare_render. Otherwise, we may resolve buffers that are
immediately discarded afterwards.

Fixes the assertion failure below when resizing windows in KDE and under
some unknown circumstance in Chrome OS:
    intel_resolve_map.c:46: intel_resolve_map_set: Assertion
    `(*tail)->need == need' failed.

Also, remove the comment that "resolves must occur [...] before setting up
any hardware state". That was true when resolves were implemented with
meta-ops, but no longer with blorp.

v2:
  - Keep brw_predraw_resolve_buffers in its current position, which is
    before any brw_context bits are modified. Instead, move the call to
    intel_prepare_render.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-27 07:48:28 -07:00
Chad Versace
a2a7e640a4 i965: Remove redundant null check
intel_renderbuffer_resolve_hiz checks if rb->mt is null, so there is no
need for the caller to do so.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-27 07:47:09 -07:00
Marek Olšák
7f0fcf17c3 r300g: implement TRUNC correctly
This fixes some integer division tests.
2012-08-27 14:35:18 +02:00
Michel Dänzer
f402acdbe2 radeonsi: Use FP16 shader export format when necessary / possible.
Fixes piglit fbo-blending-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:56 +02:00
Michel Dänzer
26c7139d2c radeonsi: Refactor initialization of shader export intrinsic arguments.
In preparation for extending this code, which would make it rather unwieldy in
its current place.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:49 +02:00
Michel Dänzer
d1e40b3d40 radeonsi: Maintain cache of pixel shader variants according to contxt state.
Mostly inspired by r600g commit 4acf71f01e
('r600g: cache shader variants instead of rebuilding v3').

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:41 +02:00
Michel Dänzer
84fdda280f radeonsi: Drop extraneous semicolons from pm4 state macro definitions.
Could cause build failures if trying to use the macros in certain constructs.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:50:38 +02:00
Marek Olšák
a3d9d7ec79 r600g: implement compression for MSAA colorbuffers for evergreen
This adds the FMASK and CMASK buffers. They share the same resource
with color data.

COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are
allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"),
so that we can keep FAST_CLEAR enabled all the time.

Both FMASK and CMASK must be present at the moment. If either one is missing,
the other one is not used.

v2: add cayman regs in the list

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
48edfe0505 r600g: cleanup names around depth decompression
for consistency with the upcoming color decompression naming

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
3ac54ac2c8 r600g: fix evergreen 8x MSAA sample positions
The original samples positions took samples outside of the pixel boundary,
leading to dark pixels on the edge of the colorbuffer, among other things.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
1cfec6e2c8 r600g: set CB_TARGET_MASK to 0xf and not 0xff for resolve on evergreen
independent_blend_enable must be true, so that the colormask isn't replicated
in all colorbuffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:30:59 +02:00
Marek Olšák
1516a4f353 gallium/u_blitter: initialize sample mask in resolve
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:30:59 +02:00
Tom Stellard
07c71d6ede r300/compiler: Use variable lists in the rename_regs pass 2012-08-26 20:39:49 -04:00
Eric Anholt
7540f25a34 i965: Rewrite the comment describing the query object support.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
f0159018d7 i965/gen6+: Add support for GL_ARB_timer_query.
Needs updated libdrm.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
9a2943ddf2 i965: Add support for GL_ARB_occlusion_query2.
This extension is just a bit of core code on top of the GL_ARB_occlusion_query
support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
b765119c5d mesa: Add constants for the GL_QUERY_COUNTER_BITS per target.
Drivers need to be able to communicate their actual number of bits populated
in the field in order for applications to be able to properly handle rollover.

There's a small behavior change here: Instead of reporting the
GL_SAMPLES_PASSED bits for GL_ANY_SAMPLES_PASSED (which would also be valid),
just return 1, because more bits don't make any sense.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-26 10:40:28 -07:00
Eric Anholt
6754ec831e i965: Fix accumulator_contains() test to also reject swizzles of the dst.
When faced with this sequence:

	MOV	R1, c[1];
	MAD	R0, R2, R1.x, R1.y;

we were concluding that the MOV of R1 set up our accumulator and so we could
just use the previous result.  Only, it's got R1.xyzw in it instead of the
r1.y we're looking for.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46784
NOTE: This is a candidate for the 8.0 branch.
2012-08-26 09:58:40 -07:00
Jakob Bornecrantz
33ee019422 st/dri: Support width and height getters
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:40:18 +02:00
Jakob Bornecrantz
15effe1fab st/dri: Claim to support validate_usage
Support version 3 as well as 2, since that is only the new format query,
which Jesse added support for to st/dri when he added it to dri_inteface.h.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:40:10 +02:00
Jakob Bornecrantz
93ebec87ed dri: Make query image WIDTH and HEIGHT be version 4
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:50 +02:00
Jakob Bornecrantz
6bb71b8cbe dri: Remove image write function
Since its not used by anything anymore and no release has gone out
where it was being used.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:41 +02:00
Jakob Bornecrantz
a669a5055e gbm: Use libkms to replace DRI cursor images
Uses libkms instead of dri image cursor. Since this is the only user of the
DRI cursor and write interface we can remove cursor surfaces entirely from
the DRI interface and as a consequence also from the Gallium interface as
well. Tho to make everybody happy with this it would probably should add a
kms_bo_write function, but that is probably wise in anyways.

The only downside is that it adds a dependancy on libkms, this could how ever
be replaced with the dumb_bo drm ioctl interface.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:23 +02:00
Kenneth Graunke
a3685544e1 i965: Don't set iz_lookup the FS precompile's program key on Gen6+.
We already changed the actual program key builder to only set these bits
on gen < 6; this patch just brings the precompile state back in line so
it doesn't mismatch every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 23:05:35 -07:00
Kenneth Graunke
98211d5af7 i965/fs: Fix INTEL_DEBUG=perf program key printing.
When dumping differences in program keys, it printed messages of the
format:

   [Name of thing that changed]  [new]->[old]

This was terribly confusing: the right arrow implies "the value changed
from this to that", when in fact the message conveyed the opposite.

Except that some of the time, it didn't, since we accidentally swapped
the arguments to brw_debug_recompile_sampler_key.  With two swaps, it
would often come out in the expected format.

This patch fixes it to properly print:

   [Name of thing that changed]  [old]->[new]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-25 23:01:50 -07:00
Kenneth Graunke
174d44a9c4 mesa: Use a new, more specific hook for shader uniform changes.
Gallium drivers and i965 don't require special notification when
sampler uniforms change.  They simply see the _NEW_TEXTURE and adjust
their indirection tables.  These drivers don't want ProgramStringNotify:
it simply causes pointless recompiles.

Unfortunately, i915 still requires shader recompiles and needs
ProgramStringNotify.  Rather than trying to fix that, simply change the
hook to a new, more specific one: ShaderUniformChange.  On i915, this
translates to ProgramStringNotify; others simply ignore it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
85e8e9e000 i965: Use linker-assigned sampler IDs in instruction encoding.
When assigning uniform locations, the linker assigns each sampler
uniform a sequential numerical ID.  gl_shader_program::SamplerUnits maps
these sampler variable IDs to the actual texture units they reference
(specified via glUniform1i).

Previously, we encoded this mapping in the SEND instruction encoding:
the "sampler" was the texture unit number, and the binding table index
was SURF_INDEX_TEXTURE(the texture unit number).  This unfortunately
meant that whenever the application changed the value of a sampler
uniform, we had to recompile the shader to change the SEND instructions.

This was horrible for the game Cogs, which repeatedly switches between
using texture unit 0 and 1.  It also made fragment shader precompiles
useless: we'd do the precompile at glLinkShader() time, before the
application called glUniform1i to set the sampler values.  As soon as
it did that, we'd have to recompile, wasting time and space in the
program cache.

This patch encodes the SamplerUnits indirection in the binding table,
sampler state, and sampler default color tables.  Instead of baking the
texture unit number into the shader, we bake in the sampler variable ID
assigned by the linker.  Since those never change, we don't need to
recompile programs on uniform changes.

This does mean that the tables now depend on the linked shader program
being used for rendering, rather than simply representing all available
texture units.  This could cause an increase in state emission.

Another plus is that the sampler state and sampler default color tables
are now compact: we only emit as many entries as there are sampler
uniforms, with no holes in the table since the new sampler IDs are
sequential.  Previously we had to emit a full 16 entries every time,
since the tables tracked the state of all active texture units.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
2faa592e7f i965: Add a "sampler state index" parameter to update_sampler_state().
This represents the index into the sampler state table or sampler
default color table (the two are identical).

Right now, this is still the texture unit, but that will change shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
28fab4295e i965: Un-hardcode WM binding table from update_texture_surface.
Currently, we mirror the VS and WM binding tables' texture entries.
That may not continue to be true, so in preparation, pass in the binding
table and surface index as arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
96a22f3583 i965/vs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
0ad2dce24a i965/fs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Don't bother renaming fs_instruction::sampler.  Although it's currently
the texture unit, this series will change that.  No need for the churn.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
bf0308d8d6 i965/fs: Remove unused 'sampler' parameter in emit_texture_genX().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
76d1301e8e i965: Set SWIZZLE_NOOP for unused texture units in the program keys.
Previously, we left the swizzle key field as zero for unused texture
units.  The precompile sets all of them to SWIZZLE_NOOP, which meant
that we mismatched almost every time.

Since either works equally well, change it to SWIZZLE_NOOP to match
the precompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
f510dd5d60 i965: Remove four and a half year old TODO comments about samplers.
I can't actually understand what these mean, and they seem to
essentially say "we should simplify things", which is a nice goal but
not very specific.

Presumably things got cleaned up at some point.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
d1447f5bc9 i965: Fix brw_link_shader to return false rather than NULL.
Fixes brw_shader.cpp:101:9: warning: converting to non-pointer type
'GLboolean {aka unsigned char}' from NULL [-Wconversion-null]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-with-great-enthusiasm-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Ian Romanick
f9767dac9a mesa/es: Validate glGetBufferParameteriv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:15:20 -07:00
Ian Romanick
93d109645a mesa/es: Validate glMapBuffer access in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: *Really* add proper core-profile and GLES3 filtering based on review
feedback from Eric Anholt.  It looks like previously there was some
rebase / merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
bd4e5dd355 mesa/es: Validate glBufferData usage in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering based on review feedback
from Eric Anholt.  It looks like previously there was some rebase /
merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
b0b6b76d52 mesa/es: Validate buffer object targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
e2cf14d7b2 mesa/es: Validate VertexPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
ef723ecce4 mesa/es: Remove redundant vertex pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
a8f475d8f6 mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
c3e9a207d0 mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
e5ef0cbe0e mesa/es: Validate NormalPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
fb8218508a mesa/es: Validate ColorPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
07ccfef8d1 mesa/es: Validate ColorPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
28ee443d7b mesa/es: Remove redundant vertex attrib pointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
ae633d0b2e mesa/es: Remove redundant vertex attrib pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
946ddec163 mesa/es: Disallow BGRA vertex arrays in ES or ES2 contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
bbceed268e mesa: Rearrange array type checking, filter more types in ES
v2: Fix handling of GL_INT and GL_UNSIGNED_INT types pre-ES3.0, and fix
handling of GL_INT_2_10_10_10_REV and GL_UNSIGNED_INT_2_10_10_10_REV in
ES3.0.  Based on review comments by Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
a33f360e8f mesa: Refactor element type checking into its own function
This consolidates the tests and makes the emitted error message
consistent.

v2: Rename _mesa_valid_element_type to valid_elements_type.  Log the
enum string instead of the hex value in error messages.  Based on review
comments from Brian Paul and Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 19:13:12 -07:00
Brian Paul
229868edf7 wgl: update some comments 2012-08-24 14:09:03 -06:00
Brian Paul
4b7c0938e4 st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures
As with the previous commit for core Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
a3af27e993 mesa: add generic compressed -> uncompressed format helper
_mesa_generic_compressed_format_to_uncompressed_format() probably wins the
prize for longest function name in Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
13d0bb21a9 mesa: don't try (generic) compression of 1D and 1D_ARRAY textures
See comments in the code for details.

Note: we only need to special-case the generic compressed formats since
specific texture formats are error-checked earlier to see if the compression
format is compatible with the texture type.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
d47a6ada9c mesa: add texture target field to ChooseTextureFormat() driver hook
This will let us choose the actual hardware format depending on the
type of texture.

v2: fixup radeon, nouveau, intel and swrast drivers too

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 14:08:57 -06:00
Brian Paul
ba7218061b xlib: remove texture compression hackery
I think this was left-over debug code from long ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 13:15:27 -06:00
Brian Paul
09fafd3b85 st/mesa: clean up use of 'target' variable in st_context_teximage()
'target' was used both as a parameter of type st_texture_type and then
re-used for GL_TEXTURE_x targets.  Rename the function parameter and
add a new local 'GLenum target'.

And remove an extraneous break statement.
2012-08-24 13:15:27 -06:00
Matt Turner
261719b21c automake: convert vgapi 2012-08-24 11:08:19 -07:00
Matt Turner
ba4a36d8cd build: Check for bison-generated file before bailing because of no bison
.y/.c was a typo.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner
179d8aa331 Move _mesa_dl* functions into dlopen.h and inline them
No point in having an extra function call for inlinable functions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Tapani Pälli
57c57df7b4 mesa/dlopen: use HAVE_DLOPEN instead of _GNU_SOURCE
Patches changes mesa to use 'HAVE_DLOPEN' defined by configure and Android.mk
instead of _GNU_SOURCE for detecting dlopen capability. This makes dlopen to
work also on Android where _GNU_SOURCE is not defined.

[mattst88] v2: HAVE_DLOPEN is sufficient for including dlfcn.h, remove
	       mingw/blrts checks around dlfcn.h inclusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner
df4dccc7a9 build: Only add links to .so files if we're building them
Xlib-GLX and OSMesa support static building.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53962
2012-08-24 11:08:19 -07:00
Matt Turner
c56b57f4a1 build: Add libOSMesa.so.$(VERSION) link to libdir 2012-08-24 11:08:19 -07:00
Matt Turner
a8fd8cb9e7 build: Replace OSMESA_VERSION with generic VERSION_NUMBER
Can be used by other modules.
2012-08-24 11:08:19 -07:00
Matt Turner
383a70bf9a build: Order AC_CONFIG_FILES list
Makefiles before .pc files before directories. Alphabetize files of the
same type.
2012-08-24 11:08:19 -07:00
Matt Turner
8cdce6c136 build: Only build libmesa.la when needed
Namely, for Xlib-GLX, OSMesa, or test programs.
2012-08-24 11:08:19 -07:00
Matt Turner
00f3d9b11a build: Remove duplicate DRI automake conditionals 2012-08-24 11:08:19 -07:00
Matt Turner
d23b1b7977 build: Remove GLU_DIRS 2012-08-24 11:08:19 -07:00
Matt Turner
0abb26ebff build: Only generate dispatch assembly code that will be built 2012-08-24 11:08:19 -07:00
Paul Berry
5133bd6585 i965: don't clear resolve map when doing fast depth clears.
Previously, when performing a fast depth clear, we would also clear
the miptree's resolve map.  This destroyed important information,
since the resolve map contains information about needed resolves for
all levels and layers of the miptree, whereas a depth clear only
applies to a single level/layer combination at a time.  As a result,
resolves would sometimes fail to occur, leading to incorrect
rendering.

Fixes rendering artifacts with shadow maps in Unigine Heaven and
Unigine Sanctuary.

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00
Paul Berry
4b8b6f385e i965/HiZ: remove assertion from intel_resolve_map_set().
There are three possible resolve map states for each (level, layer) of
a depth miptree: "needs HiZ resolve", "needs depth resolve", and
"needs neither".  When HiZ was first implemented on i965, any attempt
to directly transition between "needs HiZ resolve" and "needs depth
resolve" without passing through the "needs neither" state would have
been a bug indicating that a necessary resolve hadn't been performed.
Accordingly, intel_resolve_map_set() contained an assertion to verify
that no such direct transition happened.

However, now that we support fast depth clears, there is a valid
transition from the "needs HiZ resolve" to the "needs depth resolve"
state.  When doing a fast depth clear, the old state of the buffer is
irrelevant, since we are completely replacing it with the clear value,
so it is not necessary to do any resolves before clearing--we can
transition, if necessary, directly from the "needs HiZ resolve" state
to the "needs depth resolve" state.

To avoid spurious assertions in this valid case, this patch just
removes the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00
Christian König
9aacd5cc67 radeonsi: remove old tilling handling
Just use the functionality provided by the surface manager instead.

This fixes just another bunch of piglit tests.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-24 18:11:31 +02:00
Ian Romanick
86f29cf7d0 mesa/es: Validate glCreateShader targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Ian Romanick
b042f7a1ff mesa/es: Validate glGetProgramiv pnames in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Ian Romanick
1a200b68cd mesa: Filter glGetProgramiv pnames based on available extensions
Previously you could always glGetProgramiv one of the transform feedback
or geometry shader enums even if the extension wasn't supported.

In addtion, this reverts part of bda6ad27.  I think the hunks involving
GL_PROGRAM_BINARY_LENGTH_OES were spurious.  Mesa has no support for any
other part of GL_OES_get_program_binary.

v2: Remove redundant return in get_programiv based on review feedback
from Matt Turner.

v3: Correctly handle UBO related enums.

v4: Emit the bad enum in the _mesa_error call based on review feedback
from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Brian Paul
9282ebbaa5 swrast: implement cubical depth texture sampling
Fixes a few more failures in the piglit copyteximage test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 09:38:44 -06:00
Blaž Tomažič
87280d56a3 clover: Accept CL_MEM_READ_WRITE flag
Fix API functions for memory objects to accept CL_MEM_READ_WRITE flag.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
[ Francisco Jerez: Drop incorrect change in clCreateSubBuffer. ]
2012-08-24 17:10:14 +02:00
Tom Stellard
167ecf5ba3 radeon/llvm: Cleanup R600Instructions.td 2012-08-24 14:14:55 +00:00
Brian Paul
388af5b6f4 main: fix ES compile breakage 2012-08-24 06:40:06 -06:00
Brian Paul
4fec5e9154 mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for dxt formats
As with the previous commit.

This fixes the last crash in the piglit copyteximage test but there's
still some failures.
2012-08-24 06:18:42 -06:00
Brian Paul
d78b44c265 mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formats
Fix-up the texel fetch functions so that they handle 3D coords (as used for
array textures) and remove the "f_2d" part from their names.

Helps fix swrast crashes in piglit's copyteximage test.  More to come.
2012-08-24 06:18:41 -06:00
Brian Paul
fe2cc65fbb mesa: code movement in teximage.c
To get rid of a forward declaration.
2012-08-24 06:18:41 -06:00
Brian Paul
bdff1dfb39 mesa: consolidate glTexImage and glCompressedTexImage code
There was a lot of similar or duplicated code before.
To minimize this patch's size, use a forward declaration for
compressed_texture_error_check().  Move the function in the next patch.
2012-08-24 06:18:41 -06:00
Brian Paul
e93cb4b34f mesa: make glTexImage, glCompressedTexImage proxy code more alike
Next up, we can combine the teximage() and compressed_teximage() functions.
2012-08-24 06:18:41 -06:00
Brian Paul
c1a9e6010b mesa: rename texpal.[ch] to texcompress_cpal.[ch]
To be consistent with other files related to texture compression.
2012-08-24 06:18:41 -06:00
Brian Paul
aab06dc0f0 mesa: s/GLuint/gl_format/ in _mesa_compressed_format_to_glenum()
No real change here, just use the right type.
2012-08-24 06:18:41 -06:00
Brian Paul
46751edca9 mesa: new _mesa_num_tex_faces() helper
Not a real big help now, but will be useful for the
GL_ARB_texture_cube_map_array extension in the future.
2012-08-24 06:18:41 -06:00
Brian Paul
8a935d71ff mesa: make _mesa_get_proxy_tex_image() static
It's not used by any other file.
2012-08-24 06:18:41 -06:00
Brian Paul
637a79aa23 mesa: don't clear proxy image fields when regular GL error is generated
If a proxy texture call generates a regular GL error, we should not
clear the proxy image's width/height/depth/format fields.  Use a new
PROXY_ERROR token to distinguish proxy errors from regular GL errors.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 06:18:41 -06:00
Brian Paul
1f5b1f9846 mesa: fix glTexImage proxy texture error generation
When calling glTexImage() with a proxy target most error conditions should
generate a GL error.  We were erroneously doing the proxy-error behaviour
(where we zeroed-out the image's width/height/depth/format fields) in too
many places.

There's another issue with proxy textures, but that'll be fixed in the
next patch.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 06:18:41 -06:00
José Fonseca
3e3f99277d draw: Fix regression in draw_set_sampler(_views).
draw->samplers(_views) now has PIPE_SHADER_TYPES elements, instead of
PIPE_MAX_SAMPLERS as before.

Also, shader_stage must be less than PIPE_SHADER_TYPES to prevent buffer
overflow.

Trivial.
2012-08-24 11:28:00 +01:00
Vadim Girlin
e84d45fdb7 build: don't leave git_sha1.h.tmp after build/install
Fixes "`main/git_sha1.h.tmp': Permission denied" build error.
See https://bugs.freedesktop.org/show_bug.cgi?id=52064

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 11:16:14 +04:00
Tom Stellard
1434a86f50 radeon/llvm: Set End of Program bit on RAT instructions
This code was accidently dropped during the MCCodeEmitter conversion.
2012-08-23 21:54:32 +00:00
Tom Stellard
1bd7b29a66 radeon/llvm: Use correct instruction for moving immediates
This should fix an assertion failure that was happening in some compute
shaders.
2012-08-23 21:54:32 +00:00
Tom Stellard
2ad8608cb3 radeon/llvm: Fix some coding style issues 2012-08-23 21:54:32 +00:00
Tom Stellard
228a6641cc radeon/llvm: Pull changes from external version of the backend 2012-08-23 21:54:32 +00:00
Tom Stellard
5a1edb8655 radeon/llvm: Simplify the convert to ISA pass 2012-08-23 21:54:32 +00:00
Tom Stellard
cb5227b403 radeon/llvm: Make sure to use the Text section in the AsmPrinter 2012-08-23 21:54:31 +00:00
Matt Turner
68a2c510a6 build: Fix installation of GLES2 headers
Reported-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Tested-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-08-23 14:07:35 -07:00
Matt Turner
fc9ea7c74d build: Fix GLES linkage with libglapi
Reported-by: Ian Romanick <idr@freedesktop.org>
2012-08-23 14:07:35 -07:00
Anuj Phogat
e592f7df03 i965/msaa: Add sample-alpha-to-coverage support for multiple render targets
Render Target Write message should include source zero alpha value when
sample-alpha-to-coverage is enabled for an FBO with  multiple render targets.
Source zero alpha value is used as fragment coverage for all the render
targets.

This patch makes piglit tests draw-buffers-alpha-to-coverage and
alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No
regressions are observed with piglit all.tests.

V2: Revert all the changes made in emit_color_write() function to
include src0 alpha for targets > 0. Now handling this case in a if
block.

V3: Correctly calculate the instruction length for buffer zero.
Properly handle the case of dual_src_blend when alpha-to-coverage
is enabled.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-23 13:30:54 -07:00
Stéphane Marchesin
ff996cafce glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field
When too may uniforms are used, the error will be caught in
check_resources (src/glsl/linker.cpp).

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Benoit Jacob <bjacob@mozilla.com>
2012-08-23 11:42:19 -07:00
Ian Romanick
9b028faeaa mesa/es: Validate glCompressedTexSubImage internalFormat in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
dd0eb00487 mesa/es: Validate glCompressedTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
c11096e94a mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add GLES3 filtering.  I'm not 100% sure this is correct.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
9848e86af0 mesa/es: Validate glTexSubImage format and type in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
409620e477 mesa/es: Validate glTexImage format, type, and internalFormat in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

v3: Collapse ALPHA, LUMINANCE, and LUMINANCE_ALPHA cases per review
comment from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
0686ccac95 mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper
Also validate glCopyTexImage border.  This fixes a bug in the APIspec.
Previously glTexImage3DOES could be passed a non-zero border without error.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
59d965333c mesa: Generate an error when glCopyTexImage border is invalid
NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
2dcb40bb44 mesa/es: Add support for GL_APPLE_texture_max_level
This is desktop OpenGL functionality that has always existed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
c9689e3e55 mesa/es: Validate glGetTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile and GLES3 filtering.  GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts.  A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
b3dd524a10 mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile, GLES1, and GLES3 filtering.  GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts.  A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
4269cace79 mesa/es: Remove redundant glBindTexture target validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
3f7c8364cf mesa: Filter glBindTexture targets based on supported features.
Fixed the piglit test arb_texture_buffer_object-negative-unsupported.

NOTE: This is a candidate for stable release branches.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
530c9d764b mesa/es: Validate tex image targets in Mesa code rather than the ES wrapper
This should take care of all the TexImage, TexSubImage, CopyTexImage,
CompressedTexImage3DOES, and CopyTexSubImage type paths.

v2: Add proper core-profile and GLES3 filtering.

v3: Squash the CompressedTexImage3DOES patch per review comment from
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
ea9b212fca mesa/es: Validate EGLImageTargetTexture2DOES target in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
a0595cb450 mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapper
Ditto for glGetTexParameter targets.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
842efb9447 mesa/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:29 -07:00
Ian Romanick
d53101a9f3 mesa: Refactor validate_texture_wrap_mode to use a switch-statement
This makes the next couple changes a little easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:29 -07:00
Ian Romanick
2abf555496 meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't exist
This is a bit of a hack.  _mesa_meta_GenerateMipmap shouldn't even be
used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core
profile and ES2) because it uses fixed-function, and fixed-function
doesn't exist there either!

A GLSL-based _mesa_meta_GenerateMipmap should be available soon.  When
that is available, this patch will be irrelevant and should be reverted.

v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to
(ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review
comment from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-23 10:15:29 -07:00
Tapani Pälli
2ddfca9837 build/glsl: fix android build v2
Commit 77a3efc6b9 broke android build that
sets its own value for GLSL_SRCDIR before including Makefile.sources.
Patch moves overriding the value after include, this works as GLSL_SRCDIR
variable gets expanded only later.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-23 10:13:38 -07:00
Matt Turner
a6b8b709cd automake: convert es1api 2012-08-23 09:40:06 -07:00
Matt Turner
0f8110cb0c automake: convert es2api 2012-08-23 09:38:32 -07:00
Vadim Girlin
68d6441930 st/dri: pass config options to the state tracker
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
a6457c0692 st/mesa: accept and handle configuration options from st/dri
Currently there is a single option - force_glsl_extensions_warn.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
44f69fc825 st/dri: add force_glsl_extensions_warn option to dri options
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
e7c177ec9e st/dri: use driver name for driconf section lookup
The name is taken from the driver_descriptor, so it will be the same as
expected by driconf utility.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
6547733593 swrast: add DRM_DRIVER_DESCRIPTOR to store driver name 2012-08-23 19:57:50 +04:00
Paulo Alcantara
b41f36bde7 egl_dri2: Fix segmentation fault
The segmentation fault occurs when DRI2 is not loaded up and
dri2_setup_screen() function deferences dri2_dpy->dri2 (since it's NULL
at this point).

This patch fixes the segmentation fault by checking if dri2 pointer is
not NULL before deferencing it.

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-23 09:17:23 -06:00
Tom Stellard
90bd1d52bb radeon/llvm: Use the MCCodeEmitter for R600 2012-08-23 15:00:48 +00:00
Tom Stellard
235318a578 radeon/llvm: Use the MCCodeEmitter for SI 2012-08-23 15:00:48 +00:00
Tom Stellard
2de24024c1 radeon/llvm: Set 64BitPtr feature bit for SI 2012-08-23 15:00:48 +00:00
Tom Stellard
3f9b6aa0f4 radeon/llvm: Lower RETFLAG DAG Node to S_ENDPGM on SI 2012-08-23 15:00:48 +00:00
Tom Stellard
e30b4644b6 radeon/llvm: Add AsmPrinter 2012-08-23 15:00:48 +00:00
Tom Stellard
e61c54cb6b radeon/llvm: Mark JUMP as a pseudo instruction 2012-08-23 15:00:48 +00:00
Tom Stellard
ead72204f1 radeon/llvm: Remove the last uses of MachineOperand flags 2012-08-23 15:00:47 +00:00
Tom Stellard
67a47a445b radeon/llvm: Add flag operand to some instructions
This new operand replaces the MachineOperand flags in LLVM, which
will be deprecated soon.  Eventually all instructions should have a flag
operand, but for now this operand has only been added to instructions
that need it.
2012-08-23 15:00:47 +00:00
Tom Stellard
3a7a56e7aa radeon/llvm: Encapsulate setting of MachineOperand flags
MachineOperand flags will be removed soon, so it is convienent to
have only one function that modifies them.
2012-08-23 15:00:47 +00:00
Matt Turner
bee2edbf3d build: Link DRI drivers with dricore in case of no direct rendering
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
bfd7d6f58b build: Only build libmesagallium.la if building Gallium
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
f9786394e5 build: Clean glx Makefile.am
mapi/glapi is already built when make is run in src/glx.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
d9b109892d build: Put mapi/shared-glapi in CORE_DIRS
SRC_DIRS was overwritten (visible in the second hunk).

Also don't require mapi/shared-glapi to be built for GLES.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
8c9b78aad1 build: Only allow shared-glapi with DRI
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
32e8ce6d24 build: Set sensible DRI/X11/OSMesa defaults
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
53248e5f95 build: Print whether shared-glapi is enabled
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
625651cf81 build/x11: Force usage of C++ linker
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
9049b7f0fa build/x11: Don't link against shared-glapi
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
be5fe7b320 build: Remove deprecated --with-driver= flag
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Christian König
302c66ff81 radeonsi: rework vertex format handling
Preventing piglit's draw-vertices test from hanging the GPU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-22 15:33:54 +02:00
Christian König
07838603b9 radeonsi: fix SPI_PS_INPUT_ENA handling
We need to enable at least one interpolation mode,
otherwise the GPU will hang.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-22 15:33:49 +02:00
Vadim Girlin
8d1a9a984f r600g: fix lockups with dual_src_blend v2
Disable blending when dual_src_blend is enabled and number of color exports
in the current fragment shader is less than 2.

Fixes lockups with ext_framebuffer_multisample-
alpha-to-coverage-dual-src-blend piglit test.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-22 12:12:22 +04:00
Jakob Bornecrantz
c4610e9f92 st/dri: Add shared usage on buffers created
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-22 00:01:28 +02:00
Jakob Bornecrantz
61e95b8a5f gbm: Add shared usage on images created
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-22 00:01:28 +02:00
Anuj Phogat
df2c4cbced mesa: Fix generic compressed texture formats' handling in glTexImage/glCopyTexImage
The generic texture formats should be accepted by the <internalformat>
parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and
CopyTexImage2D functions. When the application specifies a generic
format, the driver is free to pick an uncompressed format.

This patch reverts the changes due to following commit:
commit a36581ccc0
mesa: do more teximage error checking for generic compressed formats

This patch fixes compressed texture format failures in intel oglconform
pxconv-gettex test case:
https://bugs.freedesktop.org/show_bug.cgi?id=47220

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-21 15:00:06 -07:00
Tom Stellard
1cb07bd3b8 radeon/llvm: ExpandSpecialInstrs - Add support for cube instructions 2012-08-21 15:42:44 +00:00
Tom Stellard
6c99f2101f radeon/llvm: ExpandSpecialInstrs - Add support for vector instructions 2012-08-21 15:42:44 +00:00
Tom Stellard
82a5d0c641 radeon/llvm: Add R600ExpandSpecialInstrs pass
This pass expends reduction instructions into a MachineInstrBundle that
contains 4 instruction, one for each instruction slot.
2012-08-21 15:42:44 +00:00
Tom Stellard
0588298575 radeon/llvm: Add helper function for getting sub reg indices 2012-08-21 15:42:44 +00:00
Michel Dänzer
1a25ebe3ce radeonsi: Handle NULL sampler views getting passed in by the state tracker.
Don't dereference NULL pointers, and if all views are NULL, don't generate an
invalid PM4 packet which locks up the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-08-21 15:42:25 +02:00
Ian Romanick
c1114c619a APIspec: Remove cruft about AMD_compressed_???_texture
Mesa doesn't support these extensions, and it seems unlikely that it
ever will

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
4c32ee5bca mesa/es: Remove redundant glFramebufferTexture3D textarget validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
7c9afe50fd mesa/es: Remove redundant glGetShaderiv pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
aaef441638 mesa/es: Remove redundant glCompressedTexImage border validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
d39cb8e9ef mesa/es: Remove redundant glPointSizePointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
d54004c352 mesa/es: Remove redundant glGetBufferPointer pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
68d7ce3e9e mesa/es: Remove redundant glGetVertexAttribPointer pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
5be5cf6934 mesa/es: Remove redundant element type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
b99a8caff1 mesa/es: Remove redundant glGetShaderPrecisionFormat shader type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
c914ac239e mesa/es: Remove redundant depth func validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
af276d9d4b mesa/es: Remove redundant stencil op fail/zfail/zpass validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
f3f993153c mesa/es: Remove redundant shade model mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
5a193557d1 mesa/es: Remove redundant light pname and light validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
0234410791 mesa/es: Remove redundant hint mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
a4251da3b2 mesa/es: Remove redundant separate stencil face validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
9113d0e686 mesa/es: Remove redundant stencil function validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
1087745afe mesa/es: Remove redundant logic op operand validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
bf03589882 mesa/es: Remove redundant alpha function validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
8f55d83569 mesa/es: Remove redundant separate stencil mask face validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
52d57985c6 mesa/es: Remove redundant front-face mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
e1dbf56a10 mesa/es: Remove redundant face culling mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
66404557db mesa/es: Remove redundant blend equation mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:31 -07:00
Ian Romanick
e39ea674d0 mesa/es: Remove redundant texture target validation
Mesa doesn't check the parameter passed to glMultiTexCoord*.  It does,
however, mask the texture value to prevent out-of-bounds writes.  This
patch will promote this non-conformant behavior to OpenGL ES 1.  I don't
think anyone will care, and the gets some silly code out of a hot path.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:05:11 -07:00
Ian Romanick
386e2f3289 mesa/es: Rearrange placement of GL_TEXTURE_MAX_ANISOTROPY_EXT in APIspec
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 09:52:45 -07:00
Ian Romanick
27e55805fb mesa/es: Remove redundant min/mag filter validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 09:52:27 -07:00
Mathias Fröhlich
926a4a922f radeon-llvm: Start multithreaded before using llvm.
This is required to make some of llvm's api calls
thread save. In particular the PassRegistry, which is
implicitly accessed while compiling shader programs.
The PassRegistry uses a mutex that is only active if
the llvm_is_multithreaded() returns true.
Calling llvm_start_multithreading() makes this happen
and by calling this function we try to make sure that
we can savely compile shaders in paralell.
Since there is also a call llvm_stop_multithreading()
in the llvm api, we cannot guarantee that this does
not get switched off while we are relying on this being
set, but for the easier use cases this fixes a race with
the radeon llvm compiler we have as of today.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-20 16:27:23 +00:00
archibald
59361d76a5 r600g: Move common compute/3D register init to its own function
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-20 15:35:09 +00:00
Christoph Bumiller
c51f8e2790 nv50/ir/tgsi: handle DP2 in tgsi Instruction srcMask
Solved by Tiziano Bacocco on IRC.
2012-08-18 17:38:56 +02:00
Christoph Bumiller
f3a7be740d nv50/ir/emit: don't forget saturation bit on f32 add immediate
Solved by Maxim Levitsky on IRC.
2012-08-18 17:38:45 +02:00
Tilman Sauerbeck
d0ace4e949 mesa: use #if over #ifdef in the FEATURE_ES1 check to fix a build failure.
mfeatures.h will define FEATURE_ES1 to 0 if it's not defined yet.

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

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-18 07:53:54 -06:00
Brian Paul
5b542681dc st/mesa: fix sampler view counting
In the past, when we called pipe::set_sampler_views(n) the drivers set
samplers [n..MAX] to NULL.  We no longer do that.  The state tracker
code was already trying to set unused sampler views to NULL to cover
that case, but the logic was broken and unnoticed until now.  This patch
fixes it.

Strictly speaking, this patch shouldn't be necessary.  Drivers should simply
ignore unused samplers and sampler views.  But some drivers like llvmpipe (and
others?) count those things and they figure into state validation.  That could
be fixed in the future.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53617

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-18 07:40:10 -06:00
Brian Paul
d65eb02537 util: update and fix u_upload_mgr.h comments 2012-08-18 07:39:52 -06:00
Brian Paul
84e5cb37d3 st/mesa: use Elements() instead of hard-coded number
And add a comment about the velems_util_draw[] array.
2012-08-18 07:39:52 -06:00
Brian Paul
1a9e4d5113 mesa: remove unused params, add const qualifiers
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-18 07:39:52 -06:00
Brian Paul
a6af24ee14 mesa: querying GL_TEXTURE_COMPRESSED_IMAGE_SIZE for a buffer obj is illegal
GL_INVALID_OPERATION is to be raised when querying a non-compressed
image/buffer.  Since a buffer object can't have a compressed format this
query always generates an error.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-18 07:39:51 -06:00
Ian Romanick
34472a0d87 mesa/es: Don't generate ES1 type conversion wrappers
These are gradually going to get whittled away and eventually folded into the
source files with the native type functions.

v2: Add (speculative) SConscript changes.  These may be broken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-17 18:12:20 -07:00
Eric Anholt
d707e337f5 i965: Fix bug in the old FS backend's projtex() calculation.
In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not
just texcoords.  Now that we have _mesa_vert_result_to_frag_attrib(), we can
fill in the other FS inputs with correct proj_attrib_mask info.

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-17 10:05:34 -07:00
Kenneth Graunke
3df13b32e5 mesa: Support GL_TEXTURE_BUFFER in GetTexLevelParameter[if]v in GL 3.1+.
The OpenGL 3.1 specification explicitly allows this.  Oddly, the
ARB_texture_buffer_object spec's issues section claims this isn't
allowed, but proceeds to explain that the extension simply doesn't edit
the underlying spec to allow it, and thus it didn't appear in the list
of legal texture targets.

Thus, this patch legalizes it only in 3.1+ contexts, but still returns
INVALID_ENUM in earlier contexts that expose ARB_texture_buffer_object.

Unfortunately, the behavior of the call is horrendously undefined.

Fixes oglconform's tbo/negative.textureParams test.

v2: Require desktop OpenGL.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
8c37fc1e92 mesa: Split out part of glGetTexLevelParameter into a helper function.
Move the _mesa_GetTexLevelParameter[iv] functions below the helper
function so the prototype is available.

This will be useful in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
58d11524da mesa: Add GL_TEXTURE_CUBE_MAP to _mesa_max_texture_levels(). [v2]
For cube maps, _mesa_generate_mipmap() calls this with
GL_TEXTURE_CUBE_MAP (the gl_texture_object's Target) rather than one
of the faces.  This caused _mesa_max_texture_levels() to return 0, which
resulted in maxLevels == -1 and the next line's assertion to fail.

This function is called from seven places:
- fbobject.c: framebuffer_texture()
- mipmap.c: _mesa_generate_mipmap()
- texgetimage.c:
  - getteximage_error_check()
  - getcompressedteximage_error_check()
- texparam.c: _mesa_GetTexLevelParameteriv()
- texstorage.c: tex_storage_error_check()

All of these (or their callers) now explicitly check for invalid targets
already, so this shouldn't cause invalid targets to slip through.
(Technically _mesa_generate_mipmap() doesn't check for invalid targets,
but the API-facing _mesa_GenerateMipmapEXT() function does.)

+2 oglconforms (float-texture/mipmap.automatic and mipmap.manual)

In addition to fixing the mipmap bug, it should also cause glTexStorage
to accept GL_TEXTURE_CUBE_MAP, which is explicitly allowed by the spec.

v2: Drop alterations to callers; this is now in a patch series that adds
    explicit checking to API functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
9e4fde85e4 mesa: Add explicit target checking to GetTexLevelParameter[if]v().
Previously, it relied on _mesa_max_texture_levels() for texture target
error checking.  This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels(), so
this patch should not introduce any change in behavior.  Future patches
will cause the two to diverge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
63396ce4c0 mesa: Add explicit target checking to Get[Compressed]TexImage().
Previously, they relied on _mesa_max_texture_levels() for texture target
error checking.  This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels() but
removed the proxy targets, as both functions explicitly rejected those
targets.  This changes the order in which we check errors, which could
change whether we return INVALID_VALUE or INVALID_ENUM.  However, it
shouldn't change the list of accepted targets.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Brian Paul
f69273f952 llvmpipe: remove polygon stipple assertion
It's possible for us to have an unused sampler bound when the fragment
shader itself doesn't use any samplers.  So the assertion isn't valid.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53616
2012-08-17 09:07:49 -06:00
Brian Paul
553a08d314 svga: minor code reformatting
To be consistent with other functions.
2012-08-16 17:03:43 -06:00
Matt Turner
81ba2c53b6 build: Remove -shared from OSMesa's LDFLAGS
Would break the static build.
2012-08-16 15:04:54 -07:00
Matt Turner
d12b07eb1a build: Remove EXTRA_LIB_PATH
You can add extra library paths to LDFLAGS directly.
2012-08-16 15:04:54 -07:00
Matt Turner
e273ed37ea build: Require X11 pkg-config files 2012-08-16 15:04:53 -07:00
Marek Olšák
f36c404f90 r600g: disable tiling for 422 formats again 2012-08-16 20:44:54 +02:00
Marek Olšák
795834432b r600g: fix blits of subsampled formats 2012-08-16 20:44:54 +02:00
Marek Olšák
6fd9218bb4 r600g: fix copying between NPOT mipmapped compressed textures
We aligned the dimensions to the blocksize, then divided by it
(in r600_blit.c), then minified, which was wrong.

The minification must be done first, not last.
This fixes piglit/fbo-generatemipmap-formats with S3TC and maybe
a bunch of other tests too. Tested on RV730.
2012-08-16 20:44:54 +02:00
Marek Olšák
b8e9cf5d96 r600g: make F2U trans-only on r600-r700
This fixes a failing assertion in r600_asm.c.
2012-08-16 20:44:53 +02:00
Marek Olšák
0d7e002815 r600g: set CB_COLOR_INFO to INVALID for disabled colorbuffers on r600-r700
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-16 20:44:53 +02:00
Marek Olšák
951ac46a6a r600g: rename r600_resource_texture to r600_texture 2012-08-16 20:44:53 +02:00
Marek Olšák
952c905767 r600g: always put tiled textures in VRAM 2012-08-16 20:44:53 +02:00
Marek Olšák
773ff5705f r600g: cleanup r600_resource_texture in favor of radeon_surface 2012-08-16 20:44:53 +02:00
Marek Olšák
362a25aac5 r600g: remove unused parameter in r600_texture_create_object 2012-08-16 20:44:53 +02:00
Marek Olšák
c4993d15eb r600g: fixup the usage flag for the flushed depth texture 2012-08-16 20:44:53 +02:00
Philipp Brüschweiler
0efd564a09 wayland-drm: close fd after the display is uninitialized
This fixes a "kernel rejected pushbuf: Bad file descriptor" error on
wl_drm display destruction.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-08-16 13:17:06 -04:00
José Fonseca
50dec63790 scons: Fix MinGW cross compilation.
Compensate for the recent changes and assumptions added to
Makefiles.sources
2012-08-16 17:21:52 +01:00
Tom Stellard
5f82d19248 radeon/llvm: Lower implicit parameters before ISel 2012-08-16 16:04:51 +00:00
Brian Paul
0d308ef8fe gallium/draw: move misplaced brace 2012-08-16 09:16:42 -06:00
Brian Paul
f6b7157550 mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image
This seems to be expected by the WebGL texture-mips test.  The error makes
sense, but I haven't found (yet) any OpenGL documentation specifying this
error condition.

See http://bugs.freedesktop.org/show_bug.cgi?id=44912

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-16 09:11:14 -06:00
Brian Paul
d663a557fd r600: update sampler, sampler_view code for the future
For when we have pipe->set_sampler_states(pipe, shader, start, num, samplers),
etc.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-16 09:01:31 -06:00
Brian Paul
10e552d056 rbug: update data structures, functions for future changes
To support geom/compute/etc shaders, samplers, sampler views, etc.
To support pipe->bind_sampler_states() w/ start_slot.
2012-08-16 09:01:31 -06:00
Brian Paul
109e87dc6a gallium/trace: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
d4ab8bd095 gallium/identity: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
f3cc4990a0 galahad: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
bd3733c0be svga: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
c969cb1447 llvmpipe: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
25a42f39e3 softpipe: add 'start' parameter to bind_sampler_states/views()
To support updating a sub-range of sampler states/views in the future.
Note that we always pass start=0 at this time.
2012-08-16 09:01:31 -06:00
Brian Paul
348ac08bfd gallium/trace: consolidate sampler, sampler_view code 2012-08-16 09:01:31 -06:00
Brian Paul
0ad95b923a gallium/identity: consolidate sampler, sampler_view code
This will simplify things when the pipe_context functions are consolidated.
2012-08-16 09:01:31 -06:00
Brian Paul
f3c3aff6ef st/mesa: add support for GS textures and samplers 2012-08-16 09:01:31 -06:00
Brian Paul
6c8a132158 st/mesa: combine vertex/fragment sampler state in arrays
As with other recent changes, put the vertex and fragment sampler state
into arrays indexed by the shader type.  This will let us easily add
support for other types of shaders in the future.
2012-08-16 09:01:31 -06:00
Brian Paul
cab2fed135 gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #define
PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS
were all defined to the same value (16).

In various places we're creating arrays such as
sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming
the same number of max samplers for all shader stages anyway.

Of course, drivers are still free to advertise different numbers of max
samplers for different shaders.
2012-08-16 09:01:31 -06:00
Brian Paul
a2c1df4c9a draw: index samplers and sampler_view state by shader type
So that we can handle GS state and other types of shaders in the future.
2012-08-16 09:01:31 -06:00
Brian Paul
bef196c792 draw: move tgsi-related state into a tgsi sub-struct
To better organize things a bit.
2012-08-16 09:01:31 -06:00
Brian Paul
df87fb5913 gallium: add a shader stage/type param to some draw functions
To prepare for geometry shader texture support in the draw module.
Note: we still only handle the vertex shader case.
2012-08-16 09:01:31 -06:00
Brian Paul
a8ed00d5f1 st/mesa: silence signed/unsigned comparison warning 2012-08-16 09:00:08 -06:00
Brian Paul
d733e5da9c svga: move result->key expression after result != NULL check 2012-08-16 08:58:55 -06:00
Brian Paul
50188adf7d svga: fix result==NULL logic in emit_fs_consts()
The previous test for result != NULL was kind of bogus since we dereferenced
the pointer earlier in the code.  Now, check for result != NULL first, then
get the result->key info.

Also, remove the useless "offset +=" code at the end.
2012-08-16 08:58:55 -06:00
Brian Paul
d55e0f1ba0 svga: update comment (s/SVGA_NEW_VS_RESULT/SVGA_NEW_VS_PRESCALE/) 2012-08-16 08:58:55 -06:00
Brian Paul
2a5eeeaebe svga: rename svga_hw_vs_parameters -> svga_hw_vs_constants
and similarly for svga_hw_fs_parameters
2012-08-16 08:58:55 -06:00
Niels Ole Salscheider
8cc1860d4a st/mesa: index can be negative in the PROGRAM_CONSTANT case
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-16 08:56:09 -06:00
Brian Paul
fd41cbc557 mesa: add cast to silence warning in _mesa_pack_rgba_span_from_ints() 2012-08-16 08:55:48 -06:00
Brian Paul
658044cde1 meta: remove unused variable 2012-08-16 08:53:55 -06:00
Michel Dänzer
1b11395a36 radeonsi: Fix symbol conflicts with r600g.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50389

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 12:01:16 +02:00
Michel Dänzer
51d9f37a72 radeonsi: Fix memory leaks if returning early from some state functions.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
4b64fa2ff1 radeonsi: Fix LLVM context leak.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
18abc270c5 gallium/radeon: Don't assign virtual address space for BO that already has one.
We'd end up re-using the old one and throwing away the new one anyway, but only
after a roundtrip to the kernel.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
a60be05284 gallium/radeon: Create hole for waste when allocating from va_offset.
Otherwise, the wasted area could never be used for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
1f455ef5bc gallium/radeon: Fix potential address space loss in radeon_bomgr_force_va().
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
6d59b7f6dc gallium/radeon: Delete uppermost virtual address space hole if it's at the top.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
f5fe81daea gallium/radeon: Fix losing holes when allocating virtual address space.
If a hole exactly matches the allocated size plus alignment, we would fail to
preserve the alignment as a hole. This would result in never being able to use
the alignment area for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
206d07625c gallium/radeon: Merge holes when freeing virtual address space.
Otherwise we'll likely end up with an ever increasing amount of ever smaller
holes.

Requires keeping the list ordered wrt offsets.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 09:39:36 +02:00
Michel Dänzer
c25968f3e2 gallium/radeon: Make va_offset 64 bits wide.
Otherwise we'd wrap around after 32 bits. The kernel currently limits GPU
virtual address space to 4GB anyway, but that will probably change sooner or
later, and this would result in confusing error messages when running out of
virtual address space even now.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 09:37:33 +02:00
Vinson Lee
1597176f70 llvmpipe: Silence Coverity incorrect sizeof expression defect.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-15 22:15:49 -07:00
Vinson Lee
3d6892c479 scons: Add option to enable floating-point textures.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-15 22:04:24 -07:00
Dave Airlie
6a3ac03f2b glx/dri2: add dri2 prime support.
This adds support for having libGL pick a different driver for prime support.

DRI_PRIME env var is set to the value retrieved from the server randr
provider calls, by the calling process. (generally DRI_PRIME=1 will be
the right answer).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-16 10:02:10 +10:00
Vincent Lejeune
565a4e2a86 radeon/llvm: Enable if-cvt
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
a614979286 radeon/llvm: Add callbacks needed by if-cvt
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
0eca5fd919 radeon/llvm: Lower branch/branch_cond into predicated jump
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
6db2e9fdb0 radeon/llvm: Add a predicated JUMP instruction
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
8263408a91 radeon/llvm: Support for predicate bit
Tom Stellard:
  - A few changes to predicate register defs

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
8f597d57e9 r600g: Glue to handle predicate aware output from llvm
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
72f7632c6b r600g: Fix instruction group merge when there are predicated insts.
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
56227f875b radeon/llvm: Do not use PV/PS if PRED_SEL does not match
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
da676eab93 r600g: Add support for predicates
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Christian König
cf76edd300 radeonsi: move ps sampler state into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
ec5b698525 radeonsi: move ps sampler views into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
54de6f452c radeonsi: move vertex state descriptors into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
f2c95d93db radeonsi: add shader data infrastructure
With this we can embed data for the shaders (like resource
descriptors) into the PM4 stream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
4444b9d1ec radeon/llvm: add support to fetch temps as vectors
Necessary for texture fetches with temp regs as source on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Tom Stellard
b6051bc785 radeon/llvm: Remove AMDGPUUtil.cpp 2012-08-15 18:35:26 +00:00
Apostolos Bartziokas
040c2e0456 radeon/llvm: Cleanup AMDGPUUtil.cpp 2012-08-15 18:35:25 +00:00
Tom Stellard
3aaa209293 radeon/llvm: Lower loads from USE_SGPR adddress space during DAG lowering 2012-08-15 18:35:25 +00:00
Tom Stellard
40c41fe890 radeon/llvm: Add live-in registers during DAG lowering
Psuedo instructions emulating live-in registers have been removed
and their corresponding intrinsics are now being lowered during DAG
lowering.
2012-08-15 18:35:25 +00:00
Tom Stellard
f3480f9234 radeon/llvm: Lower store_output intrinsic during DAG lowering 2012-08-15 18:35:25 +00:00
Tom Stellard
a76a0f7422 radeon/llvm: Force VTX_READ instructions to use same reg for src and dst
I was seeing some GPU hangs that seemed to be cause by ALU instructions
writing to the same register used as the source for VTX_READ.  Adding
this constraint to the VTX_READ instructions avoids this situation.
2012-08-15 18:35:25 +00:00
Marek Olšák
97b4b97b2f radeonsi: fix build breakage after u_blitter changes 2012-08-15 20:03:37 +02:00
Marek Olšák
e0cc61bd91 gallium/u_blitter: document custom meta helpers 2012-08-15 19:20:58 +02:00
Marek Olšák
b3b5bb9ddb r600g: disable handling of DISCARD_RANGE
https://bugs.freedesktop.org/show_bug.cgi?id=53130
2012-08-15 19:20:58 +02:00
Marek Olšák
44f14ebd7b r600g: implement timestamp query and get_timestamp hook
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 19:20:58 +02:00
Marek Olšák
1932bc8aae r600g: enable MSAA on evergreen by default
v2: add the DRM version check
2012-08-15 19:20:58 +02:00
Marek Olšák
870af19d70 r600g: implement copying between MSAA textures 2012-08-15 19:20:58 +02:00
Marek Olšák
0f86915c53 r600g: implement MSAA color resolve 2012-08-15 19:20:58 +02:00
Marek Olšák
94b634eca0 r600g: implement MSAA depth-stencil decompression and resolve
and integer textures, which are resolved the same as depth, I think.
2012-08-15 19:20:58 +02:00
Marek Olšák
6d3ad2dd2b r600g: implement TXQ_LZ opcode 2012-08-15 19:20:57 +02:00
Marek Olšák
4b78df9c81 r600g: implement MSAA rendering and texturing for evergreen and cayman 2012-08-15 19:20:57 +02:00
Marek Olšák
a01791add0 r600g: implement set_sample_mask 2012-08-15 19:20:57 +02:00
Marek Olšák
6517225078 r600g: implement alpha-to-coverage 2012-08-15 19:20:57 +02:00
Marek Olšák
26cb887ea2 r600g: implement alpha-to-one 2012-08-15 19:20:57 +02:00
Marek Olšák
4f21595276 r600g: remove support for 3-channel colorbuffers
We have no sampler support for them.
2012-08-15 19:20:57 +02:00
Marek Olšák
2f14202f52 configure.ac: bump libdrm_radeon requirement to 2.6.38 2012-08-15 19:20:57 +02:00
Marek Olšák
a7f4d3b740 winsys/radeon: print error if CS is overflowed
and don't submit the CS to the kernel.
2012-08-15 19:20:57 +02:00
Marek Olšák
dc5e61d884 gallium/u_blitter: implement X and Y texture flipping 2012-08-15 19:20:57 +02:00
Marek Olšák
825b45366d gallium/u_blitter: implement blitting multisample resources
It can blit only one sample at a time (it should be called in a loop).
2012-08-15 19:20:57 +02:00
Marek Olšák
dacf5dc9ac gallium: add TGSI support for multisample textures
The only allowed instructions are TXQ_LZ and TXF.

TXQ_LZ is like TXQ, but without the LOD parameter (which is always zero
with MSAA textures)

The 3rd or the 4th texcoord component in TXF should contain the sample index
for a 2D_MSAA or 2D_ARRAY_MSAA texture, respectively.
2012-08-15 19:20:57 +02:00
Marek Olšák
ba53573a8b gallium/tgsi: fix TGSI text parser
The problem was that the string matching succeeded e.g. for "2D" when there
was actually "2D_MSAA" and then failed parsing "_MSAA".

To prevent similar failures in the future, let's fix this kind of error
everywhere.
2012-08-15 19:20:57 +02:00
Marek Olšák
b7c4ee21c5 gallium/u_blit: set dst format from pipe_resource, not pipe_surface
We use it to decide whether we can use resource_copy_region.

NOTE: This is a candidate for the 8.0 branch.
2012-08-15 19:20:57 +02:00
Marek Olšák
1a17c42344 gallium: make pipe_box signed in order to represent flipped blits
This will be used by u_blitter.
2012-08-15 19:20:57 +02:00
Marek Olšák
03b78ceb50 st/mesa: don't clamp fragment color with integer colorbuffer 2012-08-15 19:20:57 +02:00
Marek Olšák
e06d6168cb mesa: flush vertices in test_framebuffer_completeness 2012-08-15 19:20:57 +02:00
Michel Dänzer
538085c5d4 st/egl: Fix up for ClientVersion -> ClientMajorVersion rename.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53513

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-15 10:49:39 +02:00
Jordan Justen
b3900ed5ad i965: add ARB_texture_rgb10_a2ui support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
091eb15b69 meta: allow CopyTexSubImage on integer formats
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
6671d0dad3 mesa ReadPixels: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
f7333b6345 mesa pack: handle packed integer formats with clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
1a814217c3 mesa unpack: call _mesa_problem when unpack function is not available
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
b3dd048cbb mesa texstore: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
7208505d30 mesa GetTexImage: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
7ef270867c mesa pack: handle uint and int clamping properly
Rename _mesa_pack_rgba_span_int to _mesa_pack_rgba_span_from_uints.
Add _mesa_pack_rgba_span_from_ints.

These separate routines allow the integer clamping to be handled
properly for signed versus unsigned integers.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Chad Versace
1938501fbf intel: Fix rendering to a multisample front buffer
We need to downsample before flushing BUFFER_FAKE_FRONT_LEFT to
BUFFER_FRONT_LEFT in intel_flush_front.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Chad Versace
a43599d1d1 intel: Clean up intel_flush_front
Stop repeating ourselves. Replace the 4 instances of
`driContext->driDrawablePriv` with `driDrawable`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Chad Versace
38b748ce29 intel: Refactor intel_downsample_for_dri2_flush
Move it from intel_screen.c to intel_context.c. Redeclare as non-static.
A future commit will use it in multiple files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Ian Romanick
cde2b7e55d docs: Add EGL extensions to release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-14 15:45:17 -07:00
Ian Romanick
dbecb41300 egl: Allow OpenGL ES 3.0 as a version
In the DRI2 back-end this will get the same API as GLES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
a2ce2eba26 dri2: Note that __DRI_API_GLES2 is also used for OpenGL ES 3.0
Unlike 1.x to 2.0, OpenGL ES 3.0 is backwards compatible with 2.0.  Use the
same API flag for both.  Applications that specifically want 3.0 will specify
this using the major / minor version attributes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
7b4b4f8e68 egl_dri2: Add support for EGL_KHR_create_context and EGL_EXT_create_context_robustness
Just like in GLX, EGL_KHR_create_context requires DRI2 version >= 3, and
EGL_EXT_create_context_robustness requires both DRI2 version >= 3 and the
__DRI2_ROBUSTNESS extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
f171571bfc egl: Implement front-end support for EGL_EXT_create_context_robustness
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
63beb3df98 egl: Implement front-end support for EGL_KHR_create_context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
9d76ad2fac egl_dri2: Silence warnings about missing initializers
egl_dri2.c: At top level:
egl_dri2.c:325:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:325:4: warning: (near initialization for 'swrast_driver_extensions[2].version') [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: (near initialization for 'swrast_core_extensions[1].version') [-Wmissing-field-initializers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
3fd79dd988 egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersion
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
ce55741cbc egl_dri2: Use createContextAttribs if DRI2 version >= 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
38f91f2b08 egl_dri2: Require DRI2 version 2
The extra block in dri2_create_context is to prevent extra white space noise
in the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
0c445bb618 dri_util: Compare against the correct API enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
258771882d mesa: Enable GL_ARB_invalidate_subdata
v2: Add GL_ARB_invalidate_subdata to release notes at Brian's
suggestion.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 14:39:33 -07:00
Ian Romanick
07e12c4917 mesa: Add skeleton implementations of glInvalidateTex{Sub,}Image
These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Add comment explaining why minimum dimensions are set to 1 for some
texture targets.  Add default case to switch statement to silence
compiler warnings and detect new texture targets.  Both changes
suggested by Brian.  Also use _mesa_is_desktop_gl as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
f241ffd48c mesa: Add skeleton implementations of glInvalidateBuffer{Sub,}Data
These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Use _mesa_bufferobj_mapped instead of testing
gl_buffer_object::Pointer as suggested by Brian.  Also use
_mesa_is_desktop_gl as suggested by Ken.

v3: Add a comment by the map subrange / discard range overlap test and
fix an off-by-one error noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
e2370bcc1d mesa/es: Pass context to _mesa_init_bufferobj_dispatch
With this change _mesa_init_bufferobj_dispatch won't set function
pointers that don't exist in OpenGL ES.

v2: Use _mesa_is_desktop_gl and _mesa_is_gles3 as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
342be8aa88 mesa: Add skeleton implementations of glInvalidate{Sub,}Framebuffer
These are part of GL_ARB_invalidate_subdata and OpenGL ES 3.0.

v2: Reject aux buffers in core context, and use _mesa_is_desktop_gl and
_mesa_is_gles3.  Both suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
12249b9c96 glapi: Add GL_ARB_invalidate_subdata
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 14:39:33 -07:00
Ian Romanick
2a1ca4ff73 mesa/es3: Add _mesa_is_gles3 predicate
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:29 -07:00
Ian Romanick
9bcb9fad65 intel: Implement ARB_texture_storage
This is basically cut-and-paste from the swrast implementation, and it
could probably be (slightly) more optimal.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:19 -07:00
Ian Romanick
92b614172f mesa: update glext.h to version 83
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 12:19:24 -07:00
Matt Turner
79e9e1b32f build: Use MKDIR_P in src/mesa/Makefile.am
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
02f52e8df5 build: Use AM_V_GEN in src/mesa/Makefile.am
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
1b200d9001 build: Fix autogen.sh to allow out-of-tree builds
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
85d355f122 build: Fix out-of-tree generation of builtin_function.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
2191a79b4e build: Fix gtest out-of-tree build
Introduced by 3d000e7dd.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
e939250b63 build: Fix out-of-tree generation of api_exec_es{1,2}.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
5c2a6b74ed build/sources.mak: Add src/glsl/glcpp to INCLUDE_DIRS
Fixes problem where libdricore's of-out-tree build couldn't find
glcpp.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:38 -07:00
Matt Turner
fa74175210 build/sources.mak: Remove unused GLSL_LIBS
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:38 -07:00
Ian Romanick
707f067915 mesa: Kill GL_ARB_shadow_ambient with fire
No driver supports this extension, and it seems unlikely than any driver
ever will.  I think r300c may have supported it at one time, but that
driver has already been removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-14 10:40:04 -07:00
Tom Stellard
b49771970b radeon/llvm: Inline immediate offset when lowering implicit parameters 2012-08-14 14:06:20 +00:00
Tom Stellard
2fae8227ad radeon/llvm: Use correct opcocde for BREAK_LOGICALNZ_i32 2012-08-14 13:26:30 +00:00
José Fonseca
ea8dcfc90d scons: Populate top_srcdir and top_builddir variables when reading Makefiles.sources.
This is not entirely correct, as scons doesn't put binaries in a
"src" subdirectory, but doesn't seem to be a problem for now.
2012-08-14 12:19:56 +01:00
Kenneth Graunke
605f964d5c mesa: Use GLdouble for depthMax in final unpack conversions.
The final step of _mesa_unpack_depth_span is to take the temporary
GLfloat depth values and convert them to the desired format.  When
converting to GL_UNSIGNED_INTEGER with depthMax > 0xffffff, we use
double-precision math to avoid overflow and precision problems.

Or at least that's the idea.  Unfortunately

   GLdouble z = depthValues[i] * (GLfloat) depthMax;

actually causes single-precision multiplication, since both operands are
GLfloats.  Casting depthMax to GLdouble causes the scaling to be done
with double-precision math.

Fixes a regression in oglconform's depth-stencil basic.read.ds test
since c60ac7b179, where the expected and
actual values differed slightly.  For example, 0xcfa7a6 vs. 0xcfa7a4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49772
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 19:16:38 -07:00
Eric Anholt
43e3a7533d i965: Fix the scaling of seconds to ms in perf debug.
*headdesk*
2012-08-13 17:50:25 -07:00
Ian Romanick
d606926013 i965: Validate API and version in brwCreateContext
v2: Use base-10 for versions like gl_context::Version.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:38:55 -07:00
Ian Romanick
db273724c9 i915: Validate API and version in i915CreateContext
v2: Use base-10 for versions like gl_context::Version.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:36:50 -07:00
Ian Romanick
a81e4b3e92 i830: Validate API and version before calling i830CreateContext
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-13 17:23:48 -07:00
Ian Romanick
2b63624326 intel: In the i915 driver, the chipset cannot be i965
In the i965 dirver, the chipset must be i965.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-13 17:23:24 -07:00
Ian Romanick
70f47505a2 dri: Pass API_OPENGL_CORE through to the drivers
This forces the drivers to do at least some validation of context API
and version before creating the context.  In r100 and r200 drivers, this
means that they don't do any post-hoc validation.

v2: Actually reject compatibility profile 3.2+ contexts.  Thanks Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:17:12 -07:00
Ian Romanick
7e81f553bc mesa: Filter a bunch more functions based on API
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:17:00 -07:00
Ian Romanick
0fef911ce4 mesa: Don't advertise extensions that are part of GL 1.5 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
aa0b1e902b mesa: Don't advertise extensions that are part of GL 1.4 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
213945385a mesa: Don't advertise extensions that are part of GL 1.3 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
7ef1869d69 mesa: Don't advertise extensions that are part of GL 1.2 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
4d39b86315 mesa: Don't advertise deprecated extensions in a core context
It may be possible to trim the list of extensions futher.  These are
just the obvious extensions that add functionality that the core context
explicitly forbids.  Apple's core-context extension list is *just* the
extensions on top of the core GL version.  I'm not sure we want to go
that far, but removing some things that have been in core since 2.1 may
be okay.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Christopher James Halse Rogers
cd4a61100d build: Fix libdricore out-of-tree builds (v2)
v2: Add both top_srcdir and top_builddir to mesa asm include dirs.
    These require both in-tree and build-time-generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:54 -07:00
Christopher James Halse Rogers
73fef0178a build/mapi: More killing of TOP in favour of top_srcdir
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:47 -07:00
Christopher James Halse Rogers
77a3efc6b9 build/glsl: fix location of generated files.
Like in src/mesa, use GLSL_BUILDDIR/GLSL_SRCDIR to unambiguously
distinguish between in-tree and generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:39 -07:00
Christopher James Halse Rogers
37a1b8083e build/glapi: fix includes for generated files
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:31 -07:00
Christopher James Halse Rogers
3fe69bac49 build: fix out of tree generation of glapi_mapi_tmp.h
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:25 -07:00
Christopher James Halse Rogers
726f534bbb build/glx: fix include paths for out-of-tree builds
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:17 -07:00
Christopher James Halse Rogers
b2ecaab7ad build: fix location of generated files in src/mesa (v4)
Also fix include paths for the generated headers.

v2: Switch to using self-explanatory BUILDDIR/SRCDIR defined from
    top_builddir/top_srcdir rather than the ambiguous TOP.
v3: Add both top_builddir and top_srcdir to include flags for mesa asm.
    These rely on both in-tree and build-time-generated includes.
v4: Rebased on top of 948c8f502a.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-08-13 12:24:04 -07:00
Kenneth Graunke
4e087de51a intel: Reserve enough space to finish occlusion queries on Gen6.
After realizing that brw_finish_batch emitted some final PIPE_CONTROLs
to record occlusion queries, Chris noted that we probably hadn't
reserved enough space to actually emit them.

Reserving a full 60 bytes seems a bit harsh, since we only need that
much if occlusion queries are actually active.  Plus, 28 bytes would be
sufficient for Gen7, and 24 for Gen4-5.

We could optimize this in the future, but it doesn't seem too critical.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12 20:12:28 -07:00
Kenneth Graunke
9da50667f4 intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.
On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits
some extra PIPE_CONTROLs to capture the current occlusion query data.
Unfortunately, it was being called *after* _intel_batchbuffer_flush
added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get
inside the batch.

Not only does this likely cause bogus occlusion query values, it can
also cause crashes: with the recent change to use 64-bit depth count
writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which
happened after the MI_NOOP padding.  This resulted in an odd-length
batch buffer, which resulted in execbuf2 returning -EINVAL and the
application dying with an intel_do_flush_locked failure.

On older generations, finish_batch() doesn't emit any state, so this
change shouldn't have any effect.

Huge thanks to Chris Wilson for helping me figure this out.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12 20:12:13 -07:00
Eric Anholt
006c1a3c65 i965: Add perf debug for stalls during shader compiles.
v2: fix bad comment from before I gave up and decided to just use doubles.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
97a5f0ff2e i965: Add performance debug for when the state cache gets nuked.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
fc3b7c9b56 i965: Add performance debug for shader recompiles.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
b4da272a6e i965: Add performance debug for fast clear fallbacks.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
0e723b135b intel: Add performance debug for some common GPU stalls.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
4cfb9e3000 i965: Add performance debug for register spilling.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
d72ff03e69 i965: Add INTEL_DEBUG=perf for failure to compile 16-wide shaders.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
79198063b8 intel: Rename INTEL_DEBUG=fall to INTEL_DEBUG=perf.
I want to introduce some more debug output for performance surprises that
includes fallbacks, but aren't necessarily software rasterization.  Leave
INTEL_DEBUG=fall in place for those that have used that flag before.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:24 -07:00
Pauli Nieminen
bf6c1b7470 meta: texture rectangle textures may not have mipmaps
Avoid INVALID_OPERATION error if decompressing rectangle texture.
Setting mipmap level limits for those textures is error that must not be
hit by meta code to mislead user.

[v3/Kayden]: Resolve conflicts due to Eric picking a subset of Pauli's
original changes.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:46 -07:00
Pauli Nieminen
b9daa83463 meta: Use sampler object for mipmap generation
Sampler objects are perfect for meta operations.Sampler object
is separate state object that shadows the sampling state in texture
object. With sampler object mipmap can maintain same sampling state for
all subsequent generation requests.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:43 -07:00
Pauli Nieminen
ac4dc5e931 mesa/samplerobj: Avoid crash in sampler query if texture unit is disabled
Sampler queries are so far made only for enabled texture unit. But if
any code would query sampler before checking texture unit state that
would result to NULL deference.

Making the inline helper easier to use with NULL check makes a lot sense
because compiler is likely to combine the checks for the current texture.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:41 -07:00
Pauli Nieminen
5606bd574e mesa: Remove unnecessary parameters CompressedTexImage
In tune with previous patches. Again there is duplication of information
in function parameters that is good to remove.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:30 -07:00
Pauli Nieminen
c9a7dfcf92 mesa: Remove unnecessary parameters from AllocTextureImageBuffer
Size and format information is always stored in gl_texture_image
structure. That makes it preferable to remove duplicate information from
parameters to make interface easier to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:28 -07:00
Pauli Nieminen
c5af889180 mesa: Remove unnecessary parameters from TexImage
gl_texture_image structure always holds size and internal format before
TexImage driver hook is called. Those passing same information in
function parameters only duplicates information making the interface
harder to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:13 -07:00
Tom Stellard
e98ace934e configure: Check xcb version when X11 pkgconfig exists
Commit 6882381a2e added a dependency on a
newer version of xcb, but the version check wasn't added in all the
necessary places.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:42:43 -07:00
Chí-Thanh Christopher Nguyễn
4c73282d2b gbm: Fix build without gallium_drm_loader
pipe_loader_drm_probe_fd only exists if HAVE_PIPE_LOADER_DRM is defined.
Patch improved as suggested by Vadim A. Misbakh-Soloviov.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52962
2012-08-12 14:38:32 -07:00
Christian König
9f5ff5981c radeonsi: move drawing into new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
583c212115 radeonsi: move sync handling into new state handler
So we can remove all the old atom handling.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
303f4b7dcd radeonsi: separate and disable streamout for now
I have my doubts that this code still works on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
696b6cf466 radeonsi: remove ps_partial_flush
Not needed any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
7acb194a7b radeonsi: remove r6xx_flush_and_inv atom
It is not used any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
708337e62e radeonsi: move init state to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
862df0885a radeonsi: add support for PKT3 cmds to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
ce40e4726c radeonsi: cleanup shader headers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Chad Versace
996ff1c9bf Revert "mesa: Remove C++11 narrowing warnings"
This reverts commit 9f5a5d541d.

Fixes the following build error on GCC 4.2.3:
  cc1plus: error: unrecognized command line option "-Wno-narrowing"
The GCC Manual incorrectly stated that commit 9f5a5d54 woulde be safe for
old versions of GCC.

Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-10 14:05:14 -07:00
Brian Paul
16c702ef3b softpipe: fix softpipe_delete_fs_state() failed assertion
The var!=softpipe->fs_variant assertion was failing because we weren't
nulling the softpipe->fs_variant pointer when binding a new shader.
Since softpipe->fs_variant depends on the current fs, it's of no use
when a new FS is bound.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53318

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-10 13:27:04 -06:00
Brian Paul
3487b93cc4 cso: rearrange some structure fields for consistency 2012-08-10 12:14:17 -06:00
Brian Paul
cf77c29e60 st/mesa: fix renderbuffer validation bug
After we attach a new renderbuffer in this function we need to make
sure Mesa's update_framebuffer() gets called.

Fixes crash in WebGL conformance/textures/texture-attachment-formats.html,
but the test still fails for other reasons.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53316

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-10 11:49:36 -06:00
Chad Versace
9f5a5d541d mesa: Remove C++11 narrowing warnings
Add -Wno-narrowing to CXXFLAGS for gcc.

It is safe to add this flag even for versions of gcc that don't recognize
it.  From the GCC Manual [1]: "[GCC] allows the use of new -Wno- options
with old compilers".

This removes warnings of the form
    warning: narrowing conversion of X from 'int' to 'float' inside { } is
    ill-formed in C++11 [-Wnarrowing]
in ff_fragment_shader.cpp and gen6_blorp.cpp of the form.  When building
i965, I observed no other difference in the build output.

[1] http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-10 09:59:41 -07:00
Brian Paul
f7af4beae5 gallivm: fix crash in lp_sampler_static_state()
Fixes WebGL conformance/uniforms/uniform-default-values.html crash.

We need to check for the null view pointer before accessing view->texture.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53317

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-08-10 09:45:25 -06:00
Brian Paul
9b04abe368 st/mesa: fix glCopyTexSubImage crash
Fixes a WebGL crash.  The dest texture image is at level 2 and is of
size 1x1 texel.  The st texture image is a stand-alone resource, not
a pointer into a complete mipmap.  So the resource has one level and
trying to write to level 2 blows up.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53314
and http://bugs.freedesktop.org/show_bug.cgi?id=53319

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-08-10 09:45:17 -06:00
Chad Versace
6cb9e99a75 intel: Always downsample in intel_miptree_map_multisample
Always downsample before mapping, even if the map mode contains
GL_MAP_INVALIDATE_RANGE_BIT. If we neglect to downsample when only
a subrect is mapped then the upsample in intel_miptree_unmap_multisample
may write garbage to the region outside the subrect.

(Eric gave my patch e88cfbb a conditional reviewed-by with the condition
that it always downsample before mapping. I forgot to make that change
before pushing the patch.)

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-09 15:21:02 -07:00
Eric Anholt
04a11b5f5e i965/gen6+: Add support for edge flags.
Fixes the 3 new piglit edgeflag tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40707
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:50 -07:00
Eric Anholt
b3367f56d8 i965/vs: Convert EdgeFlagPointer values appropriately for the VS on gen4.
Fixes piglit gl-2.0/edgeflag.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Eric Anholt
3eb8d71225 i965/vs: Add comment noting copy_edgeflag state dependency.
It's already in the state struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Eric Anholt
e119f98472 i965/vs: Add support for copying user edge flags.
Fixes the glsl skinning demo regression since changing to the new GLSL
compiler, and is part of fixing piglit gl-2.0-edgeflag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50079
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Olivier Galibert
7426d9d769 i965/fs: Fix the FS inputs setup when some SF outputs aren't used in the FS.
If there was an edge flag or a two-side-color pair present, we'd end up
mismatched and read values from earlier in the VUE for later FS inputs.

v2: Fix regression in gles2conform shaders generating point size. (change by
    anholt)

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 branch.
2012-08-09 09:07:49 -07:00
Vinson Lee
3466538171 st/mesa: Initialize tgsi_texture_offset Padding field.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 22:36:27 -07:00
Kenneth Graunke
68bccc40f5 glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.
If the application has requested reset notification, then
dri2_convert_glx_attribs will initialize this to the correct value.

Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but
doesn't when num_attribs == 0.  (The consensus seems to be that we
should make it do so, but that's more invasive, so I'm pushing this for
now.)

Fixes a regression since a8724d85f8
where trying to run OilRush_x86 or apitrace heaven_x64 would result in:

dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get
here."' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-08 17:15:21 -07:00
Tapani Pälli
94f22fbe78 intel: use _mesa_meta_Clear with OpenGL ES 1.1 v2
Patch changes i915 and i965 drivers to use fixed function version of
meta clear when running on ES 1.1. This fixes rendering errors seen with
Google Maps, Angry Birds and Gallery3D on Android platform.

Change 88128516d4 exposes all extensions
internally to be available independent of GL flavour, therefore check
against ARB_fragment_shader does not work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50333
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 17:15:21 -07:00
Kenneth Graunke
5deb1d1a1f i965: Rework the extra flushes surrounding occlusion queries.
This removes the CS stall on Ivybridge.

On Sandybridge, the depth stall needs to be preceded by a non-zero
post-sync op, which requires a CS stall, which needs a stall at
scoreboard.  Emit the full workaround.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 17:15:21 -07:00
Eric Anholt
b0adbda75a i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.
I don't know if it was possible to trigger this bug -- we don't merge
saturates into the math instruction because we're bad at coalescing currently,
and there's nothing generating these with predicates.  Still, let's avoid
future bugs when we do smarter codegen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:31 -07:00
Eric Anholt
9b4053cabd i965: Drop the confusing saturate argument to math instruction setup.
This was ridiculous.  We were ignoring the inst->header.saturate flag in the
case of math and only math.  On gen4, we would leave inst->header.saturate in
place if it happened to be set, which would end up being applied to the
implicit mov and thus trash the first argument.  On gen6, we would overwrite
inst->header.saturate with the saturate flag from the argument, which was not
set appropriately in brw_vec4_emit.cpp, and was only not a bug due to our
incompetence at coalescing saturate moves.

By ripping the argument out and making saturate work just like all the other
brw_eu_emit.c code generation, we can avoid both these classes of bugs.

Fixes piglit fog-modes, and the new specific fs-saturate-exp2 case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48628
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:30 -07:00
Eric Anholt
33dfdc735e i965: Make brw_set_saturate() use stdbool.
There was a chance for brw_wm_emit.c to screw up and pass (1 << 4) instead of
1, which would get converted to 0 when stored.  Instead, use stdbool which
converts nonzero to true/1 like we want.
2012-08-08 16:21:30 -07:00
Eric Anholt
1b148e660e mesa: In conditional rendering fallback, check the query status.
Otherwise, conditional rendering always takes the fallthrough "render it
anyway" case unless the application had itself done a check or wait on the
query.

Fixes intel oglconform's conditional_render advanced.nofbo.readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Eric Anholt
4bbd120368 mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.
I happened to notice this while looking at a blit pass in l4d2, which had an
optional push/pop around framebuffer srgb setting.  It didn't matter in the
end, but the fix is sitting in my tree now.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Ian Romanick
9f7b3d1713 Make shared-glapi the default
You can't practically have desktop OpenGL and OpenGL ES on the same system
without this.  The benefits of not having it (e.g., a more compact dispatch
table) are irrelevant.

v2: Don't mark shared-glapi as experimental.  Review suggestion by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
5602f0f955 mesa/tests: Fix trivial typos in src/mapi/glapi tests
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
45d3d0ad21 mesa/tests: Add tests for the generated shared-glapi dispatch table
These are largely based on the src/mapi/glapi/tests.  However,
shared-glapi provides less external visibility into the dispatch table,
so there is less to test.  Also, shared-glapi does not implement
_glapi_get_proc_name, so that test was removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
d9f899bb93 glapi: Prevent accidental use of lies w/shared-glapi
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
99fee476a1 glx: Don't use glapitable.h at all
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  Avoiding the use of glapitable.h avoids the lies.  The only
entries used in this code are entries that are ABI.  For these, the ABI
offset can be used directly.

Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to
get the pretty names for these offsets.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
f5dffb7e36 glx: Don't rely on struct _glapi_table
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  There are two completely separate code generation paths used to
assign dispatch offset.  Neither has any clue about the other.
Unsurprisingly, the can't agree on what offsets to assign.

This adds a bunch of overhead to __glXNewIndirectAPI, but this function
is called at most once.

The test ExtensionNopDispatch was removed.  There was just no way to
make this test work with the information provided in shared-glapi.
Since indirect_glx.c uses _glapi_get_proc_offset now, it was also
impossible to make the tests work without shared-glapi.  So much pain.

This fixes indirect rendering with shared-glapi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
52d6df8aa7 mesa/tests: Don't build glapi tests with shared-glapi
This fixes 'make check' on with --enable-shared-glapi.  This test cannot work
in that environment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:25 -07:00
Kenneth Graunke
e45a9ce474 i965: Use 64-bit writes for occlusion queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:23 -07:00
Kenneth Graunke
20c09b82d0 i965: Refactor depth count write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:21 -07:00
Kenneth Graunke
a2cdd5ada8 i965: Emit a CS stall before timestamp writes.
This implements one of the Sandybridge PIPE_CONTROL workarounds.  It
doesn't appear to be required for Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:19 -07:00
Kenneth Graunke
c4c78c275a i965: Use 64-bit writes for timestamp queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:16 -07:00
Kenneth Graunke
03f14664b6 i965: Refactor timestamp write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:14 -07:00
Kenneth Graunke
61d0b9f52c intel: Make the length for PIPE_CONTROL explicit.
PIPE_CONTROL has variable length, depending upon generation and whether
we want to do 32-bit or 64-bit data writes.  Make it explicit, rather
than hiding a length of 4 in the #define for _3DSTATE_PIPE_CONTROL.

Generated by s/3DSTATE_PIPE_CONTROL/3DSTATE_PIPE_CONTROL | (4 - 2)/g.
This is equivalent since the #define used to have | 2 in it.  A grep
through the sources shows that all instances have been converted, so
it's safe to remove the | 2 from the #define.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:23:57 -07:00
Brian Paul
ecac178aa2 swrast: add missing switch case for API_OPENGL_CORE
To silence compiler warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
b4d6502fcd gallivm: remove unused src_elem_type variable
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
f21669e9a2 svga: remove unused svga_shader::use_sm30 field, add comments
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
16a289195e svga: remove unused svga_winsys_handle type
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Michel Dänzer
82cd9c0fc2 radeonsi: If pixel shader compilation fails, use a dummy shader.
Otherwise we're likely to hang the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 15:33:38 +02:00
Christian König
be42a45e02 radeonsi: fix memory leak and/or segfaults
Fix a stupid typo that could lead to memory
leaks and/or segfaults.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:36:49 +02:00
Christian König
8c44e5a144 radeon/winsys: fix winsys VM handling
Move releasing the VM area after closing the bo handle.

This partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45018

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:35:10 +02:00
Vinson Lee
7528e2104f translate: Fix typo in is_legal_int_format_combo.
Fixes same on both sides defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-07 22:34:28 -07:00
Marek Olšák
1ea263fccb r600g: remove unused parameters in texture functions 2012-08-07 23:39:52 +02:00
Eric Anholt
4a078516b6 i965: Enable uniform buffer objects on gen6+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt
04871058eb i965/vs: Add support for loading uniform buffer variables as pull constants.
Unlike the FS side in the previous commit, this does variable indexing just
fine, using the same code as we used for other variable-indexed pull
constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt
90de96ff0d i965/fs: Add support for loading uniform buffer variables as pull constants.
Variable array indexing isn't finished, because the lowering pass
turns it all into conditional moves of constant index accesses so I
can't test it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
bb020d09c3 i965/vs: Add a surface index to VS_OPCODE_PULL_CONSTANT instructions.
Similar to the previous commit for the fragment shader, now we have a buffer
index and an offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
454dc83f66 i965/fs: Communicate the pull constant block read parameters through fs_regs.
I wanted to add the surface index as a variable value for UBO support,
and a reg seemed like the obvious way to go.  This exposes more of the
information to CSE, which we'll probably want to apply to pull
constant loads for UBOs eventually (you might access 4 floats in a
row, each of which would produce an oword block read of the same
block).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
25d2bf3845 i965: Bind UBOs as surfaces like we do for pull constants.
v2: Comment fix, drop extraneous parens (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
5bffbd7ba2 i965: Add an offset argument to constant buffer setup.
We'll use this for UBO surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
5fc5b29a54 mesa: Add support for glUniformBlockBinding() in display lists.
Fixes piglit GL_ARB_uniform_buffer_object/dlist.

v2: Use the .ui fields instead of .i for type consistency (review by Brian
    Paul)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
bfa046b5f2 mesa: Unbind uniform buffer bindings on glDeleteBuffers().
Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
1eb3c06ae8 mesa: Default to GL 3.1's limits on uniform blocks.
The ARB spec lets you get away with the default block counting against the
blocks for combined size limits.  The core spec says you need to be able to
support the maximum size of default block *and* the maximum size of each
uniform block.  I see no reason that any driver would have a problem with
that.

Fixes gl 3.1/minmax (with an associated fix to the test)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
803262a5f5 glsl: Refuse to parse uniform block declarations when UBOs aren't available.
Fixes piglit
GL_ARB_uniform_buffer_object/compiler/extension-disabled-block.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
e45f1b11c0 glsl: Align GL_UNIFORM_BLOCK_DATA_SIZE according to std140 rules.
Fixes piglit GL_ARB_uniform_buffer_object/data-size test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
86e0045578 glsl: Only flag RowMajor on matrix-type variables.
We were only propagating it to the API when the variable was a matrix type,
but we were still tripping over it in lower_ubo_reference when it was set on a
vector.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
ffb2d43059 glsl: Fix calculation of std140 offset alignment for mat2s.
We were getting the base offset of a vec2, not of a vec2[2] like the quoted
spec text says we should.

v2: Fix swapped then/else cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
300315fe69 glsl: Fix glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX).
Previously, we were returning the index into the UniformBlocks of one of the
linked shaders, when it's supposed to be the program global index.

Fixes piglit getactiveuniformsiv-uniform_block_index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
af3fc6bb28 ir_to_mesa: Don't whack the ->location field of uniform block variables.
Fixes some failures in GL_ARB_uniform_buffer_object/maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
56e82e30cb mesa: Make glBindBufferBase/glBindBufferRange() work on just-genned names.
In between glGenBuffers() and glBindBuffer(), the buffer object points to this
dummy buffer with a name of 0, and a glBindBufferBase() would point to that.
It seems pretty clear, given that glBindBufferBase() only cares about the
current size of the buffer at render time, that it should bind up the buffer
that you passed in instead of pointing it at this useless dummy buffer.

However, what should glBindBufferRange() do?  As of this patch, it will
promote the genned buffer to a proper buffer like it had been
glBindBuffer()ed, and then detect that the size is greater than the buffer's
current size of 0 and throw INVALID_VALUE.  It seems like the most reasonable
answer here.

Note that this also changes the behavior of these two on non-glGenBuffers() bo
names.  We haven't yet set up the error throwing for glBindBuffers() on gl
3.1+, and my assumption is that these two functions should inherit their
behavior on un-genned names from glBindBuffers().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
a75f2681d2 glsl: Add a lowering pass to turn complicated UBO references to vector loads.
v2: Reduce the impenetrable code in emit_ubo_loads() by 23 lines by keeping
    the ir_variable as the variable part of the offset from handle_rvalue(),
    and track the constant offsets from that with a plain old integer value,
    avoiding a bunch of temporary variables in the array and struct handling.
    Also, fix file description doxygen.
v3: Fix a row vs col typo, and fix spelling in a comment.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-07 13:54:47 -07:00
Eric Anholt
8c2a983835 glsl: Add a variant of the rvalue visitor for handle_rvalue() on the way down.
For the UBO lowering pass, I want to see the whole dereference chain for
replacing, not the innermost ir_dereference_variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
2ea3ab14f2 glsl: Add a "ubo_load" expression type for fetches from UBOs.
Drivers will probably want to be able to take UBO references in a
shader like:

        uniform ubo1 {
                float a;
                float b;
                float c;
                float d;
        }

        void main() {
             gl_FragColor = vec4(a, b, c, d);
        }

and generate a single aligned vec4 load out of the UBO.  For intel,
this involves recognizing the shared offset of the aligned loads and
CSEing them out.  Obviously that involves breaking things down to
loads from an offset from a particular UBO first.  Thus, the driver
doesn't want to see

	variable_ref(ir_variable("a")),

and even more so does it not want to see

	array_ref(record_ref(variable_ref(ir_variable("a")),
          "field1"), variable_ref(ir_variable("i"))).

where a.field1[i] is a row_major matrix.

Instead, we're going to make a lowering pass to break UBO references
down to expressions that are obvious to codegen, and amenable to
merging through CSE.

v2: Fix some partial thoughts in the ir_binop comment (review by Kenneth)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
71ba6de342 glsl: Fix a reference to UniformBlocks during uniform linking.
When converting var->location from pointing at the program's UniformBlocks to
pointing at the linked shader's UniformBlocks, I missed this change.  It
usually worked out in the end because the two lists happen to be the same in
many testcases.

Fixes a valgrind complaint on
oglconform ubo-compile.cpp advanced.std140.2stage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
7e42302e71 glsl: Update the notes on adding a new expression type.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
9c1b41879a mesa: Replace VersionMajor/VersionMinor with a Version field.
As we get into supporting GL 3.x core, we come across more and more features
of the API that depend on the version number as opposed to just the extension
list.  This will let us more sanely do version checks than "(VersionMajor == 3
&& VersionMinor >= 2) || VersionMajor >= 4".

v2: Fix a bad <= 30 check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:19 -07:00
Eric Anholt
3aaeb3e5e7 intel: Fix compiler warnings from winsys msaa. 2012-08-07 11:47:11 -07:00
Chad Versace
e943e5c291 intel: Advertise multisample DRI2 configs on gen >= 6
This turns on window system MSAA.

This patch changes the id of many GLX visuals and configs, but that
couldn't be prevented. I attempted to preserve the id's of extant configs
by appending the multisample configs to the end of the extant ones. But
somewhere, perhaps in the X server, the configs are reordered with
multisample configs interspersed among the singlesample ones.

Test results:
  Tested with xonotic and `glxgears -samples 1` on Ivybridge.

  No piglit regressions on Ivybridge.

  On Sandybridge, passes 68/70 of oglconform's
  winsys multisample tests.  The two failing tests are:
      multisample(advanced.pixelmap.depth)
      multisample(advanced.pixelmap.depthCopyPixels)
  These tests hang the gpu (on kernel 3.4.6) due to
  a glDrawPixels/glReadPixels pair on an MSAA depth buffer.  I don't expect
  realworld apps to do that, so I'm not too concerned about the hang.

  On Ivybridge, passes 69/70. The failing case is
  multisample(advanced.line.changeWidth).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:34 -07:00
Chad Versace
8b5d68dd28 intel: Clarify intel_screen_make_configs
This function felt sloppy, so this patch cleans it up a little bit.

- Rename `color` to `i`. It is not a color value, only an iterator int.
- Move `depth_bits[0] = 0` into the non-accum loop because that is where
  it used. The accum loop later overwrites depth_bits[0].
- Rename `depth_factor` to `num_depth_stencil_bits`.
- Redefine `msaa_samples_array` as static const because it is never
  modified. Rename to `singlesample_samples`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
a4bf68ca50 dri: Simplify use of driConcatConfigs
If either argument to driConcatConfigs(a, b) is null or the empty list,
then simply return the other argument as the resultant list.

All callers were accomplishing that same behavior anyway. And each caller
accopmplished it with the same pattern. So this patch moves that external
pattern into the function.

Reviewed-by: <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
b2d428cb8d intel: Refactor creation of DRI2 configs
DRI2 configs were constructed in intelInitScreen2. That function already
does too much, so move verbatim the code for creating configs to a new
function, intel_screen_make_configs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
61fd684782 intel: Downsample on DRI2 flush
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
e88cfbb95f intel: Support mapping multisample miptrees
Add two new functions: intel_miptree_{map,unmap}_multisample, to which
intel_miptree_{map,unmap} dispatch. Only mapping flat, renderbuffer-like
miptrees are supported.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
4c0ccc13bd intel: Refactor use of intel_miptree_map
Move the opencoded construction and destruction of intel_miptree_map into
new functions, intel_miptree_attach_map and intel_miptree_release_map.
This patch prevents code duplication in a future commit that adds support
for mapping multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
81980958d0 intel: Refactor intel_miptree_map/unmap
Move the body of intel_miptree_map into a new function,
intel_miptree_map_singlesample. Now intel_miptree_map dispatches to the
new function. A future commit adds a multisample variant.

Ditto for intel_miptree_unmap.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
6b56140b4b i965: Mark needed downsamples for msaa winsys buffers
Add function intel_renderbuffer_set_needs_downsample. It is a no-op
except on multisample winsys buffers shared with DRI2.

Mark the needed downsamples with the new function at two locations:
    - Immediately after drawing is complete.
    - After blitting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
d3746354fb intel: Define functions for up/downsampling on miptrees
Flesh out the stub functions intel_miptree_{up,down}sample.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
6cc9df331b i965: Add function brw_blorp_blit_miptrees
Define a function, brw_blorp_blit_miptrees, that simply wraps
brw_blorp_blit_params + brw_blorp_exec with C calling conventions. This
enables intel_miptree.c, in a following commit, to perform blits with
blorp for the purpose of downsampling multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
f4873babdc intel: Allocate miptree for multisample DRI2 buffers
Immediately after obtaining, with DRI2GetBuffersWithFormat, the DRM buffer
handle for a DRI2 buffer, we wrap that DRM buffer handle with a region and
a miptree. This patch additionally allocates an accompanying multisample
miptree if the DRI2 buffer is multisampled.

Since we do not yet advertise multisample GL configs, the code for
allocating the multisample miptree is currently inactive.

This patch adds the following fields to intel_mipmap_tree:
    singlesample_mt
    needs_downsample
and the following function stubs:
    intel_miptree_downsample
    intel_miptree_upsample

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
4eba67285f intel: Refactor creation of hiz and mcs miptrees
Move the logic for creating the ancillary hiz and mcs miptress for winsys
and non-texture renderbuffers from intel_alloc_renderbuffer_storage to
intel_miptree_create_for_renderbuffer. Let's try to isolate complex
miptree logic to intel_mipmap_tree.c.

Without this refactor, code duplication would be required along the
intel_process_dri2_buffer codepath in order to create the mcs miptree.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
e2f2376e88 intel: Set num samples for winsys renderbuffers
Add a new param, num_samples, to intel_create_renderbuffer and
intel_create_private_renderbuffer.

No multisample GL config is yet advertised, so the value of num_samples is
currently 0.  For server-owned winsys buffers, gl_renderbuffer::NumSamples
is not yet used.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
53fa28f7b1 intel: Refactor quantize_num_samples
Rename quantize_num_samples to intel_quantize_num_samples and change the
first param from struct intel_context* to struct intel_screen*. The
function will later be used by intelCreateBuffer, which is not bound to
any context but is bound to a screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
7a2e40ed28 intel: Update stale comment for intel_miptree_slice::map
The comment referred to intel_tex_image_map/unmap, but should more
accurately refer to intel_miptree_map/unmap.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Paulo Zanoni
4b40375c43 i965: add more Haswell PCI IDs
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:13:47 -03:00
Brian Paul
8433f80add egl: remove redundant PFNEGLQUERYSTREAMTIMEKHRPROC typedef
This typedef is present earlier in the header and isn't part of the
EGL_KHR_stream_cross_process_fd extension.  Looks like a Khronos glitch.
2012-08-07 07:31:05 -06:00
Brian Paul
99695f58fd softpipe: fix loop limit for tex_cache[] array
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53199
2012-08-07 08:00:46 -06:00
Vinson Lee
7d65356d8a st/mesa: Fix a potential memory leak in get_mesa_program.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 22:08:56 -07:00
Vinson Lee
c3894bc2d5 gallivm: Add constructor for raw_debug_ostream.
Fixes uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 22:07:31 -07:00
Brian Paul
e622723918 docs: update ARB_debug_output status to DONE 2012-08-06 16:48:00 -06:00
Jason Wood
56c1f55c51 docs: Add OpenGL 4.3 requirements
v2: Note that GLSL 4.3 has not been started, and that
ARB_compute_shader has been started in Gallium drivers.

Signed-off-by: Jason Wood <sandain@hotmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:41:24 -06:00
Ian Romanick
45e592c3dd egl: Import eglext.h version 14
This is necessary for EGL_KHR_create_context work (including writing
piglit tests).

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>
2012-08-06 15:37:04 -07:00
Ian Romanick
b50703aea5 egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_context
KHR extension name is reserved for Khronos ratified extensions, and there is
no such thing as EGL_KHR_surfaceless_{gles1,gles2,opengl}.  Replace these
three extensions with EGL_KHR_surfaceless_context since that extension
actually exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
cb77f5dd1f egl_dri2: Refactor dereference of dri2_ctx_shared
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
05413ddb1d egl_dri2: Remove swrast version >= 2 checks
Since support for swrast version 2 was added (f55d027a), it has also been
required.  In swrast_driver_extensions, version 2 is set for __DRI_SWRAST
extension.  Remove the spurious version checks sprinked through the code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
63adb6b9ea dri2: Fix bug in attribute handling for non-desktop OpenGL contexts
Previously an error would be generated if any attributes were specified when
creating a non-desktop OpenGL context.  This was a mistake, and it will
prevent old drivers from working with new EGL libraries that add support for
the createContextAttribs interface.  Instead, match the behavior of
EGL_KHR_create_context: allow versions that make sense, reject non-zero flags.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Andreas Boll
102617bc52 docs: update piglit url
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:23:43 -06:00
Andreas Boll
933e13e2af docs/helpwanted: add r600g and i915g todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:23:43 -06:00
Kenneth Graunke
caa4ae5d7d i965: Allocate dummy slots for point sprites before computing VUE map.
Commit f0cecd43d6 moved the VUE map computation to be only once, at
VS compile time.  However, it did so in slightly the wrong place: it
made the one call to brw_vue_compute_map happen right before the
allocation of dummy slots for replaced point sprite coordinates, causing
a different VUE map to be generated (at least on Ironlake).

Fixes a regression in Piglit's point-sprite test on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46489
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:40 -07:00
Kenneth Graunke
54c045b93c i965/vs: Don't clobber sampler message MRFs with subexpressions.
See the preceding commit for a description of the problem.

NOTE: This is a candidate for stable release branches.

v2: Use a separate dPdx variable rather than reusing the lod src_reg.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:15 -07:00
Kenneth Graunke
c0f60106df i965/fs: Don't clobber sampler message MRFs with subexpressions.
Consider a texture call such as:

   textureLod(s, coordinate, log2(...))

First, we begin setting up the sampler message by loading the texture
coordinates into MRFs, starting with m2.  Then, we realize we need the
LOD, and go to compute it with:

   ir->lod_info.lod->accept(this);

On Gen4-5, this will generate a SEND instruction to compute log2(),
loading the operand into m2, and clobbering our texcoord.

Similar issues exist on Gen6+.  For example, nested texture calls:

  textureLod(s1, c1, texture(s2, c2).x)

Any texturing call where evaluating the subexpression trees for LOD or
shadow comparitor would generate SEND instructions could potentially
break.  In some cases (like register spilling), we get lucky and avoid
the issue by using non-overlapping MRF regions.  But we shouldn't count
on that.

Fixes four Piglit test regressions on Gen4-5:
- glsl-fs-shadow2DGradARB-{01,04,07,cumulative}

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:11 -07:00
Kenneth Graunke
27bf9c1997 i965/fs: Factor out texcoord setup into a helper function.
With the textureRect support and GL_CLAMP workarounds, it's grown
sufficiently that it deserves its own function.  Separating it out
makes the original function much more readable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:09 -07:00
Kenneth Graunke
82bfb4b41a i965/fs: Move message header and texture offset setup to generate_tex().
Setting the texture offset bits in the message header involves very
specific hardware register descriptions.  As such, I feel it's better
suited for the lower level "generate" layer that has direct access to
the weird register layouts, rather than at the fs_inst abstraction layer.

This also parallels the approach I took in the VS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:00 -07:00
Jerome Glisse
2df399c34b r600g: atomize sampler state v2
Use atom for sampler state. Does not provide new functionality
or fix any bug. Just a step toward full atom base r600g.

v2: Split seamless on r6xx/r7xx into it's own atom. Make sure it's
    emited after sampler and with a pipeline flush before otherwise
    it does not take effect.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-08-06 12:04:55 -04:00
Alex Deucher
d3f8000bfc radeonsi: add some new pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06 10:55:41 -04:00
Alex Deucher
a6146d2566 r600g: add additional evergreen pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06 10:55:41 -04:00
Brian Paul
8eeeef3705 st/mesa: merge fragment/vertex sampler update code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:20 -06:00
Brian Paul
819e786339 st/mesa: massage update_vertex_samplers() code
...to look like update_fragment_samplers() code, as with the previous
commit.  The next step would be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:19 -06:00
Brian Paul
2aac0d145a st/mesa: merge fragment/vertex texture update code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:11 -06:00
Brian Paul
dd6aafcf72 st/mesa: massage the update_vertex_textures() code
...to look like update_fragment_textures() code.  The next step would
be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:41:07 -06:00
Brian Paul
5749ae919e st/mesa: rename some vertex/fragment state fields for better consistency
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:41:07 -06:00
Brian Paul
29604441de llvmpipe: consolidate the sampler and sampler view setting code
Less code.  And as with softpipe, if/when we consolidate the pipe_context
functions for binding sampler state, this will make the llvmpipe changes
trivial.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
b3538d3563 llvmpipe: combine vertex/fragment sampler state into an array
This will allow code consolidation in the next patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
1f34e1a6cb softpipe: consolidate vert/frag/geom sampler setting functions
The functions for setting samplers and sampler views for vertex,
fragment and geometry shaders were nearly identical.  Now they
use shared code.

In the future, if the pipe_context functions for setting samplers
and sampler views for vert/frag/geom/compute are combined, this
will make updating the softpipe driver a snap.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
d6c3e6d8f3 softpipe: consolidate sampler-related arrays
Combine separate arrays for vertex/fragment/geometry samplers, etc into
one array indexed by PIPE_SHADER_x.

This allows us to collapse separate code for vertex/fragment/geometry
state into loops over the shader stage.  More to come.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
0a14e9f09f softpipe: combine vert/frag/geom texture caches in an array
This lets us consolidate some code now, and more in subsequent patches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Vinson Lee
61b62c007a mesa: Fix off-by-one error in Parse_TextureImageId.
Fixes out-of-bounds write defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 21:42:23 -07:00
Vinson Lee
3e7b3a04bf util: Move dereference after null check in util_resource_copy_region.
Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 21:41:27 -07:00
Brian Paul
a5ca29100b i915g: silence a const pointer warning 2012-08-04 08:38:11 -06:00
Marek Olšák
f9a498d1bc radeonsi: fix build failure after blitter changes 2012-08-04 16:34:24 +02:00
Marek Olšák
cb922b63eb r600g: precompute color buffer state in pipe_surface and reuse it 2012-08-04 14:05:52 +02:00
Marek Olšák
cdc681c3ad r600g: precompute depth buffer state in pipe_surface and reuse it
This is done on-demand, because we don't know in advance if a zbuffer
will be bound as depth or color.
2012-08-04 14:05:51 +02:00
Marek Olšák
e6dfc8c77b r600g: simplify create_surface 2012-08-04 14:05:51 +02:00
Marek Olšák
581f7e3101 r600g: drop the old texture allocation code
Made obsolete by the libdrm surface allocator.
2012-08-04 14:05:51 +02:00
Marek Olšák
7c371f4695 r600g: make sure copying of all texture formats is accelerated 2012-08-04 14:05:51 +02:00
Marek Olšák
84645fa613 gallium/u_blitter: add a query for checking whether copying is supported
v2: add comments
2012-08-04 14:05:37 +02:00
Marek Olšák
e2f623f1d6 r600g: don't decompress depth or stencil if there isn't any 2012-08-04 13:53:07 +02:00
Marek Olšák
ea72351a91 r600g: correct texture memory size for Z32F_S8X24 on evergreen 2012-08-04 13:53:07 +02:00
Marek Olšák
c8ff737a18 gallium/u_blitter: remove fallback for stencil copy that all drivers skipped
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
ef1bf6d69e gallium/u_blitter: add ability to blit only depth or only stencil
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
8842678047 gallium: define PIPE_MASK_RGBAZS
I need this and it seems like it could be useful.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
8aaf6972d1 gallium/u_blitter: minor cleanup
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
67a3e5bc32 gallium/tgsi: fixup texture name strings
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
6c420b1668 gallium/u_blitter: set sample mask to ~0
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
9d1ef354f9 gallium/u_blit: bail out if src is a multisample texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
6b3f1ae12b gallium/u_blit: check nr_samples before using resource_copy_region
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
e7689303a8 gallium: set sample mask to ~0 for clear, blit and gen_mipmap
The sample mask affects single-sampled rendering too (it's orthogonal
to the color mask).

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:06 +02:00
Dave Airlie
cd97a5f660 r600g: fix F2U opcode translation
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-08-04 13:45:27 +02:00
Vinson Lee
5bce0b5175 draw: Ensure channel in convert_to_soa is initialized.
Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-03 22:28:31 -07:00
Vinson Lee
9d36b3abfd u_blitter: Move a pointer dereference after null check.
Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-03 22:27:13 -07:00
Matt Turner
fb85558ab1 Use C99 NAN and INFINITY macros 2012-08-03 15:02:09 -07:00
Brian Paul
65da837fcf gallium/tests/trivial: updates for CSO interface changes 2012-08-03 11:58:43 -06:00
Brian Paul
c61d3fe8bd st/xorg: updates for CSO interface changes 2012-08-03 11:56:36 -06:00
Brian Paul
459dd56897 st/xa: updates for CSO interface changes 2012-08-03 11:56:28 -06:00
Brian Paul
3d1bec5d9a vega: fix build breakage from cso sampler/view changes 2012-08-03 08:33:23 -06:00
Brian Paul
832706a80b cso: remove unreachable break statements 2012-08-03 07:16:35 -06:00
Brian Paul
076e5eacf1 cso: 80-column wrapping, remove trailing whitespace, etc 2012-08-03 07:16:35 -06:00
Brian Paul
ea6f035ae9 gallium: consolidate CSO sampler and sampler_view functions
Merge the vertex/fragment versions of the cso_set/save/restore_samplers()
functions.  Now we pass the shader stage (PIPE_SHADER_x) to the function
to indicate vertex/fragment/geometry samplers.  For example:

cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler);

This results in quite a bit of code reduction, fewer CSO functions and
support for geometry shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-03 07:16:35 -06:00
Vinson Lee
350f12fb65 st/mesa: Ensure dst in compile_instruction is initialized.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-02 21:10:49 -07:00
Tom Stellard
f6ad8b45c2 radeon/llvm: Add $(LLVM_LDFLAGS) to the loader linker flags 2012-08-02 20:12:11 +00:00
Tom Stellard
4a89a20717 radeon/llvm: Add support for more f32 CMP instructions on SI 2012-08-02 20:12:11 +00:00
Tom Stellard
a35eea7868 radeon/llvm: Add support for fneg on SI 2012-08-02 20:12:10 +00:00
Tom Stellard
4104bae063 radeon/llvm: Add support for fp_to_sint on SI 2012-08-02 20:12:10 +00:00
Tom Stellard
f7fcaa07df radeon/llvm: Remove CMOVLOG DAG node 2012-08-02 20:12:06 +00:00
Tom Stellard
a5ac8ee2c5 radeonsi: Properly initialize si_shader_ctx.radeon_bld 2012-08-02 13:21:30 -04:00
Michel Dänzer
c2bae6b91d radeonsi: Handle TGSI TXP opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 18:38:47 +02:00
Michel Dänzer
93b4f1f97e radeonsi: Handle TGSI DIV opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 18:38:16 +02:00
Brian Paul
daf4254d07 svga: remove questionable INLINE qualifiers 2012-08-02 09:40:41 -06:00
Brian Paul
421f134028 svga: sort #includes 2012-08-02 09:40:40 -06:00
Brian Paul
81f2f3f65c svga: add some comments in svga_screen_cache.c 2012-08-02 09:40:40 -06:00
Brian Paul
4b5a5898b1 svga: whitespace, formatting fixes 2012-08-02 09:40:40 -06:00
Brian Paul
bcd8d9713d svga: remove unneeded 'struct svga_screen' declarations 2012-08-02 09:40:40 -06:00
Brian Paul
8551635242 mesa: fix default_access_mode() result for ES2
The GL_OES_mapbuffer extension is supported by OpenGL ES 1 and ES 2 so return
GL_MAP_WRITE_BIT for both ES versions, not just ES 1.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-02 09:40:40 -06:00
Brian Paul
3eb2b5c5e4 mesa: default_access_mode() returns a GLbitfield, not GLenum 2012-08-02 09:40:40 -06:00
José Fonseca
4bd36956f8 scons: set YACCHXXFILESUFFIX to stop needless rebuilding of the parser
Before, the GLSL parser was getting rebuilt every time that scons was
run.  The problem was scons was expecting a glsl_parser.hpp file but
we were generating a glsl_parser.h file.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-02 09:40:40 -06:00
Christian König
41625afa2f radeonsi: initial VDPAU target
Windowed speed is of course way to slow, but fullscreen
works like a charm now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 15:15:23 +02:00
Christian König
a3c6607be1 radeon/llvm: fix fp immediates on SI
I don't know if this is a good idea, but it
fixes the problem at hand.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 15:15:00 +02:00
Christian König
250b7fdd26 radeonsi: fix TEX writemask
Using the writemask in the sampler results in packet
VGPRS. For now just sample all components and let
llvm chose the right one.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 12:05:33 +02:00
Christian König
3508815d17 radeonsi: fix shader param and color count
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:57 +02:00
Christian König
92b96a883f radeonsi: fix texture loads from sampler > 0
The backend is multiplying the offset by the numbers of
elements anyway, so doing it twice just makes everything
crash.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:52 +02:00
Christian König
9b7dc5e81c radeonsi: disable tiling until we fixed all bugs
Currently there are more important things to worry about.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:40 +02:00
Vinson Lee
8734584952 scons: Add support for Intel Compiler.
The patch makes the SCons build with Intel Compiler successful.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 21:28:47 -07:00
Pauli Nieminen
204bfb904b meta: Use sampler object in framebuffer blit
Framebuffer blit needs to setup texture sampling with no reference to the
user's texturing state, and a sampler object lets us avoid a bunch of changes
to the user's state setup.

We don't bother caching the sampler object since we're changing parameters in
it based on the filtering option to glBlitFramebuffer().

Fixes piglit GL_ARB_sampler_objects/framebufferblit and rendering in l4d2 (our
setting of srgb decode wasn't being respected due to the user's sampler object
being active).

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
676a563d5b meta: Add sampler object to texture decompression
Sampler objects can be used to shadow texture object state without
modifying original application state. Decompression path feels a bit
like path where caching shouldn't happen. But as everything else is
cached already I decided to cache sampler state too.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
5a320d5bcf mesa: Allow meta module to call sampler functions
To allow meta module to use sample objects mesa GL functions need to be
visible and linkable for meta module.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
cbdc1d5354 swrast: Support sampler object for texture fetching state
swrast needs to pass sampler object into all texture fetching functions
to use correct sampling state when sampler object is bound to the unit.
The changes were made using half manual regular expression replace.

v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current
    values aren't set yet, so we need to look at our texObj2D. (anholt)

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:55:51 -07:00
Pauli Nieminen
8129dabb5f mesa: Make ARB_sampler_objects mandatory
To allow meta acceleration operations to use sampler objects the
ARB_sampler_objects extension needs to be mandatory for all drivers.
Because the extension doesn't have any hardware dependencies it is
trivial to implement.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
ae58f9696c mesa/program: Use sampler object state if present
CompareFailValue is part of Sampler state that needs to be read from
bound sampler object if present.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
cae7636852 mesa/ff_shader: Fix sampler state reading
Fixed function fragment shader generator was incorrectly read texture
sampling state directly from texture object. To make sure that
ARB_sampler_object works correctly shader generator has to use the
bound sampler if one exist.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
6f6bd8aedc radeon&r200: Add support for ARB_sampler_objects
Preparation for the mandatory support of ARB_sampler_objects. I have tested
this patch with rv280 only.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
10169e7adc radeon: Fix printf format not to warn in 64bit
When I build tested radeon changes I noticed two warnings about format
size missmatch in 64bit. I decided to clean them to make relevant
compiler warnings easier to spot.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
54808e560f nouveau: Add support for ARB_sampler_objects
ARB_sampler_objects is very simple software only extension to support.  I want
to make it a mandatory extension for Mesa drivers to allow the meta module to
use it.

This patch add support for the extension to nouveau. It is completely untested
search and replace patch, except for flagging the texture state as needing to
be recomputed when a sampler object is present.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
765509903b mesa/samplerobj: Support EXT_texture_sRGB_decode
sRGBDecode state is part of sampler object state but mesa was missing
handlers to access the state. This patch adds the support for required
state changes and queries.

GL_EXT_texture_sRGB_decode issue 4:
"4) Should we add forward-looking support for ARB_sampler_objects?

        RESOLVED: YES

        If ARB_sampler_objects exists in the implementation, the sampler
        objects should also include this parameter per sampler."

Fixes piglit GL_ARB_sampler_objects/GL_EXT_texture_sRGB_decode.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
c37efbfe4c mesa: Move DepthMode to texture object
GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on
compatibility profile specifications.

OpenGL specification 4.1 compatibility 20100725 3.9.2:
"... The values accepted in the pname parameter
are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_-
FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_-
LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and
TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and
in the sampler state in table 6.26 is not part of the sampler state, and remains in the
texture object."

The list of states is in Table 6.24 "Textures (state per texture
object)" instead of 6.25 mentioned in the specification text.

Same can be found from 3.3 compatibility specification.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:30:13 -07:00
Paul Berry
c18806cebf i965/msaa: Allow GL_SAMPLES to be set to 1 prior to Gen6.
This patch allows GL_SAMPLES to be set to either 0 or 1 on i965
platforms that don't support MSAA (those prior to Gen6).  Setting
GL_SAMPLES=1 has the same effect as setting it to 0 on these platforms
(because MSAA is unsupported), but is distinguishable via the GL API.

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

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-01 12:45:20 -07:00
Paul Berry
97fc89c6cb i965/msaa: Treat GL_SAMPLES=1 as equivalent to GL_SAMPLES=0.
EXT_framebuffer_multisample is a required subpart of
ARB_framebuffer_object, which means that we must support it even on
platforms that don't support MSAA.  Fortunately
EXT_framebuffer_multisample allows for this by allowing GL_MAX_SAMPLES
to be set to 1.

This leads to a tricky quirk in the GL spec: since
GlRenderbufferStorageMultisamples() accepts any value for its
"samples" parameter up to and including GL_MAX_SAMPLES, that means
that on platforms that don't support MSAA, GL_SAMPLES is allowed to be
set to either 0 or 1.  On platforms that do support MSAA, GL_SAMPLES=1
is not used; 0 means no MSAA, and 2 or higher means MSAA.

In other words, GL_SAMPLES needs to be interpreted as follows:
  =0  no MSAA (possible on all platforms)
  =1  no MSAA (only possible on platforms where MSAA unsupported)
  >1  MSAA (only possible on platforms where MSAA supported)

This patch modifies all MSAA-related code to choose between
multisampling and single-sampling based on the condition (GL_SAMPLES >
1) instead of (GL_SAMPLES > 0) so that GL_SAMPLES=1 will be treated as
"no MSAA".

Note that since GL_SAMPLES=1 implies GL_SAMPLE_BUFFERS=1, we can no
longer use GL_SAMPLE_BUFFERS to distinguish between MSAA and non-MSAA
rendering.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-01 12:45:15 -07:00
Tomeu Vizoso
d5c918f6ad glsl: Add support for OES_standard_derivatives in GLSL ES.
Previously, we advertised the extension but the builtin functions
were enabled only for GLSL and not for ES.

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

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-01 10:44:44 -07:00
Chad Versace
8c94f6bbd8 intel: Use consistent pattern in intelCreateBuffer
The 16-bit depth case did not follow the function's prevalent pattern.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:40 -07:00
Chad Versace
2b4fbc4d7d intel: Decrease nesting level in intelCreateBuffer
Nearly the whole function body was contained in the 'else' branch. The
'if' branch did one thing: return early with an error. Clean things up by
moving all the code out of the 'else' branch. Decreases max nesting level
from 4 to 3.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:38 -07:00
Chad Versace
83fa0842ca intel: Remove dead code in intelAllocateBuffer
After commit "intel: Convert to using private depth/stencil buffers", we
request from DRI2GetBuffersWithFormat only the front left and back left
buffers. We no longer request depth and stencil buffers.

Assert that in intelAllocateBuffer and remove the related dead code.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:36 -07:00
Matt Turner
84ead7b4e8 configure.ac: Remove extra ;;
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53053
2012-08-01 10:12:50 -07:00
Matt Turner
33ae29c93b configure.ac: Don't duplicate CFLAGS
These assignments caused CFLAGS specified on the configure line to
appear twice in the final CFLAGS. Removing them makes the behavior
reasonable -- USER_CFLAGS are appended at the end of CFLAGS, allowing
the builder to override flags added by configure.ac like
-fno-strict-aliasing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:50 -07:00
Matt Turner
14819eb588 configure.ac: Remove contractions to stop breaking syntax highlighting
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:50 -07:00
Matt Turner
0e38a3ca52 configure.ac: remove remnants of ppc asm support
Missed by d387899388.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:22 -07:00
Adam Jackson
33ef67ab20 linux: Default to dri not xlib on all arches
Even on s390{,x} where there's no video card, you still want this so GLX
protocol works.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-08-01 12:37:25 -04:00
Christoph Bumiller
8592933de8 nv50,nvc0: make resolve sampler objects allow sRGB conversion
Just figured out what that bit does.

Note: It's converted back to sRGB on write, so no effective
conversion occurs.
2012-08-01 15:39:46 +02:00
Christoph Bumiller
6286d9810b Revert "gallium: specify resource_resolve destination via a pipe_surface"
This reverts commit 5d5af7d359.

It turns out the issue this was supposed to fix merely counter-acted
a bug in the hardware driver that I wasn't aware of.

The resource_resolve is not supposed to do sRGB conversion, period.
(This would violate the requirement that source and destination must
be of the same format).
2012-08-01 15:39:46 +02:00
Roland Scheidegger
be2dcc5e9f r200: get rid of dubious aux scissor bits
no point in emitting aux scissor values if we
a) never enable them
b) never set the actual values

plus it is enough to have that aux scissor enable reg (which we never set to
enable) in one place not two.
2012-08-01 14:58:47 +02:00
Roland Scheidegger
c0c216c469 radeon/r200: get rid of some unneeded cliprect/scissor code
Noone was interested in the number of cliprects, and noone cared
about the intersect result neither. So just nuke this.
2012-08-01 14:58:38 +02:00
Roland Scheidegger
549470aa1a r200: get rid of old gart memory functions from old dri1
Those functions are SO dead.
2012-08-01 14:58:29 +02:00
Roland Scheidegger
de694b6b10 radeon/r200: fix bogus clears
There were several problems with these functions (which are a remnant
of dri1 hyperz mostly - should bring it back somehow someday).
First, it would always do a swrast clear if the buffer to clear was a fbo.
Second, for buffers we wouldn't handle the clear (I guess aux/accum?) we
would actually still have tried to clear that later even when we already
cleared it with swrast.
2012-08-01 14:58:23 +02:00
Roland Scheidegger
5b88a2a22d radeon/r200: fix bogus assert/scissor wrt width/height 2048
This addresses one issue raised in bug #51658 discovered by Eugene St Leger.
The assert is bogus since there's no problem with texture width/height being
2048 (the width/height programmed is width/height minus one).
OTOH though the programmed size for scissor rect should be width/height
minus one too otherwise bad things may happen (as it is inclusive, and there's
not enough bits for more than a value of 2047).
2012-08-01 14:58:15 +02:00
Christian König
6574fe3c4a radeon/llvm: fix calculation of max register number
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-01 11:15:06 +02:00
Tom Stellard
a488fdd3d9 radeon/llvm: Add pseudo-support for 64-bit immediate types on SI
SI does not support 64-bit immediates natively, but llvm will generate
i64 immediates when indexing loads and stores (since SI has 64-bit
pointers).  The i64 indices will always be small enough to fit into
32-bits (i.e. the high 32 bits will always be all zeros), so we can
treat these index values as 32-bits.
2012-07-31 20:19:21 +00:00
Tom Stellard
be46874281 radeon/llvm: Fix incorrect return value in SelectADDRReg()
We need to return true when we match the pattern.
2012-07-31 20:19:20 +00:00
Tom Stellard
056b77ca22 radeon/llvm: Move SMRD IMM pattern before SMRD SGPR pattern
In tablegen, if two patterns match, the one that comes first in the file
is given preference.  We want the SMRD IMM pattern to be given
preference, because it encodes the pointer offset in its immediate
field, which saves us an add instruction.
2012-07-31 20:19:20 +00:00
Eric Anholt
877a897adc glsl: Reject linking shaders with too many uniform blocks.
Part of fixing piglit maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
fa08b8ad54 mesa: Return -1 for glGetUniformLocation on UBOs.
Fixes piglit ARB_uniform_buffer_object/getuniformlocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
bbd1d6124d glsl: Assign array and matrix stride values according to std140 layout.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
551bdf25bc glsl: Add support for default layout qualifiers for uniforms.
I ended up having to add rallocing of the ast_type_qualifier in order
to avoid pulling in ast.h for glsl_parser_extras.h, because I wanted
to track an ast_type_qualifier in the state.

Fixes piglit ARB_uniform_buffer_object/row-major.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
7b77c64254 glsl: Merge UBO layout qualifiers in a qualifier list.
Yes, you get to say things like "layout(row_major, column_major)" and
get column major.

Part of fixing piglit ARB_uniform_buffer_object/row_major.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
eed967bc9c mesa: Add support for GL_ARB_ubo's glGetActiveUniformName().
This is like a stripped-down version of glGetActiveUniform that just
returns the name, since the other return values (type and size) of
that function are now meant to be handled with
glGetActiveUniformsiv().

Fixes piglit ARB_uniform_buffer_object/getactiveuniformname

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
dc654370c3 mesa: Add support for most of the other pnames of glGetActiveUniformBlockiv().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
5a165d1f3a mesa: Add support for getting active uniform block names.
Fixes piglit ARB_uniform_buffer_object/getactiveuniformblockname.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
467304dfe5 mesa: Add support for glUniformBlockBinding() and the API to get it back.
Fixes piglit ARB_uniform_buffer_object/uniformbufferbinding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
fafa394c15 glsl: Incorporate all UBO language changes into GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
4070036259 mesa: Add support for glGetProgramiv pnames for UBOs.
Fixes piglit ARB_uniform_buffer_object/getprogramiv.

v2: Add extension checks.
v3: Appease MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Kenneth Graunke
3a90dc22d1 glsl: Refactor #version validation to be more future-proof.
The previous implementation required a flag in _mesa_glsl_parse_state
and line of code to initialize it for every version of the shading
language we intend to support.  As we look to add 150, 330, 400, 410,
420, and beyond, this gets rather unwieldy.

This patch retains the switch statement (to reject, say, #version 111),
but removes all the bits.  Code to check for ctx->API == API_OPENGL_CORE
could easily be added to the 110 and 120 cases to reject those.

v2: Use _mesa_is_desktop_gl to preserve the existing behavior in the
    presence of the new API_OPENGL_CORE enumeration.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-07-31 11:20:49 -07:00
Eric Anholt
19bd5936af i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.
Fixes some failures in getteximage-formats.

v2: Remove stray include, and drop extra test for encoding == GL_SRGB --
    _mesa_get_srgb_format_linear() returns the same format if it wasn't SRGB.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48120
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
NOTE: This is a candidate for the 8.0 branch.
2012-07-31 11:14:23 -07:00
Kenneth Graunke
03ac5c54b5 glsl: Fix #pragma invariant(all) language version check.
It was using state->Const.GLSL_100ES, which is set if the driver
supports ARB_ES2_compatibility or we're in ES2 mode.  Instead, it should
use state->language_version, as that represents the actual GLSL version
of the shader being compiled.

Since the correct logic is < 120 && !100, just make it == 110.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 10:52:54 -07:00
Kenneth Graunke
d84b3a5a3c mesa: Support glGetString(GL_SHADING_LANGUAGE_VERSION) for >= 1.40.
This will need to get refactored when we add support for core profiles
or forward-compatible contexts, but we may as well have it in the
meantime.  This allows us to override the GLSL version and experiment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-31 10:52:54 -07:00
Brian Paul
591594ea1e ir_to_mesa: make size_swizzles[] array static const 2012-07-31 09:00:41 -06:00
Jon TURNEY
27013e5164 Move installing osmesa.pc to drivers/osmesa
Move installing osmesa.pc to drivers/osmesa, where it belongs better

This also restores the installation of gl.pc if we are building osmesa at the
same time as libGL, which was broken in commit 39785488 when the .pc
installation was converted to automake

v2:
Remove HAVE_OSMESA_DRIVER automake conditional, it's now pointless as we
will only be building in the drivers/osmesa directory if the condition it
checked was true.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-31 12:48:33 +01:00
Vinson Lee
2faa2b4f7e gallium/util: Use GCC built-in functions for NaN and infinity.
This patch fixes this build failure with Intel Compiler.

src/gallium/auxiliary/util/u_format_tests.c(903): error: floating-point operation result is out of range
     {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c01), UNPACKED_1x1(        NAN, 0.0, 0.0, 1.0)},

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-30 23:27:19 -07:00
Jordan Justen
3d0b54c7c6 mesa: don't enable legacy GL functions when using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
1fea3df6f4 intel: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
0f099df567 meta: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
4aecd8f031 glsl: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
09714c09a4 mesa: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Jordan Justen
3d284dcba6 mesa: add api check functions
These functions make it easier to check for multiple API types.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Jordan Justen
1c29b73f4d mesa: add API_OPENGL_CORE api
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Ian Romanick
d3de40742f glsl: Fix ir_last_opcode value.
Now that ir_quadop_vector exists, ir_last_binop and ir_last_opcode are
no longer the same.  Only one place currently uses this enumeration, and
already handles ir_quadop_vector correctly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:15:48 -07:00
Ian Romanick
9d998a2a59 glsl: Request an Nx1 type instance in ir_quadop_vector lowering pass.
No types have 0 columns.  The glsl_type::get_instance method contains

   if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
      return error_type;

To get a vector, use columns = 1.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:14:34 -07:00
Kenneth Graunke
13cb99dc73 glsl: Make bvec and ivec types accessible without using get_instance.
It's more convenient to use shortcuts like glsl_type::bvec2_type than
the longwinded glsl_type::get_instance(GLSL_TYPE_BOOL, 2, 1).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:14:09 -07:00
Tom Stellard
cd0949eb28 radeon/llvm: Cleanup AMDIL.h 2012-07-30 21:10:14 +00:00
Tom Stellard
2f921101c0 radeon/llvm: Rename all AMDIL* classes to AMDGPU* 2012-07-30 21:10:14 +00:00
Tom Stellard
b72ab79d73 radeon/llvm: Merge AMDILSubtarget into AMDGPUSubtarget 2012-07-30 21:10:13 +00:00
Tom Stellard
27ae41c83d radeon/llvm: Merge AMDILTargetLowering class into AMDGPUTargetLowering 2012-07-30 21:10:13 +00:00
Tom Stellard
c96490e3b5 radeon/llvm: Remove IL_cmp DAG node 2012-07-30 21:10:13 +00:00
Tom Stellard
aece7970eb radeon/llvm: Cleanup and reorganize AMDIL .td files 2012-07-30 21:10:13 +00:00
Tom Stellard
0ce6e50601 radeon/llvm: Remove lowering code for unsupported features
e.g. function calls, load/store from stack
2012-07-30 21:10:08 +00:00
Tom Stellard
caeaf43dad radeon/llvm: Remove AMDILVersion.td 2012-07-30 20:31:57 +00:00
Tom Stellard
c3111eb639 radeon/llvm: Remove AMDILAlgorithms.tpp 2012-07-30 20:31:57 +00:00
Tom Stellard
ac669c32c6 radeon/llvm: Merge AMDILInstrInfo.cpp into AMDGPUInstrInfo.cpp 2012-07-30 20:31:57 +00:00
Tom Stellard
3a0187b1b5 radeon/llvm: Merge AMDILRegisterInfo into AMDGPURegisterInfo 2012-07-30 20:31:57 +00:00
Tom Stellard
9c42fb6f26 radeon/llvm: Change the tablegen target from AMDIL to AMDGPU 2012-07-30 20:31:56 +00:00
Kenneth Graunke
f56dfc3213 i965: Support MESA_FORMAT_SIGNED_RGBA_16.
The hardware supports this format with no known quirks, so we may as
well enable it.

Alpha blending is not supported until Sandybridge, but as far as I can
tell, OpenGL doesn't require alpha blending on SNORM formats.  Plus, we
already expose R8G8B8A8_SNORM which has a similar restriction.

Fixes 6 piglit texwrap-2D-*SNORM* cases,
gl-3.1/required-sized-texture-formats, and 10 oglconform snorm-textures
subcases

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-30 09:35:58 -07:00
Elvis Lee
e7a4a2b18b gbm: Fix build for wayland include
backends/gbm_dri.c fails to find wayland-server.h.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-30 11:58:02 -04:00
Brian Paul
b51be8786f mesa: fix _math_matrix_copy(), again
The matrix is 16 GLfloats in size.  Since from->inv is just a pointer (not
an array), sizeof(*from->inv) wasn't right.
2012-07-30 08:30:15 -06:00
Vinson Lee
502c10839e mesa: Fix wrong sizeof argument in _math_matrix_copy.
Fixes Coverity wrong sizeof argument defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-30 08:13:55 -06:00
Christian König
86490bc150 radeonsi: fix db and stencil setup v2
v2: fix tiling for small pitches, that finally makes
    glxgears and readPixSanity work

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:02:04 +02:00
Christian König
7dace3a3cf radeonsi: fix stencil op mapping
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:02:00 +02:00
Christian König
ad15c8c0f1 radeonsi: fix assertion in si_bind_vs_sampler
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:55 +02:00
Christian König
1fb8ee62fa radeonsi: fix shader binding
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:51 +02:00
Christian König
f18fd255cf radeonsi: fix dummy export in shaders v2
v2: add assertion for vertex shader

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:34 +02:00
Christian König
b15e3ae5b4 radeonsi: fix vertex buffer and elements
Let's just use the T# descriptors until we get a fetch shader.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:45:32 +02:00
Christian König
d51b9b70d5 radeonsi: fix shader size and handling
We should always upload the shader here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:45:08 +02:00
Christian König
fe41287ffa radeonsi: rename r600_resource to si_resource
Also split it into seperate header and add
some helper functions.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:44:38 +02:00
Kenneth Graunke
dcf8754cce glcpp: Add a newline to expanded #line directives.
Otherwise, the preprocessor happily outputs

    #line 2 4 <your next line of code>

and the main compiler gets horribly confused and fails to compile.

This is not the right solution (line numbers in error messages will
likely be off-by-one in certain circumstances), but until Carl comes
up with a proper fix, this gets programs running again.

Fixes regressions in Regnum Online, Overgrowth, Piglit, and others since
commit aac78ce823.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51802
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-28 13:33:50 -07:00
Christoph Bumiller
5d5af7d359 gallium: specify resource_resolve destination via a pipe_surface
The format member of pipe_surface may differ from that of the
pipe_resource, which is used to communicate, for instance, whether
sRGB encode should be enabled in the resolve operation or not.

Fixes resolve to sRGB surfaces in mesa/st when GL_FRAMEBUFFER_SRGB
is disabled.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-28 14:58:18 +02:00
Christoph Bumiller
51e41a0d89 st/mesa: call update_renderbuffer_surface for sRGB renderbuffers, too
sRGBEnabled should affect both textures and renderbuffers, so we need
to check/update the pipe_surface format for both.

Fixes, for instance, rendering appearing too bright in wine applications
using sRGB multisample renderbuffers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-28 13:14:30 +02:00
Christoph Bumiller
acd66ec033 nv50: fix depth/stencil multisample memory storage types
Leftover from libdrm_nouveau v2 interface change.
2012-07-28 13:14:03 +02:00
Christoph Bumiller
cd3d85b63d nv50: fix resource_resolve shader start offsets 2012-07-28 13:11:56 +02:00
Brian Paul
f612e55e45 st/mesa: undo a couple static asserts
Hmm, gcc didn't catch these mistakes, but MSVC did.
2012-07-27 16:10:58 -06:00
Brian Paul
322a2938f3 st/mesa: use STATIC_ASSERT in a few places 2012-07-27 15:47:38 -06:00
Brian Paul
59c67f8116 mesa: whitespace, etc. fixes in program.h 2012-07-27 15:43:53 -06:00
Brian Paul
906febaf8b meta: fix glDrawPixels fallback test, stencil drawing
Remove the check for pixel transfer ops.  If any RGB/depth scale/bias
is in effect, it'll be applied in the glTexImage step.

If drawing stencil pixels we need to disable pixel transfer so that
alpha scale/bias are not applied to the stencil data.

These issues were spotted by Roland.

Fixes Blender performance issues reported in
http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-27 14:53:16 -06:00
Brian Paul
a80b7407f3 radeon: fix 'sowftware' typo 2012-07-27 14:53:16 -06:00
Eric Anholt
fbf86c7f0f i965/gen7: Reduce GT1 WM thread count according to updated BSpec.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>

https://bugs.freedesktop.org/show_bug.cgi?id=52382
2012-07-27 11:42:19 -07:00
Kenneth Graunke
cbcf750d5f i965: Fix typo in shader channel select field name.
"chanel" isn't very searchable.  I can type, honest!

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-27 11:31:07 -07:00
Paul Berry
ee9f6a34cc i965/msaa: Use MESA_FORMAT_R8 for MCS buffer.
No functional change.  This patch modifies intel_miptree_alloc_mcs to
allocate the 4x MCS buffer using MESA_FORMAT_R8 instead of
MESA_FORMAT_A8.  In principle it doesn't matter, since we only access
the buffer using MCS-specific hardware mechanisms, so all that's
important is to use a format with the correct size.  However,
MESA_FORMAT_A8 has enough unusual behaviours that it seems prudent to
avoid it.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-27 10:42:19 -07:00
Zou Nan hai
588881430a intel: increase wm thread number to 80 on gen6 GT2
It seems reset is not required for setting the max_wm_threads to 80
on gen6 GT2.

Increases performance in the Counter-Strike: Source video stress test
by 7.18% (n=5).

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-07-27 10:32:17 -07:00
Tom Stellard
fdd8df20e4 r600g: Emit dispatch state for compute directly to the cs
We no longer rely on an evergreen_compute_resource for emitting dispatch
state.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
dc0b8a4628 r600g: Initialize VGT_PRIMITIVE_TYPE in the start_cs_cmd atom
The value of this register will always be DI_PT_POINTLIST for compute
shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
d3b0130491 r600g: Atomize compute shader state
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
5497391067 r600g: Add helper functions for emitting compute SET_CONTEXT packets
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
c9ef27276f radeon/llvm: Add instruction defs for branches on SI 2012-07-27 17:08:09 +00:00
Tom Stellard
ee0f0f03c6 radeon/llvm: Fix VOPC and V_CNDMASK encoding 2012-07-27 17:08:09 +00:00
Tom Stellard
d4bdd09d47 radeon/llvm: Assert if we try to copy SCC reg 2012-07-27 17:08:09 +00:00
Tom Stellard
fd1f19a191 radeon/llvm: Add SI DAG optimizations for setcc, select_cc
These are needed for correctly lowering branch instructions in some
cases.
2012-07-27 17:08:08 +00:00
Tom Stellard
cd5d4c5073 radeon/llvm: Add support for encoding SI branch instructions 2012-07-27 17:08:08 +00:00
Tom Stellard
50ff2dc0a4 radeon/llvm: Add special nodes for SALU operations on VCC
The VCC register is tricky because the SALU views it as 64-bit, but the
VALU views it as 1-bit.  In order to deal with this we've added some
special bitcast and binary operations to help convert from the 64-bit
SALU view to the 1-bit VALU view and vice versa.
2012-07-27 17:08:08 +00:00
Tom Stellard
c424975572 radeon/llvm: Add i1 registers for SI. 2012-07-27 17:08:08 +00:00
Tom Stellard
bdda1cb914 radeon/llvm: Fix CCReg definitions on SI 2012-07-27 17:08:08 +00:00
Tom Stellard
ae9be358f2 radeonsi: Enable PIPE_SHADER_CAP_INTEGERS 2012-07-27 17:08:08 +00:00
Tom Stellard
022b54359a radeonsi: Add support for loading integers from constant memory 2012-07-27 17:08:07 +00:00
Tom Stellard
ad95bcb31f radeon/llvm: Add bitconvert patterns for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
4cab682184 radeon/llvm: Add custom lowering for SELECT_CC nodes on SI 2012-07-27 17:08:07 +00:00
Tom Stellard
ba76684292 radeon/llvm: Move conditional pattern leafs to common tablegen file 2012-07-27 17:08:07 +00:00
Tom Stellard
d36455ba2c radeon/llvm: Implement getSetCCResultType for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
e8825ce6e1 radeon/llvm: Custom lower BR_CC for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
87272e9e25 radeon/llvm: Move lowering of BR_CC node to R600ISelLowering
SI will handle BR_CC different from R600, so we need to move it
out of the shared instruction selector.
2012-07-27 17:08:07 +00:00
Tom Stellard
92823fb72a radeon/llvm: Move lowering of SETCC node to R600ISelLowering
SI will handle SETCC different from R600, so we need to move it
out of the shared instruction selector.
2012-07-27 17:08:06 +00:00
Tom Stellard
46d12c99a2 radeon/llvm: Use correct node type when lowering SETCC 2012-07-27 17:08:06 +00:00
Tom Stellard
47d1b0a809 radeon/llvm: Move LowerSELECT_CC into R600ISelLowering
SI will handle SELECT_CC different from R600, so we need to move it out
of the shared instruction selector.
2012-07-27 17:08:06 +00:00
Eric Anholt
11ff18fcf5 automake: Remove OPT_FLAGS.
If you want to change your compiler arguments, just set CFLAGS/CXXFLAGS.
Having Mesa have this separate variable is a great way to have your arguments
not thoroughly propagated to all compiler invocations.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 17:30:06 -07:00
Eric Anholt
87a1c4f233 automake: Remove ARCH_FLAGS.
In all current uses, it was appended to CFLAGS, which already had -m32.  If
you want to do some other flag supplied to compiler invocations, there's
CFLAGS/CXXFLAGS.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 17:30:06 -07:00
Paul Berry
4df2848786 i965/msaa: use ROUND_DOWN_TO macro.
No functional change.  This patch modifies brw_blorp_blit.cpp to use
the ROUND_DOWN_TO macro instead of open-coded bit manipulations, for
clarity.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 15:02:10 -07:00
Brian Paul
f37f1a7209 svga: initialize svga_compile_key to zeros to be safe 2012-07-26 16:00:31 -06:00
Brian Paul
dafa77201f svga: fix invalid memory reference in needs_to_create_zero()
The emit->key.fkey info is only valid if we're generating a fragment shader.
We should not look at it if we're generating a vertex shader.

When generating a vertex shader, the value of emit->key.fkey.num_textures was
garbage and the loop over num_textures would read invalid data.  At best
this would cause us to emit an unused constant.  At worse, we could segfault.
Just by dumb luck, fkey.num_textures was usually a smallish integer.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-26 16:00:31 -06:00
Brian Paul
38184dcd54 radeon: fix Base/base typo
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52563
2012-07-26 15:57:20 -06:00
Daniel Charles
948c8f502a android-build: fix dricore build for autogenerated files (v3)
Recently more files were removed from control to be auto-generated
in the dricore library. Android build was not able to locate the
new files if they were not created beforehand.

LOCAL_SRC_FILES includes some of those files and Android.gen.mk
re-defines this variable by filtering out the auto-generated files.
Unfortunately for this variable it is not the same to have the SRCDIR
variable defined as the current directory.

By re-defining SRCDIR for the autotools build the Android build system
is happy again and the new files were actually removed from the sources
to use the auto generated versions.

Also patch d5c1801a01 was partially reverted as the files
can not be compiled to the LOCAL_PATH, instead they should live on the
intermediates folder so that a clean can wipe them out.

v3: [chad] Fix the definition of SRCDIR in libdricore/Makefile.am.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
2012-07-26 14:51:20 -07:00
Brian Paul
0e893b4261 radeon: set swrast_renderbuffer::ColorType field when mapping renderbuffers
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
2012-07-26 13:59:44 -06:00
Brian Paul
a73e9207da xlib: add X error handler around XGetImage() call
XGetImage() will generate a BadMatch error if the source window isn't
visible.  When that happens, create a new XImage.  Fixes piglit 'select'
test failures with swrast/xlib driver.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-26 13:59:44 -06:00
Brian Paul
66adc807c4 mesa: remove obsolete matrix comment 2012-07-26 13:59:44 -06:00
Brian Paul
1e37d54d9d mesa: fix comment typo: s/pointer/point/ 2012-07-26 13:59:44 -06:00
Brian Paul
66d9ac5ac7 mesa: remove _math_matrix_alloc_inv()
Always allocate space for the inverse matrix in _math_matrix_ctr()
since we were always calling _math_matrix_alloc_inv() anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 13:59:44 -06:00
Brian Paul
50db812915 mesa: loosen small matrix determinant check
When computing a matrix inverse, if the determinant is too small we could hit
a divide by zero.  There's a check to prevent this (we basically give up on
computing the inverse and return the identity matrix.)  This patch loosens
this test to fix a lighting bug reported by Lars Henning Wendt.

v2: use abs(det) to handle negative values

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Lars Henning Wendt <lars.henning.wendt@gris.tu-darmstadt.de>
2012-07-26 13:59:43 -06:00
Paul Berry
148c8e639d i965: Use sendc for all render target writes on Gen6+.
The sendc instruction causes the fragment shader thread to wait for
any dependent threads (i.e. threads rendering to overlapping pixels)
to complete before sending the message.  We need to use sendc on the
first render target write in order to guarantee that fragment shader
outputs are written to the render target in the correct order.

Previously, we only used the "sendc" instruction when writing to
binding table index 0.  This did the right thing for fragment shaders,
because our fragment shader back-ends always issue their first render
target write to binding table index 0.  However, it did the wrong
thing for blorp, which performs its render target writes to binding
table index 1.

A more robust solution is to use sendc for all render target writes.
This should not produce any performance penalty, since after the first
sendc, all of the dependent threads will have completed.

For more information about sendc, see the Ivy Bridge PRM, Vol4 Part3
p218 (sendc - Conditional Send Message), and p54 (TDR Registers).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-26 10:49:38 -07:00
Paul Berry
8f37ea414f i965/msaa: Remove TODO comments that are no longer relevant.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:49:38 -07:00
Paul Berry
c738ea1191 intel: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero.  This converts
everything in the i915 and 965 drivers over to use _mesa_is_user_fbo()
and _mesa_is_winsys_fbo().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:48:36 -07:00
Paul Berry
284ad9c3b2 mesa: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero.  This converts
everything in core mesa, the state tracker, and src/mesa/program over
to use _mesa_is_user_fbo() and _mesa_is_winsys_fbo().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:38:05 -07:00
Oliver McFadden
e72f20641a glsl: warning: pragma `invariant(all)' not supported in GLSL ES 1.00
The OpenGL(R) ES Shading Language
Version 1.00 Revision 17 (12 May, 2009)

> 4.6.1 The Invariant Qualifier
> ... To force all output variables to be invariant, use the pragma
> #pragma STDGL invariant(all)

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-26 13:09:15 +03:00
Kenneth Graunke
16cba717c2 shared-glapi: Install libglapi.so.0.0.0 and .0 links in lib/.
We already provided these files on 'make install', but only created a
'libglapi.so' in the top-level lib/ convenience folder.  We used to
create all three, but at some point in the build system churn, it broke.

Various applications (like the ES2 conformance suite) seem to link
against libglapi.so.0, so without these links, setting LD_LIBRARY_PATH
and LIBGL_DRIVERS_PATH can lead to using /usr/lib/libglapi.so.0 with
/home/whatever/libGL.so, which leads to API calls getting routed
incorrectly (i.e. glCompileShader -> _mesa_LinkProgramARB), which leads
to rage problems.

Preserve developer sanity...install links.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-25 22:37:24 -07:00
Vinson Lee
4f109ca4e8 scons: Fix build with clang.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-25 17:04:30 -07:00
Eric Anholt
cc44aa7749 i965: Remove unused param conversion code.
Ever since ctx->NativeIntegers was set, the conversion flag has been
PARAM_NO_CONVERT.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-25 10:29:56 -07:00
Olivier Galibert
fa76d04aea softpipe: fix copy/paste error in tex sample code
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=52369

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-25 07:47:19 -06:00
Jon TURNEY
f9089f4022 Remove redundant osmesa shared library install from Makefile.old
Since osmesa now has been converted to Makefile.am, an appropriate install: rule
is generated to install the shared libary, so we no longer need to do that in
src/mesa/Makefile.old

This leaves nothing in src/mesa/Makefile.old but the tags: rule, so move that to
Makefile.am and remove Makefile.old

Also, nothing now uses OSMESA_LIB_GLOB anymore, so remove it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:41:07 +01:00
Jon TURNEY
bd4a3cce96 Update mesa/drivers/x11/Makefile.am for xm_image.h removal
Commit 6c6803f28d removed xm_image.[ch], and removed
xm_image.c, but not xm_image.h from the Makefile, this was subsequently carried over
into Makefile.am

Remove xm_image.h from Makfile.am.  This allows 'make dist' to succeed, even if it
doesn't do anything useful

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:40:10 +01:00
Jon TURNEY
9f84d645a4 drivers/osmesa: Link OSMesa using -no-undefined libtool flag
"Use -no-undefined to assure libtool that the library has no
unresolved symbols at link time, so that libtool will build a shared
library on platforms require that all symbols are resolved when the
library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:39:42 +01:00
Jon TURNEY
50b13217ba drivers/X11: Link X11 libGL with -no-undefined libtool flag
"Use -no-undefined to assure libtool that the library has no
unresolved symbols at link time, so that libtool will build a shared
library on platforms require that all symbols are resolved when the
library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:38:38 +01:00
Vinson Lee
491d82e9df Revert "scons: Add instrumentation component libraries to linking on llvm-3.2."
This reverts commit e2e7b467d8.

No longer needed after llvm-3.2svn r160611.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-07-24 22:49:49 -07:00
Paul Berry
497bf5dd2b i965/msaa: Switch on 8x MSAA for Gen7.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:59 -07:00
Paul Berry
7285612713 i965/msaa: Adjust MCS buffer allocation for 8x MSAA.
MCS buffers use 32 bits per pixel in 8x MSAA, and 8 bits per pixel in
4x MSAA.  This patch adjusts the format we use to allocate the buffer
so that enough memory is set aside for 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
304be9db14 i965/msaa: Remove assertion in 3DSTATE_SAMPLE_MASK to allow 8x MSAA.
The code to emit 3DSTATE_SAMPLE_MASK was already correct for 8x
MSAA--this patch just removes an assertion that would have prevented
it from being used for 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
2a9ab29ed9 i965/msaa: Adjust 3DSTATE_MULTISAMPLE packet for 8x MSAA.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
7fae97c98b i965/blorp: Encode and decode IMS format for 8x MSAA correctly.
This patch updates the blorp functions encode_msaa() and decode_msaa()
to properly handle the encoding of IMS MSAA buffers when
num_samples=8.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
619471dc32 i965/blorp: Compute sample number correctly for 8x MSAA.
When operating in persample dispatch mode, the blorp engine would
previously assume that subspan N always represented sample N (this is
correct assuming 4x MSAA and a 16-wide dispatch).  In order to support
8x MSAA, we must compute which sample is associated with each subspan,
using the "Starting Sample Pair Index" field in the thread payload.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
082874e389 i965/blorp: Properly adjust primitive size for 8x MSAA.
When rendering to an IMS MSAA surface on Gen7, blorp sets up the
rendering pipeline as though it were rendering to a single-sampled
surface; accordingly it must adjust the size of the primitive it sends
down the pipeline to account for the interleaving of samples in an IMS
surface.

This patch modifies the size adjustment code to properly handle 8x
MSAA, which makes room for the extra samples by using an interleaving
pattern that is twice as wide as 4x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
17eae9762c i965/blorp: Parameterize manual_blend() by num_samples.
This patch adds a num_samples argument to the blorp function
manual_blend(), allowing it to be told how many samples need to be
blended together.  Previously it assumed 4x MSAA, since that was all
we supported.

We also bump up LOG2_MAX_BLEND_SAMPLES from 2 to 3, so that
manual_blend() will be able to handle 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
4afee38a2f i965/msaa: Remove comment about falsely claiming to support MSAA.
Gen6+ hardware now supports MSAA properly.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:58 -07:00
Paul Berry
ff9313fac7 i965/blorp: Handle DrawBuffers properly.
When the client program uses glDrawBuffer() or glDrawBuffers() to
select more than one color buffer for drawing into, and then performs
a blit, we need to blit into every single enabled draw buffer.

+2 oglconforms.

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

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
fa1d267beb i965/blorp: Rearrange order of blit validation and preparation steps.
This patch rearranges the order of steps performed by a blorp blit
from this:

- Sync up state of window system buffers.
- Find buffers.
- Find miptrees.
- Make sure buffer formats match.
- Handle mirroring.
- Make sure width and height match.
- Handle clipping/scissoring.
- Account for window system origin conventions.
- Do depth resolves, if applicable.
- Do the blit.
- Record the need for a future HiZ resolve, if applicable.

To this:

- Sync up state of window system buffers.
- Handle mirroring.
- Make sure width and height match.
- Handle clipping/scissoring.
- Account for window system origin conventions.
- Find buffers.
- Make sure buffer formats match.
- Find miptrees.
- Do depth resolves, if applicable.
- Do the blit.
- Record the need for a future HiZ resolve, if applicable.

The steps are the same, but they are now performed in an order that
will make it possible to implement correct DrawBuffers support.  Note
that the last four steps are now in a separate function
(do_blorp_blit), since they will need to be executed repeatedly when
DrawBuffers support is added.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
eac4f1a707 i965/blorp: Don't fall back to swrast when miptrees absent.
Previously, the blorp engine would fall back to swrast if the source
or destination of a blit had no associated miptree.  This was
unnecessary, since _mesa_BlitFramebufferEXT() already takes care of
making the blit silently succeed if there are no buffers bound, so the
fallback paths could never actually happen in practice.

Removing these fallback paths will simplify the implementation of
correct DrawBuffers support in blorp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
0dbec6ae07 i965/blorp: Fixup scissoring of blits to window system buffers.
This patch modifies the order of operations in the blorp engine so
that clipping and scissoring are performed before adjusting the
coordinates to account for the difference in origin convention between
window system buffers and framebuffer objects.  Previously, we would
do clipping and scissoring after adjusting for origin conventions, so
we would get scissoring wrong in window system buffers.

Fixes Piglit test "fbo-scissor-blit window".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
da54d2e576 i965/blorp: Simplify check that src/dst width/height match.
When checking that the source and destination dimensions match, we
don't need to store the width and height in variables; doing so just
risks confusion since right after the check, we do clipping and
scissoring, which may alter the width and height.

No functional change.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
bac43b8bb7 i965/msaa: Work around problems with null render targets on Gen6.
On Gen6, multisampled null render targets don't seem to work
properly--they cause the GPU to hang.  So, as a workaround, we render
into a dummy color buffer.

Fortunately this situation (multisampled rendering without a color
buffer) is rare, and we don't have to waste too much memory, because
we can give the workaround buffer a very small pitch.

Fixes piglit test "EXT_framebuffer_multisample/no-color {2,4}
depth-computed *" on Gen6.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
0aeb87023e i965: Set width, height, and tiling properly for null render targets.
The HW docs say that the width and height of null render targets need
to match the width and height of the corresponding depth and/or
stencil buffers, and that they need to be marked as Y-tiled.  Although
leaving these values at 0 doesn't seem to cause any ill effects, it
seems wise to follow the documented requirements.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
691c55f356 i965/msaa: Control multisampling behaviour via the visual.
Previously, we used the number of samples in draw buffer 0 to
determine whether to set up the 3D pipeline for multisampling.  Using
the visual is cleaner, and has the benefit of working properly when
there is no color buffer.

Fixes all piglit tests "EXT_framebuffer_multisample/no-color" on Gen7.
On Gen6, the "depth-computed" variants of these tests still fail; this
will be addresed in a later patch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
48fdfbcb58 msaa: Compute visual samples/sampleBuffers from all buffers.
This patch ensures that Visual.samples and Visual.sampleBuffers are
set correctly even in the case where there is no color buffer.
Previously, these values would retain their default value of 0 in this
circumstance, even if the depth or stencil buffer was multisampled.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:56 -07:00
Anthony G. Basile
f35e380dd2 Fix compile time errors when building against uclibc
Mesa misses a few checks when compiling on a uclibc system
which cause it to fall back on glibc-ism.  This patch
addresses those issues.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-07-24 13:00:47 -07:00
Jerome Glisse
1ffac44e83 r600g: enable streamout only on 2.14 or latter kernel
The kernel streamout support was supposed to get into 3.3 along
the tiling change and thus use the same kernel version bump of
2.13 to report userspace that streamout register were supported.

This is not what happen. So as streamout kernel support did not
bump the kernel driver version, rely on kernel 2.14 version bump
to know if streamout is enabled or not. Which means you need at
least 3.4 kernel.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-24 15:08:31 -04:00
Jordan Justen
881bb4ac72 intel: move error on create context to proper path
The error was being set on the non-error path, rather
than the error path.

NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-24 11:59:19 -07:00
Jordan Justen
01168df4d9 mesa context: generate an error for uninstalled context functions
For 'non-legacy' contexts we will want to generate an error
if an uninstalled function is called.

The effect of this change will be that we can avoid installing
legacy functions, and they will then generate an error as
needed for deprecated functions in GL >= 3.1.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-24 11:50:35 -07:00
Brian Paul
1f9239ec8d nouveau: include glformats.h to get missing prototype
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52449
2012-07-24 10:33:20 -06:00
Brian Paul
a271a0c9f6 mesa: improve comment in build_tnl_program() 2012-07-24 09:54:50 -06:00
Brian Paul
8f2a13c5e3 docs: the legacy makefile system is removed in Mesa 8.1 2012-07-24 08:49:02 -06:00
Brian Paul
7e18a039ee mesa: move _mesa_error_check_format_and_type() to glformats.c
Now all the format/type-related helper functions are in glformats.c
and image.c is just image-related functions.
2012-07-24 08:37:29 -06:00
Brian Paul
a1287f549a mesa: move more format helper functions to glformats.c 2012-07-24 08:37:29 -06:00
Brian Paul
8b762ebd72 mesa: move some format helper functions to glformats.c 2012-07-24 08:37:29 -06:00
Christian König
de3335dba8 radeonsi: remove old state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
9b213c871a radeonsi: move everything else into the new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
53d47889e6 radeonsi: move format handling into si_state.c
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
73dd906ba0 radeonsi: move remaining sampler state into si_state.c
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
ca9cf611b6 radeonsi: move draw state into new handling
Split it out into si_state_draw.c

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
0d6b0b512a radeonsi: move constants to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
baf2039756 radeonsi: move sampler states into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
3c09f11e5c radeonsi: move shaders to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
bd2a5cf328 radeonsi: move spi into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
840f05da6b radeonsi: move init state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
e4e6f954ae radeonsi: move draw_info to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
76660dfcce radeonsi: move CB_TARGET_MASK into fb/blend state
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
e6937211da radeonsi: move stencil_ref to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
b41b3eb989 radeonsi: move dsa state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
bd18a316e1 radeonsi: move infeered fb/rs state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
f67fae0e43 radeonsi: move rasterizer state into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
835098a529 radeonsi: move framebuffer to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
7e011d92c9 radeonsi: move viewport to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
43f414f7b7 radeonsi: move scissor state to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
9cbbe0d4e6 radeonsi: move clip state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
0a091a4824 radeonsi: move blend color to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
63636ae52a radeonsi: move blender to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
bf7302a6e1 radeonsi: rework state handling v2
Add a complete new state handling for SI.

v2: fix spelling error

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Brad King
27382c0f7b automake: Honor GL_LIB for mangled/custom lib names
Commit 2d4b77c7 (automake: Convert src/mesa/drivers/x11/Makefile to
automake, 2012-06-12) dropped the old Makefile, which used GL_LIB, and
replaced it with a Makefile.am hard-coding the name "GL".  This broke
handling of --enable-mangling and --with-gl-lib-name options which
depend on GL_LIB to specify the GL library name.

Use "@GL_LIB@" in src/mesa/drivers/x11/Makefile.am to configure the
library name.  Also use this approach to simplify src/glx/Makefile.am
and drop the HAVE_MANGLED_GL conditional.  While at it, fix the
compatibility link we create in "lib" for the software-only driver to
use version GL_MAJOR instead of hard-coding "1".

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-07-23 22:34:13 -07:00
Marek Olšák
82fc813ca8 st/mesa: fix DDY opcode for FBOs
This fixes piglit/fbo-deriv.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
f40b5723f0 st/mesa: set the centroid qualifier in fragment shader inputs
This fixes some centroid tests in the EXT_framebuffer_multisample piglit group.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
162b3ad94d st/mesa: flush the glBitmap cache before changing framebuffer state
This fixes the piglit EXT_framebuffer_multisample/bitmap tests.

Note that we must not rely on ctx->DrawBuffer when flushing the cache, because
that's already updated with a new framebuffer. We want to draw into the old
framebuffer where glBitmap was called.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
07b9b3c37b st/mesa: set the correct window renderbuffer internal format
The multisample-resolve blit relies on this being correct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:52 +02:00
Marek Olšák
5927227576 mesa: fix format checking when doing a multisample resolve
v2: make it more bullet-proof

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:52 +02:00
José Fonseca
c30bf68946 gallivm: Prefer the standard JIT engine whenever possible.
Testing shows that the standard JIT engine retrofited with AVX support is quite
stable and as capable to handle AVX instructions as MC-JIT is.

And the old JIT is much more memory efficient, as we don't need to
allocate one engine instance per shader, as we do for MC-JIT due to its
incompleteness.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-23 17:46:38 +01:00
Jerome Glisse
cb149bf9e1 r600g: don't emit forbidden reg with old kernel on evergreen
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52313

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-23 11:42:36 -04:00
Jerome Glisse
b7b5a77ec0 r600g: don't emit forbidden register on old kernel
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52313

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-23 11:28:25 -04:00
Vincent Lejeune
bc4b4c605c radeon/llvm: Fix a bug with IF LOGICALNZ with int operand
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-23 15:04:36 +00:00
Tom Stellard
044de40cb0 pipe_loader: Try to connect with the X server before probing pciids v2
When X is running it is neccesary for pipe_loader to authenticate with
DRM, in order to be able to use the device.

This makes it possible to run OpenCL programs while X is running.

v2:
  - Fix C++ style comments
  - Drop Xlib-xcb dependency
  - Close the X connection when done
  - Split auth code into separate function

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-07-23 13:25:36 +00:00
Tom Stellard
17f6c9195f configure.ac: Add --with-llvm-prefix option
This option allows you to specify the llvm install prefix.  It is
useful for switching between different versions of LLVM.
2012-07-23 13:25:36 +00:00
Kenneth Graunke
c3bc41011f mesa: Prevent repeated glDeleteShader() from blowing away our refcounts.
Calling glDeleteShader() should mark shaders as pending for deletion,
but shouldn't decrement the refcount every time.  Otherwise, repeated
glDeleteShader() is not safe.

This is particularly bad since glDeleteProgram() frees shaders: if you
first call glDeleteShader() on the shaders attached to the program (thus
decrementing the refcount), then called glDeleteProgram(), it would try
to free them again (decrementing the refcount another time), causing
a refcount > 0 assertion to fail.

Similar to commit d950a778.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-22 14:34:44 -07:00
Matt Turner
cfdf60f236 imports.h: Correct ceilf typo.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-22 14:06:08 -07:00
Marek Olšák
f96405f254 st/mesa: remove st_flush_bitmap wrapper
just a cleanup
2012-07-22 03:32:55 +02:00
Jordan Justen
749c9060ac mesa formats: add MESA_FORMAT_ABGR2101010_UINT
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
1c8812c244 mesa formats: unpack ARGB8888/XRGB8888
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
8c265cf5ef mesa pack: use _mesa_problem instead of assert
If the pack type is not supported, use _mesa_problem
rather than asserting.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
9ad8f431b2 mesa: add glformats integer type/format detection routines
_mesa_is_integer_format is moved to formats.c and renamed
as _mesa_is_enum_format_integer.

_mesa_is_format_unsigned, _mesa_is_type_integer,
_mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer
are added.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Vinson Lee
e2e7b467d8 scons: Add instrumentation component libraries to linking on llvm-3.2.
llvm-3.2svn r160587 moved createBoundsCheckingPass from
lib/Transforms/Scalar to lib/Transforms/Instrumentation.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-21 10:38:25 -07:00
Matt Turner
d24cf88a1a Remove unused _mesa_memset16
Unused since commit fd104a845.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
f58ba6ca91 Remove _mesa_inv_sqrtf in favor of 1/SQRTF
Except for a couple of explicit uses, _mesa_inv_sqrtf was disabled since
its addition in 2003 (see f9b1e524).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
948b1c541f Remove _mesa_sqrt* in favor of plain sqrt
Temporarily disabled since 2003 (see 386578c5b).

This saves us from calling sqrt() 128 times to generate the sqrttab in
one_time_init().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
ec79138138 Use INV_SQRT instead of 1/SQRTF
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
José Fonseca
bd9bf7a424 autoconf: Only kink mcjit component when available.
Should fix build failures with older LLVM version, but only tested on
LLVM 3.1.
2012-07-21 11:43:35 +01:00
Chad Versace
735070c45b i830: Fix stack corruption
Found by compiler warning:
    i830_texstate.c:131:28: warning: argument to 'sizeof' in 'memset' call
          is the same expression as the destination; did you mean to
          dereference it?  [-Wsizeof-pointer-memaccess]
       memset(state, 0, sizeof(state));
              ~~~~~            ^~~~~

On 64-bit systems, memset here would write an extra 4 bytes.

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-20 16:01:57 -07:00
José Fonseca
1a8f6ac5a4 mesa: disable MSVC global optimization in pack.c
To reduce excessive compilation time in release mode.

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Brian Paul <brianp@vmware.com>
2012-07-20 16:23:22 -06:00
Brian Paul
9fd4e9e9e6 mesa: whitespace fixes in pbo.c 2012-07-20 16:22:59 -06:00
Brian Paul
ac14f569fe mesa: update texstore.c comment 2012-07-20 15:13:19 -06:00
Roland Scheidegger
70a969f123 llvmpipe: use runtime loop instead of static loop for looping over quads
This can potentially cut shader program size by a factor of 4 for 4-wide
execution respectively 2 for 8-wide execution and while this ratios aren't
quite reached for more complex shaders it can be close.
Could not really measure a performance difference so far except for trivial
shaders (glxgears).
There seems to be a fair amount of unnecessary move's generated especially
at the beginning it might be possible to optimize those away somehow.
Things aren't quite as clean, some additional stuff needs to be done for
keeping both paths working (though llvm might be able to optimize this away).
glxgears seems to lose about 5-10% of performance, looking at the generated
shaders this is actually less than I'd think it would be - both 4 and 8-wide
shaders, despite containing a loop actually have about 10% more instructions
in total, and will have roughly 50% more executed instructions (though mostly
cheap ones). Need to figure out how to reduce overhead...

v2: keep complex interpolation for 4-wide mode, adapt to interface changes.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-20 20:17:15 +01:00
Roy Spliet
542bd6941f nv30: Support negative offsets in indirect constant access.
Fixes piglit vp-address-01 amongst several others.

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Reviewed-by: Lucas Stach <dev@lynxeye.de>
Tested-by: Lucas Stach <dev@lynxeye.de>
2012-07-20 20:31:40 +02:00
Bryan Cain
248e6f0331 nv50/ir: set position before i instead of i->next in NV50LoweringPreSSA::visit
Fixes rendering glitches in Psychonauts such as Raz's eyes flickering white.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51962.
2012-07-20 20:30:07 +02:00
Eric Anholt
b2a44cde64 i965/gen7: Increase the WM threads to hardware limits.
This thread count is only supposed to be enabled when "WIZ Hashing Disable in
GT_MODE register enabled."  I've always been confused whether that means the
bit in the register should be 1 or 0.  For my IVB GT2's register 0x7008 value
of 0x0, this appears to work fine.

Improves l4d2 performance at 640x480 by 0.88 +/- 0.11% (n=88).  Improves
performance with rasterization at 1280x1024 by 1.45% +/- 0.36% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-20 11:05:39 -07:00
Eric Anholt
8ab5842a6d glsl: Assign locations for uniforms in UBOs using the std140 rules.
Fixes piglit layout-std140.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:44:04 -07:00
Eric Anholt
9feb403b0e glsl: Don't resize arrays in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:59 -07:00
Eric Anholt
0cea8a56b6 glsl: Don't dead-code eliminiate uniforms declared in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:52 -07:00
Eric Anholt
548bce4733 mesa: Implement the UBO-specific pnames of glGetActiveUniformsiv.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:50 -07:00
Eric Anholt
a74507dc94 glsl: Propagate uniform block information into gl_uniform_storage.
Now we can actually return information on uniforms in uniform blocks
in the new queries.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:47 -07:00
Eric Anholt
ddc88fbf51 mesa: Add implementation of glGetUniformBlockIndex().
Now that we finally have a list of uniform blocks in the linked shader
program, we can tell what their indices are.

Fixes piglit GL_ARB_uniform_buffer_object/getuniformblockindex.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:44 -07:00
Eric Anholt
093b20666d glsl: Set the uniform_block index for the linked shader variables.
At this point in the linking, we've totally lost track of the struct
gl_uniform_buffer that this pointed to in the original unlinked
shader, so we do a nasty n^2 walk to find it the new one based on the
variable name.

Note that these point into the shader's list of gl_uniform_buffers,
not the linked program's.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:42 -07:00
Eric Anholt
9f1a4a6340 mesa: Add support for glGetActiveUniformsiv on non-UBO pnames.
We'll need to propagate the UBO fields to the uniform storage records
before we can handle the other pnames.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:40 -07:00
Eric Anholt
acfbdfcbc8 mesa: Add support for glGetUniformIndices().
This is a single entrypoint that maps from a series of names to the
indices of those names within the active uniforms list.  Each index is
like glGetUniformLocation()'s return value, except that it doesn't
encode an array offset.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:35 -07:00
Eric Anholt
abcdbdf9cc mesa: Move the _mesa_uniform_merge_location_offset to glGetUniformLocation().
With the upcoming GL_ARB_uniform_buffer_object changes, the only
other caller that will want the cooked value is state_tracker.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:33 -07:00
Eric Anholt
f609cf782a glsl: Merge the lists of uniform blocks into the linked shader program.
This attempts error-checking, but the layout isn't done yet.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:28 -07:00
Eric Anholt
b3c093c79c glsl: Translate the AST for uniform blocks into some IR structures.
We're going to need this structure to cross-validate the uniform
blocks between shader stages, since unused ir_variables might get
dropped.  It's also the place we store the RowMajor qualifier, which
is not part of the GLSL type (since that would cause a bunch of type
equality checks to fail).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:19 -07:00
Eric Anholt
f7561e8ecd glsl: Turn UBO variable declarations into ir_variables and check qualifiers.
Fixes piglit layout-*-non-uniform and layout-*-within-block.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:12 -07:00
Lucas Stach
cdad337fec st/xorg: fix masked transformations
Someone tried to be clever and "optimized" add_vertex_data2() to just use
two points for the texture coordinates and then reuse individual
components. Sadly this is not how matrix multiplication works.

Fixes rendercheck -t tmcoords

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-20 18:47:54 +02:00
Paul Berry
60c3e69dbf i965/blorp: Use IMS layout when texturing from depth/stencil surfaces.
Previously, on Gen7, when texturing from a depth or stencil surface,
the blorp engine would configure the 3D pipeline as though the input
surface was non-multisampled, and perform the necessary coordinate
transformations in the fragment shader to account for the IMS layout.
This meant outputting a lot of extra fragment shader code, and it
raised some uncertainty about how to deal with very large surfaces.

This patch modifies blorp to configure the 3D pipeline properly for
IMS layout when reading from depth and stencil surfaces.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
0dd5e98aa5 i965/blorp: Loosen assertions in compute_msaa_layout_for_pipeline.
Previously, on Gen7, compute_msaa_layout_for_pipeline() would verify
that IMS layout is not used.  However, now that we configure
SURFACE_STATE correctly for IMS surfaces, IMS layout is available.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
989218b980 i965/blorp: Configure SURFACE_STATE correctly for IMS surfaces.
This patch modifies gen7_set_surface_num_multisamples() to set up the
SURFACE_STATE appropriately for texturing from IMS format MSAA
surfaces (which are only used on Gen7 for depth and stencil buffers).
Since the function now sets more than just the number of multisamples,
it's been renamed to gen7_set_surface_msaa().

This will make it possible to remove some kludginess from the blorp
engine.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
f91b4d92b9 i965/blorp: Optimize manual_blend() for compressed multisampled surfaces.
When downsampling a compressed multisampled surface, we can take a
shortcut to downsample any pixels that were completely covered by a
single primitive.  In this case, the first color value we fetch is the
correct final color for the downsampled pixel, so we can skip the rest
of the blending operation.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
e5d983267a i965/blorp: Fix integer downsampling on Gen7.
When downsampling an integer-format buffer on Gen7, we need to use the
"avg" instruction rather than the "add" instruction, to ensure that we
don't overflow the range of 32-bit integers.  Also, we need to use the
proper register type (BRW_REGISTER_TYPE_D or BRW_REGISTER_TYPE_UD) for
intermediate color data and for writing to the render target.

Note: this patch causes blorp to use the proper register type for all
operations (downsampling, upsampling, and ordinary blits).  Strictly
speaking, this is only necessary for downsampling, because the other
operations exclusively use MOV instructions on the color data.  But
it's simpler to use the proper register type in all cases.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
b961d37e61 i965/blorp: Modify manual_blend() to avoid unnecessary loss of precision.
When downsampling from an MSAA image to a single-sampled image, it is
inevitable that some loss of numerical precision will occur, since we
have to use 32-bit floating point registers to hold the intermediate
results while blending.  However, it seems reasonable to expect that
when all samples corresponding to a given pixel have the exact same
color value, there will be no loss of precision.

Previously, we averaged samples as follows:

    blend = (((sample[0] + sample[1]) + sample[2]) + sample[3]) / 4

This had the potential to lose numerical precision when all samples
have the same color value, since ((sample[0] + sample[1]) + sample[2])
may not be precisely representable as a 32-bit float, even if the
individual samples are.

This patch changes the formula to:

    blend = ((sample[0] + sample[1]) + (sample[2] + sample[3])) / 4

This avoids any loss of precision in the event that all samples are
the same, by ensuring that each addition operation adds two equal
values.

As a side benefit, this puts the formula in the form we will need in
order to implement correct blending of integer formats.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
6a27506181 i965: Add support for AVG instruction.
From the Ivy Bridge PRM, Vol4 Part3 p152:

    "The avg instruction performs component-wise integer average of
    src0 and src1 and stores the results in dst. An integer average
    uses integer upward rounding. It is equivalent to increment one to
    the addition of src0 and src1 and then apply an arithmetic right
    shift to this intermediate value."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
9544e44262 i965: Replace fs_visitor::kill_emitted with gl_fragment_program::UsesKill.
The kill_emitted variable was duplicating the functionality of
gl_fragment_program::UsesKill.  There's no need for both.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20 09:33:07 -07:00
Paul Berry
0f1f2ff8db mesa: Set gl_fragment_program::UsesKill in do_set_program_inouts.
Previously, the code for setting this flag for GLSL programs was
duplicated in three places: brw_link_shader(), glsl_to_tgsi_visitor,
and ir_to_mesa_visitor.  In addition to the unnecessary duplication,
there was a performance problem on i965: brw_link_shader() set the
flag before doing its final round of optimizations, which meant that
if the optimizations managed to eliminate all the discard operations,
the flag would still be set, resulting (at least in theory) in slower
performance.

This patch consolidates all of the code that sets UsesKill for GLSL
programs into do_set_program_inouts(), which already is doing a
similar job for UsesDFdy, and which occurs after i965's final round of
optimizations.

Non-GLSL programs (ARB programs and the state tracker's glBitmap
program) are unaffected.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20 09:33:07 -07:00
Kristian Høgsberg
a8c092266e gallium-egl: Move wayland query_buffer implementation
Move it to native_wayland_drm_bufmgr_helper.c which only gets compiled when
wayland is enabled and which already includes the right headers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 16:11:06 -04:00
Olivier Galibert
fbe3fa74e5 softpipe: Fix segfault with fbo-cubemap.
The cube sampler generates two-dimensional texture coordinates and
hence passes NULL for the array for the third one.  The actual 2D
sampler, lower in the pipe, knew not to used that array since it
didn't need it.  But the samplers have become single-texel and the
coordinate array dereference has been moved up one step, to a level
where the code does not know only two coordinates are used.  Hence the
segfault.

The simplest fix by far is to add a third dummy coordinate array in
the call to the next pipe step, which will be dereferenced to an
harmless 0 which then will be happily ignored by the sampler.

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

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-19 13:19:14 -06:00
Kristian Høgsberg
d7522ed130 wayland: Support EGL_WIDTH and EGL_HEIGHT queries for wl_buffer
We're going to make the public wl_buffer struct as small as possible.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kristian Høgsberg
e23bfdb329 wayland: Use existing EGL_TEXTURE_FORMAT for querying wl_buffer texture format
We also reuse EGL_TEXTURE_RGBA and EGL_TEXTURE_RGB, adding only the new
planar YUV texture formats: EGL_TEXTURE_Y_U_V_WL, EGL_TEXTURE_Y_UV_WL and
EGL_TEXTURE_Y_XUXV_WL.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kristian Høgsberg
e1b45a3c06 gallium-egl: Implement eglQueryWaylandBufferWL
Support this query for gallium EGL too.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kenneth Graunke
d43f4181e1 glsl: Remove open coded version of ir_variable::interpolation_string().
Presumably the function didn't exist when we wrote this code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 11:00:00 -07:00
Paul Berry
d08fdacd58 i965: Avoid unnecessary recompiles for shaders that don't use dFdy().
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This patch avoids unnecessarily recompiling shaders that don't use
dFdy(), by only setting render_to_fbo in the wm program key if the
shader actually uses dFdy().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:25 -07:00
Paul Berry
ce1d2f08f9 glsl: Set UsesDFdy appropriately for GLSL shaders.
This patch updates the ir_set_program_inouts_visitor so that it also
sets gl_fragment_program::UsesDFdy.

This is a bit of a hack (since dFdy() isn't an input or an output),
but there's no other obvious visitor to squeeze this functionality
into, and it would be silly to create a brand new visitor just for
this purpose.

v2: use local 'fprog' var to avoid repeated casting.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:21 -07:00
Paul Berry
a0f7b86959 mesa: Set UsesDFdy appropriately for assembly programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:19 -07:00
Paul Berry
5e310e9f83 mesa: Add UsesDFdy to struct gl_fragment_program.
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This boolean will allow it to avoid unnecessarily recompiling shaders
that don't use dFdy().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:01 -07:00
Kenneth Graunke
658a63e5d9 drirc: Add disable_blend_func_extended workaround for Unigine OilRush.
The previous commit implemented the workaround, cited a bug report
about OilRush, but actually only enabled the workaround for the demos.

Turn it on for OilRush too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-19 01:40:24 -07:00
Kenneth Graunke
040894391a i965: Add a driconf option to disable GL_ARB_blend_func_extended.
Unigine Heaven (at least) has a bug where it incorrectly uses the
GL_ARB_blend_func_extended extension.

Dual source blending allows two color outputs per render target;
individual shader outputs can be assigned to be either the first or
second blending input by setting the 'index' via one of two methods:

- An API call: glBindFragDataLocationIndexed()
- The GLSL 'layout' qualifier provided by GL_ARB_explicit_attrib_location

Both of these only work on user defined fragment shader outputs; it's an
error to use either on built-in outputs like gl_FragData.

Unigine uses gl_FragData and gl_FragColor exclusively, and doesn't even
attempt to use either method to set index == 1.  However, it does set
the blending function to SRC1 enums, which requires a fragment shader
output with index == 1 or else rendering is undefined.

In other words, enabling ARB_blend_func_extended causes Unigine to
render incorrectly, resulting in an apparent regression, even though our
driver code (as far as I can tell) is perfectly fine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-19 01:22:34 -07:00
Brian Paul
768be75c44 mesa: remove stale comment 2012-07-18 16:51:47 -06:00
Brian Paul
e4f8d33aea mesa: use gl_program cast wrappers
In a few cases, remove unneeded casts.
And fix a few other const-correctness issues.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 16:51:47 -06:00
Brian Paul
1170b5aa9f mesa: add some gl_program cast wrappers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 16:51:47 -06:00
Marek Olšák
c3c83af380 r600g: setup streamout before calling last r600_need_cs_space before drawing
This fixes CS checker errors due to registers not being initialized, because
the flush occured after dirty state was emitted but before drawing.
2012-07-18 22:42:58 +02:00
Eric Anholt
a40c1f9522 i965/fs: Make register spill/unspill only do the regs for that instruction.
Previously, if we were spilling the result of a texture call, we would store
all 4 regs, then for each use of one of those regs as the source of an
instruction, we would unspill all 4 regs even though only one was needed.

In both lightsmark and l4d2 with my current graphics config, the shaders that
produce spilling do so on split GRFs, so this doesn't help them out.  However,
in a capture of the l4d2 shaders with a different snapshot and playing the
game instead of using a demo, it reduced one shader from 2817 instructions to
2179, due to choosing a now-cheaper texture result to spill instead of piles
of texcoords.

v2: Fix comment noted by Ken, and fix the if condition associated with it for
    the current state of what constitutes a partial write of the destination.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-07-18 12:30:06 -07:00
Eric Anholt
a454f8ec6d i965/fs.h: Refactor tests for instructions modifying a register.
There's one instance of a potential behavior change: propagate_constants may
now propagate into a part of a vgrf after a different part of it was
overwritten by a send that returns multiple registers.  I don't think we ever
generate IR that meets that condition, but it's something to note if we bisect
behavior change to this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
fc01376c50 i965/fs: Replace usage is_tex() with regs_written() checks.
In these places, we care about any sort of send that hits more than one reg,
not just textures.  We don't yet have anything else returning more than one
reg, so there's no change.

v2: Use mlen instead of is_tex() for the is-it-a-send check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
a6411520b4 i965/fs: Rename virtual_grf_next to virtual_grf_count.
"count" is a more useful name, since most of the time we're using it for
looping over the variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
40cd60a315 i965/fs: Move a block out of a loop in live variables setup.
This was accidentally copy-and-pasted inside.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Anuj Phogat
cd5cd85a43 i965/msaa: Disable alpha-to-{coverage, one} when drawbuffer zero is in integer format
OpenGL specification 3.3 (page 196), section 4.1.3 says:
If drawbuffer zero is not NONE and the buffer it references has an
integer format, the SAMPLE_ALPHA_TO_COVERAGE and SAMPLE_ALPHA_TO_ONE
operations are skipped."
This should work properly even if there are other draw buffers that
are not in integer format.

This patch makes following piglit tests pass on mesa:
int-draw-buffers-alpha-to-coverage
int-draw-buffers-alpha-to-one

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-18 11:54:12 -07:00
Lucas Stach
fb18ec4f27 st/xorg: attach EDID to outputs
Allows tools like GNOME's monitor configuration to show meaningful names.

v2: fix resource leak

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:19:16 +02:00
Lucas Stach
9de16ac0a8 st/xorg: remove superfluous memset
exaDriverAlloc() uses calloc, which already initialises pExa to zero.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:19:07 +02:00
Lucas Stach
70f0eda127 st/xorg: reorder exa context creation and use screen param queries
Gives the x-server a more accurate description of the exa hardware
capabilities.

v2: drop NPOT check

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:18:55 +02:00
Olivier Galibert
229a1a7e4d softpipe: Take all lods into account when texture sampling.
This patch churns a lot because it needs to change 4-wide filters into
single pixel filters, since each fragment may use a different filter.

The only case not entirely supported is the anisotropic filtering.
Not sure what we want to do there, since a full quad is required by
that filter.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-18 08:02:39 -06:00
Marek Olšák
99c65bac34 r600g: implement wait-free buffer transfer for DISCARD_RANGE
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-07-18 07:16:30 +02:00
Marek Olšák
8ac9801669 r600g: accelerate buffer copying
This will be useful for efficient handling of the DISCARD transfer flags.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-07-18 06:32:57 +02:00
Marek Olšák
f237fd431b r600g: update R600_MAX_DRAW_CS_DWORDS to take draw-opaque into account 2012-07-18 06:25:37 +02:00
Marek Olšák
30257c3291 r600g: move VGT_STRMOUT_DRAW_OPAQUE_OFFSET initialization into invariant state 2012-07-18 06:25:37 +02:00
Marek Olšák
d9ba1b0beb r600g: only set the index type if drawing is indexed 2012-07-18 06:25:37 +02:00
Marek Olšák
1cfb55c509 r600g: remove debug code for streamout 2012-07-18 06:25:37 +02:00
Marek Olšák
ff9a49328e r600g: inline r600_context_draw_opaque_count 2012-07-18 06:25:37 +02:00
Marek Olšák
1b699a4832 r600g: fix alphatest without a colorbuffer on evergreen 2012-07-18 06:25:36 +02:00
Marek Olšák
82a1d24175 r600g: fix alphatest without a colorbuffer on r6xx-r7xx 2012-07-18 04:35:38 +02:00
Marek Olšák
de4fd087cb r600g: always derive alphatest state from the first colorbuffer 2012-07-18 04:17:11 +02:00
Marek Olšák
bc2f5fc01e r600g: atomize alphatest state 2012-07-18 03:45:25 +02:00
Marek Olšák
5130196c0b r600g: try to fix line stippling with lineloops
The piglit test is failing, but visually it looks almost correct.
2012-07-18 02:17:10 +02:00
Marek Olšák
43e226b6ef r600g: optimize uploading depth textures
Make it only copy the portion of a depth texture being uploaded and
not the whole 2D layer.

There is also a little code cleanup.
2012-07-18 00:32:50 +02:00
Marek Olšák
b242adbe5c r600g: remove needless wrapper r600_texture_depth_flush 2012-07-18 00:21:53 +02:00
Marek Olšák
611dd52942 r600g: init_flushed_depth_texture should be able to report errors 2012-07-18 00:21:53 +02:00
Paul Berry
e9b908b014 msaa: Generate proper error for operations prohibited on MSAA buffers.
From the GL 3.0 spec, section 4.3.3, in the documentation for
CopyPixels():

    "An INVALID_OPERATION error will be generated if the object bound
    to READ_FRAMEBUFFER_BINDING is framebuffer complete and the value
    of SAMPLE_BUFFERS is greater than zero."

The same applies to CopyTexImage...() and CopyTexSubImage...()
functions, since they are defined in terms of CopyPixels().

Previously we were generating an INVALID_FRAMEBUFFER_OPERATION error
in these cases.

Fixes piglit tests
"EXT_framebuffer_multisample/negative-{copypixels,copyteximage}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 14:40:01 -07:00
Brian Paul
c4d2a14d6e gallivm: silence uninitialized variable warnings 2012-07-17 14:41:29 -06:00
Marek Olšák
9d699cd845 r600g: fix lockups with and enable dual source blending on evergreen
GL_ARB_blend_func_extended is now enabled on all chipsets.
2012-07-17 21:22:15 +02:00
Marek Olšák
c26fadf195 r600g: remove unused code after conversion of sampler views 2012-07-17 21:22:15 +02:00
Marek Olšák
5d8d4252f2 r600g: convert sampler view emission into atoms
Vertex and constant buffers are emitted in the same way.
This is mainly a simplification of the code. The cleanup is in another patch.
2012-07-17 21:22:15 +02:00
Marek Olšák
7022f49b52 r600g: only make constant buffers dirty if there's something to update 2012-07-17 21:22:15 +02:00
Marek Olšák
80755ff563 r600g: properly track which textures are depth
This fixes the issue with have_depth_texture never being set to false.
2012-07-17 21:22:15 +02:00
Marek Olšák
e5de73cafd r600g: consolidate and optimize sampler states changes for evergreen
Only set sampler states which changed.
2012-07-17 21:22:14 +02:00
Marek Olšák
883c43cdd4 r600g: don't invalidate texture caches when setting sampler states
Changing sampler states doesn't change resource bindings.
2012-07-17 21:22:14 +02:00
Marek Olšák
ba48f47ebf r600g: consolidate code for setting sampler views and fix bugs in the process
Issues fixed:

- set_vs_sampler_views for evergreen is now properly implemented.

- Added the missing inval_texture_cache call for evergreen.

- have_depth_texture was sometimes incorrectly set to false on evergreen even
  if there were depth textures in other shader stages. To fix this, set it
  to true once and never set it to false again. It's stupid, but it matches
  the r600 code. The proper fix is left to another patch.

- Optimizaton: The sampler views which aren't changed aren't updated.
2012-07-17 21:22:14 +02:00
Marek Olšák
d1ca16b273 r600g: remove unused flag have_depth_fb
This is a leftover from:

commit fe1fd67556
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 03:10:37 2012 +0200

    r600g: don't flush depth textures set as colorbuffers
2012-07-17 21:22:14 +02:00
Marek Olšák
585baac652 r600g: do fine-grained vertex buffer updates
If only some buffers are changed, the other ones don't have to re-emitted.
This uses bitmasks of enabled and dirty buffers just like
emit_constant_buffers does.
2012-07-17 21:22:14 +02:00
Marek Olšák
f4f2e8ebe1 r600g: don't call inval_shader_cache in r600_context_flush twice
It's already called in r600_constant_buffers_dirty.
2012-07-17 21:22:14 +02:00
Marek Olšák
6694a68d89 gallium/util: add util_bit_last - finds the last bit set in a word 2012-07-17 21:22:14 +02:00
Marek Olšák
018e3f75d6 r600g: fix all failing depth-stencil tests for evergreen 2012-07-17 21:22:14 +02:00
Michel Dänzer
761131ce45 configure.ac: Further LLVM fixups.
* Also add mcjit in the non-OpenCL case.
* Replace hardcoded llvm-config with $LLVM_CONFIG everywhere.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellad <thomas.stellard@amd.com>
2012-07-17 19:12:01 +02:00
Michel Dänzer
39c4bc7fdf glsl: Drop obsolete .gitignore entries.
Helps spotting and removing the obsolete generated files, which otherwise break
the build.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-07-17 18:30:32 +02:00
Tom Stellard
ed41a559dc configure.ac: Add libLLVMMCJIT to the LLVM_LDFLAGS
This is neccessary for linking the llvmpipe tests.  It appears this
dependency was introduced by the "wider native register" changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-07-17 12:08:24 -04:00
Eric Anholt
fadc9eaf97 intel: Add a comment explaining why we early return on matching BO names.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:08 -07:00
Eric Anholt
2b311fd802 intel: Drop other checks for old loader version.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:06 -07:00
Eric Anholt
1b4374d364 intel: Replace the non-getBuffersWithFormat compat path with an error message.
It's been broken (using NULL getBuffersWithFormat() instead of
getBuffers()) due to a copy and paste error for a year now.
GetBuffersWithFormat has been around since 2009, so I don't feel any
guilt in not supporting it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:04 -07:00
Eric Anholt
9bbf7c139b intel: Remove dead intel_framebuffer_has_hiz().
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:02 -07:00
Eric Anholt
bce58e155d intel: Convert to using private depth/stencil buffers (v2)
This means that GLX buffer sharing of these no longer works.  On the
other hand, just *look* at this code reduction.

v2:
  - [chad] Fix intelCreateBuffer for gen < 6. When the branch for
    !screen->hw_has_separate_stencil was taken,
    intel_create_private_renderbuffer was incorrectly not used.

  - [chad] Remove all code in intel_process_dri2_buffer for processing
    depth, stencil, and hiz buffers. That code is now dead.

CC: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:17:56 -07:00
Eric Anholt
433ff3e16e intel: Add a function for creating a private window system buffer.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:17:38 -07:00
Roland Scheidegger
bf484024b9 gallivm: (trivial) remove unnecessary bogus include 2012-07-17 17:11:18 +02:00
Kristian Høgsberg
2023bf996e gbm: Add gbm_bo_import for gallium gbm backend 2012-07-17 10:54:00 -04:00
Elvis Lee
1f2c87cc8f st/egl: Fix build for wayland includes
common/native_wayland_drm_bufmgr_helper.c fails to find wayland-server.h

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-17 10:54:00 -04:00
Elvis Lee
23f1e551cc st/gbm: renaming pitch to stride on gallium
commit '7250cd506baa0bd4649b30d87509cdd0cbc06a57'
changes struct gbm_bo, renaming it's 'pitch' to 'stride'.
This applies to Gallium.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-17 10:54:00 -04:00
Matt Turner
f42e601ce0 glx: build tests after libglx.la
Previously, if you ran make followed by make check it would work, but
if you just ran make check the test program would fail to compile.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-17 06:59:00 -07:00
José Fonseca
3469715a8a gallivm,draw,llvmpipe: Support wider native registers.
Squashed commit of the following:

commit 7acb7b4f60dc505af3dd00dcff744f80315d5b0e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:46:31 2012 +0100

    draw: Don't use dynamically sized arrays.

    Not supported by MSVC.

commit 5810c28c83647612cb372d1e763fd9d7780df3cb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:44:16 2012 +0100

    gallivm,llvmpipe: Don't use expressions with PIPE_ALIGN_VAR().

    MSVC doesn't accept exceptions in _declspec(align(...)). Use a
    define instead.

commit 8aafd1457ba572a02b289b3f3411e99a3c056072
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:41:56 2012 +0100

    gallium/util: Make u_cpu_detect.h header C++ safe.

commit 5795248350771f899cfbfc1a3a58f1835eb2671d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 2 12:08:01 2012 +0100

    gallium/util: Add ULL suffix to large constants.

    As suggested by Andy Furniss: it looks like some old gcc versions
    require it.

commit 4c66c22727eff92226544c7d43c4eb94de359e10
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 13:39:07 2012 +0100

    gallium/util: Truly disable INF/NAN tests on MSVC.

    Thanks to Brian for spotting this.

commit 8bce274c7fad578d7eb656d9a1413f5c0844c94e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 13:39:07 2012 +0100

    gallium/util: Disable INF/NAN tests on MSVC.

    Somehow they are not recognized as constants.

commit 6868649cff8d7fd2e2579c28d0b74ef6dd4f9716
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 5 15:05:24 2012 +0200

    gallivm: Cleanup the 2 x 8 float -> 16 ub special path in lp_build_conv.

    No behaviour change intended, like 7b98455fb40c2df84cfd3cdb1eb7650f67c8a751.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 5147a0949c4407e8bce9e41d9859314b4a9ccf77
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 5 14:28:19 2012 +0200

    gallivm: (trivial) fix issues with multiple-of-4 texture fetch

    Some formats can't handle non-multiple of 4 fetches I believe, but
    everything must support length 1 and multiples of 4.
    So avoid going to scalar fetch (which is very costly) just because length
    isn't 4.
    Also extend the hack to not use shift with variable count for yuv formats to
    arbitrary length (larger than 1) - doesn't matter how many elements we
    have we always want to avoid it unless we have variable shift count
    instruction (which we should get with avx2).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 87ebcb1bd71fa4c739451ec8ca89a7f29b168c08
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jul 4 02:09:55 2012 +0200

    gallivm: (trivial) fix typo for wrap repeat mode in linear filtering aos code

    This would lead to bogus coordinates at the edges.
    (undetected by piglit because this path is only taken for block-based
    formats).

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 3a42717101b1619874c8932a580c0b9e6896b557
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jul 3 19:42:49 2012 +0100

    gallivm: Fix TGSI integer translation with AVX.

commit d71ff104085c196b16426081098fb0bde128ce4f
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 15:17:41 2012 +0100

    llvmpipe: Fix LLVM JIT linear path.

    It was not working properly because it was looking at the JIT function
    before it was actually compiled.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit a94df0386213e1f5f9a6ed470c535f9688ec0a1b
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Jun 28 18:07:10 2012 +0100

    gallivm: Refactor lp_build_broadcast(_scalar) to share code.

    Doesn't really change the generated assembly, but produces more compact IR,
    and of course, makes code more consistent.

    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 66712ba2731fc029fa246d4fc477d61ab785edb5
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 27 17:30:13 2012 +0100

    gallivm: Make LLVMContextRef a singleton.

    There are any places inside LLVM that depend on it.  Too many to attempt
    to fix.

    Reviewed-by: Brian Paul <brianp@vmware.com>

commit ff5fb7897495ac263f0b069370fab701b70dccef
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 28 18:15:27 2012 +0200

    gallivm: don't use 8-wide texture fetch in aos path

    This appears to be a slight loss usually.
    There are probably several reasons for that:
    - fetching itself is scalar
    - filtering is pure int code hence needs splitting anyway, same
      for the final texel offset calculations
    - texture wrap related code, which can be done 8-wide, is slightly more
      complex with floats (with clamp_to_edge) and float operations generally
      more costly hence probably not much faster overall
    - the code needed to split when encountering different mip levels for the
      quads, adding complexity
    So, just split always for aos path (but leave it 8-wide for soa, since we
    do 8-wide filtering there when possible).
    This should certainly be revisited if we'd have avx2 support.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit ce8032b43dcd8e8d816cbab6428f54b0798f945d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 18:41:19 2012 +0200

    gallivm: (trivial) don't extract fparts variable if not needed

    Did not have any consequences but unnecessary.

commit aaa9aaed8f80dc282492f62aa583a7ee23a4c6d5
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 18:09:06 2012 +0200

    gallivm: fix precision issue in aos linear int wrap code

    now not just passes at a quick glance but also with piglit...
    If we do the wrapping with floats, we also need to set the
    weights accordingly. We can potentially end up with different
    (integer) coordinates than what the integer calculations would
    have chosen, which means the integer weights calculated previously
    in this case are completely wrong. Well at least that's what I think
    happens, at least recalculating the weights helps.
    (Some day really should refactor all the wrapping, so we do whatever is
    fastest independent of 16bit int aos or 32bit float soa filtering.)

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit fd6f18588ced7ac8e081892f3bab2916623ad7a2
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 27 11:15:53 2012 +0100

    gallium/util: Fix parsing of options with underscore.

    For example

      GALLIVM_DEBUG=no_brilinear

    which was being parsed as two options, "no" and "brilinear".

commit 09a8f809088178a03e49e409fa18f1ac89561837
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 26 15:00:14 2012 +0100

    gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.

    Updated lp_build_printf to share common code.
    Removed specific lp_build_print_vecX.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit e59bdcc2c075931bfba2a84967a5ecd1dedd6eb0
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed May 16 15:00:23 2012 +0100

    draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.

    Starting with LLVM 3.0, named structures are meant not for debugging, but
    for recursive data types, previously also known as opaque types.

    The recursive nature of these types leads to several memory management
    difficulties.  Given that we don't actually need recursive types, avoid
    them altogether.

    This is an attempt to address fdo bugs 41791 and 44466. The issue is
    somewhat random so there's no easy way to check how effective this is.

    Cherry-picked from 9af1ba565d

commit df6070f618a203c7a876d984c847cde4cbc26bdb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 14:42:53 2012 +0200

    gallivm: (trivial) fix typo in faster aos linear int wrap code

    no longer crashes, now REALLY tested.

commit d8f98dce452c867214e6782e86dc08562643c862
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 18:20:58 2012 +0200

    llvmpipe: (trivial) remove bogus optimization for float aos repeat wrap

    This optimization for nearest filtering on the linear path generated
    likely bogus results, and the int path didn't have any optimizations
    there since the only shader using force_nearest apparently uses
    clamp_to_edge not repeat wrap anyway.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit c4e271a0631087c795e756a5bb6b046043b5099d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 23:01:52 2012 +0200

    gallivm: faster repeat wrap for linear aos path too

    Even if we already have scaled integer coords, it's way faster to use
    the original float coord (plus some conversions) rather than use URem.
    The choice of what to do for texture wrapping is not really tied to int
    aos or float soa filtering though for some modes there can be some gains
    (because of easier weight calculations).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 1174a75b1806e92aee4264ffe0ffe7e70abbbfa3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 14:39:22 2012 +0200

    gallivm: improve npot tex wrap repeat in linear soa path

    URem gets translated into series of scalar divisions so
    just about anything else is faster.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit f849ffaa499ed96fa0efd3594fce255c7f22891b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 00:40:35 2012 +0100

    gallivm: (trivial) fix near-invisible shift-space typo

    I blame the keyboard.

commit 5298a0b19fe672aebeb70964c0797d5921b51cf0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 16:24:28 2012 +0200

    gallivm: add new intrinsic helper to deal with arbitrary vector length

    This helper will split vectors which are too large for the hw, or expand
    them if they are too small, so a caller of a function using intrinsics which
    uses such sizes need not split (or expand) the vectors manually and the
    function will still use the intrinsic instead of dropping back to generic
    llvm code. It can also accept scalars for use with pseudo-vector intrinsics
    (only useful for float arguments, all x86 scalar simd float intrinsics use
    4vf32).
    Only used for lp_build_min/max() for now (also added the scalar float case
    for these while there). (Other basic binary functions could use it easily,
    whereas functions with a different interface would need different helpers.)
    Expanding vectors isn't widely used, because we always try to use
    build contexts with native hw vector sizes. But it might (or not) be nicer
    if this wouldn't need to be done, the generated code should in theory stay
    the same (it does get hit by lp_build_rho though already since we
    didn't have a intrinsic for the scalar lp_build_max case before).

    v2: incorporated Brian's feedback, and also made the scalar min/max case work
        instead of crash (all scalar simd float intrinsics take 4vf32 as argument,
        probably the reason why it wasn't used before).
        Moved to lp_bld_intr based on José's request, and passing intrinsic size
        instead of length.
        Ideally we'd derive the source type info from the passed in llvm value refs
        and process some llvmtype return type so we could handle intrinsics where
        the source and destination type isn't the same (like float/int conversions,
        packing instructions) but that's a bit too complicated for now.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 01aa760b99ec0b2dc8ce57a43650e83f8c1becdf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 16:19:18 2012 +0200

    gallivm: (trivial) increase max code size for shader disassembly

    64kB was just short of what I needed (which caused a crash) hence
    increase to 96kB (should probably be smarter about that).

commit 74aa739138d981311ce13076388382b5e89c6562
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:53:29 2012 +0100

    gallivm: simplify aos float tex wrap repeat nearest

    just handle pot and npot the same. The previous pot handling
    ended up with exactly the same instructions plus 2 more (leave it
    in the soa path though since it is probably still cheaper there).
    While here also fix a issue which would cause a crash after an assert.

commit 0e1e755645e9e49cfaa2025191e3245ccd723564
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:29:24 2012 +0100

    gallivm: (trivial) skip floor rounding in ifloor when not signed

    This was only done for the non-sse41 case before, but even with
    sse41 this is obviously unnecessary (some callers already call
    itrunc in this case anyway but some might not).

commit 7f01a62f27dcb1d52597b24825931e88bae76f33
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:23:12 2012 +0100

    gallivm: (trivial) fix bogus comments

commit 5c85be25fd82e28490274c468ce7f3e6e8c1d416
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 20 11:51:57 2012 +0100

    translate: Free elt8_func/elt16_func too.

    These were leaking.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit 0ad498f36fb6f7458c7cffa73b6598adceee0a6c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 19 15:55:34 2012 +0200

    gallivm: fix bug for tex wrap repeat with linear sampling in aos float path

    The comparison needs to be against length not length_minus_one, otherwise
    the max texel is never chosen (for the second coordinate).

    Fixes piglit texwrap-1D-npot-proj (and 2D/3D versions).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit d1ad65937c5b76407dc2499b7b774ab59341209e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 19 16:13:43 2012 +0200

    gallivm: simplify soa tex wrap repeat with npot textures and no mip filtering

    Similar to what is already done in aos sampling for the float path (but not
    the int path since we don't get normalized float coordinates there).
    URem is expensive and the calculation is done trivially with
    normalized floats instead (at least with sse41-capable cpus).
    (Some day should probably do the same for the mip filter path but it's much
    more complicated there hence the gain is smaller.)

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit e1e23f57ba9b910295c306d148f15643acc3fc83
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 20:38:56 2012 +0200

    llvmpipe: (trivial) remove duplicated function declaration

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 07ca57eb09e04c48a157733255427ef5de620861
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 20:37:34 2012 +0200

    llvmpipe: destroy setup variants on context destruction

    lp_delete_setup_variants() used to be called in garbage collection,
    but this no longer exists hence the setup shaders never got freed.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit ed0003c633859a45f9963a479f4c15ae0ef1dca3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 16:25:29 2012 +0100

    gallivm: handle different ilod parts for multiple quad sampling

    This fixes filtering when the integer part of the lod is not the same
    for all quads. I'm not fully convinced of that solution yet as it just
    splits the vector if the levels to be sampled from are different.
    But otherwise we'd need to do things like some minify steps, and getting
    mip level base address separately anyway hence it wouldn't really look
    like much of a win (and making the code even more complex).
    This should now give identical results to single quad sampling.

commit 8580ac4cfc43a64df55e84ac71ce1a774d33c0d2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 14 18:14:47 2012 +0200

    gallivm: de-duplicate sample code common to soa and aos sampling

    There doesn't seem to be any reason why this code dealing with cube face
    selection, lod and mip level calculation is separate in aos and
    soa sampling, and I am sick of having it to change in both places.

commit fb541e5f957408ce305b272100196f1e12e5b1e8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 14 18:15:41 2012 +0200

    gallivm: do mip filtering with per quad lod_fpart

    This gives better results for mip filtering, though the generated code might
    not be optimal. For now it also creates some artifacts if the lod_ipart isn't
    the same for all quads, since instead of using the same mip weight for all
    quads as previously (which just caused non-smooth gradients) this now will
    use the right weights but with the wrong mip level in this case (can easily
    be seen with things like texfilt, mipmap_tunnel).
    v2: use logic helper suggested by José, and fix issue with negative lod_fpart
        values

commit f1cc84eef7d826a20fab6cd8ccef9a275ff78967
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 13 18:35:25 2012 +0200

    gallivm: (trivial) fix bogus assert in lp_build_unpack_broadcast_aos_scalars

commit 7c17dbae8ae290df9ce0f50781a09e8ed640c044
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 12 12:11:14 2012 +0100

    util: Reimplement half <-> float conversions.

    Removed u_half.py used to generate the table for previous method.

    Previous implementation of float to half conversion was faulty for
    denormalised and NaNs and would require extra logic to fix,
    thus making the speedup of using tables irrelevant.

commit 7762f59274070e1dd4b546f5cb431c2eb71ae5c3
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 12 12:12:16 2012 +0100

    tests: Updated tests to properly handle NaN for half floats.

commit fa94c135aea5911fd93d5dfb6e6f157fb40dce5e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 11 18:33:10 2012 +0200

    gallivm: do mip level calculations per quad

    This is the final piece which shouldn't change the rendering output yet.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 23cbeaddfe03c09ca18c45d28955515317ffcf4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 9 00:54:21 2012 +0200

    gallivm: do per-quad cube face selection

    Doesn't quite fix the piglit cubemap test (not sure why actually)
    but doing per-quad face selection is doing the right thing and
    definitely an improvement.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit abfb372b3702ac97ac8b5aa80ad1b94a2cc39d33
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 11 18:22:59 2012 +0200

    gallivm: do all lod calculations per quad

    Still no functional change but lod is now converted to scalar after
    lod calculations.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 519368632747ae03feb5bca9c655eccbc5b751b4
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 16:46:10 2012 +0100

    gallivm: Added support for half-float to float conversion in lp_build_conv.

    Updated various utility functions to support this change.

commit 135b4d683a4c95f7577ba27b9bffa4a6fbd2c2e7
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 16:02:46 2012 +0100

    gallivm: Added function for half-float to float conversion.

    Updated lp_build_format_aos_array to support half-float source.

commit 37d648827406a20c5007abeb177698723ed86673
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:55:18 2012 +0100

    util: Updated u_format_tests to rigidly test half-float boundary values.

commit 2ad18165d96e578aa9046df7c93cb1c3284d8c6b
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:54:16 2012 +0100

    llvmpipe: Updated lp_test_format to properly handle Inf/NaN results.

commit 78740acf25aeba8a7d146493dd5c966e22c27b73
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:53:30 2012 +0100

    util: Added functions for checking NaN / Inf for double and half-floats.

commit 35e9f640ae01241f9e0d67fe893bbbf564c05809
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 24 21:05:13 2012 +0200

    gallivm: Fix calculating rho for 3d textures for the single-quad case

    Discovered by accident, this looks like a very old typo bug.

commit fc1220c636326536fd0541913154e62afa7cd1d8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 24 21:04:59 2012 +0200

    gallivm: do calcs per-quad in lp_build_rho

    Still convert to scalar at the end of the function.

commit 50a887ffc550bf310a6988fa2cea5c24d38c1a41
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon May 21 23:21:50 2012 +0200

    gallivm: (trivial) return scalar in lp_build_extract_range for length 1 vectors

    Our type system on top of llvm's one doesn't generally support vectors of
    length 1, instead using scalars. So we should return a scalar from this
    function instead of having to bitcast the vector with length 1 later elsewhere.

commit 80c71c621f9391f0f9230460198d861643324876
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 17:49:15 2012 +0100

    draw: Fixed bad merge error

commit c47401cfad0c9167de20ff560654f533579f452c
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:29:30 2012 +0100

    draw: Updated store_clip to store whole vectors instead of individual elements.

commit 2d9c1ad74b0b0b41861fffcecde39f09cc27f1cf
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:28:32 2012 +0100

    gallivm: Added lp_build_fetch_rgba_aos_array.

    A version of lp_build_fetch_rgba_aos which is targeted at simple array formats.

    Reads the whole vector from memory in one, instead of reading each element
    individually.

    Tested with mesa tests and demos.

commit ff7805dc2b6ef6d8b11ec4e54aab1633aef29ac8
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:27:40 2012 +0100

    gallivm: Added lp_build_pad_vector.

    This function pads a vector with undef to a desired length.

commit 701f50acef24a2791dabf4730e5b5687d6eb875d
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 17:27:19 2012 +0100

    util: Added util_format_is_array.

    This function checks whether a format description is in a simple array format.

commit 5e0a7fa543dcd009de26f34a7926674190fa6246
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 19:13:47 2012 +0100

    draw: Removed draw_llvm_translate_from and draw/draw_llvm_translate.c.

    This is "replaced" by adding an optimised path in lp_build_fetch_rgba_aos
    in an upcoming patch.

commit 8c886d6a7dd3fb464ecf031de6f747cb33e5361d
Author: James Benton <jbenton@vmware.com>
Date:   Wed May 16 15:02:31 2012 +0100

    draw: Modified store_aos to write the vector as one, not individual elements.

commit 37337f3d657e21dfd662c7b26d61cb0f8cfa6f17
Author: James Benton <jbenton@vmware.com>
Date:   Wed May 16 14:16:23 2012 +0100

    draw: Changed aos_to_soa to use lp_build_transpose_aos.

commit bd2b69ce5d5c94b067944d1dcd5df9f8e84548f1
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 19:14:27 2012 +0100

    draw: Changed soa_to_aos to use lp_build_transpose_aos.

commit 0b98a950d29a116e82ce31dfe7b82cdadb632f2b
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 18:57:45 2012 +0100

    gallivm: Added lp_build_transpose_aos which converts between aos and soa.

commit 69ea84531ad46fd145eb619ed1cedbe97dde7cb5
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 18:57:01 2012 +0100

    gallivm: Added lp_build_interleave2_half aimed at AVX unpack instructions.

commit 7a4cb1349dd35c18144ad5934525cfb9436792f9
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue May 22 11:54:14 2012 +0100

    gallivm: Fix build on Windows.

    MC-JIT not yet supported there.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit afd105fc16bb75d874e418046b80d9cc578818a1
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:17:26 2012 +0100

    llvmpipe: Added a error counter to lp_test_conv.

    Useful for keeping track of progress when fixing errors!

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit b644907d08c10a805657841330fc23db3963d59c
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:16:46 2012 +0100

    llvmpipe: Changed known failures in lp_test_conv.

    To comply with the recent fixes to lp_bld_conv.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit d7061507bd94f6468581e218e61261b79c760d4f
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:14:38 2012 +0100

    llvmpipe: Added fixed point types tests to lp_test_conv.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 146b3ea39b4726dbe125ac666bd8902ea3d6ca8c
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:26:35 2012 +0100

    llvmpipe: Changed lp_test_conv src/dst alignment to be correct.

    Now based on the define rather than a fixed number.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit f3b57441f834833a4b142a951eb98df0aa874536
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:06:44 2012 +0100

    gallivm: Fixed erroneous optimisation in lp_build_min/max.

    Previously assumed normalised was 0 to 1, but it can be -1 to 1
    if type is signed.
    Tested with lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit a0613382e5a215cd146bb277646a6b394d376ae4
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:04:49 2012 +0100

    gallivm: Compensate for lp_const_offset in lp_build_conv.

    Fixing a /*FIXME*/ to remove errors in integer conversion in lp_build_conv.
    Tested using lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit a3d2bf15ea345bc8a0664f8f441276fd566566f3
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:01:25 2012 +0100

    gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.

    Tested with lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit e7b1e76fe237613731fa6003b5e1601a2e506207
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 21 20:07:51 2012 +0100

    gallivm: Fix build with LLVM 2.6

    Trivial, and useful.

commit d3c6bbe5c7f5ba1976710831281ab1b6a631082d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue May 15 17:15:59 2012 +0100

    gallivm: Enable MCJIT/AVX with vanilla LLVM 3.1.

    Add the necessary C++ glue, so that we don't need any modifications
    to the soon to be released LLVM 3.1.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit 724a019a14d40fdbed21759a204a2bec8a315636
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 14 22:04:06 2012 +0100

    gallivm: Use HAVE_LLVM 0x0301 consistently.

commit af6991e2a3868e40ad599b46278551b794839748
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 14 21:49:06 2012 +0100

    gallivm: Add MCRegisterInfo.h to silence benign warnings about missing implementation.

    Trivial.

commit 6f8a1d75458daae2503a86c6b030ecc4bb494e23
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Apr 2 22:14:15 2012 -0700

    gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.

    llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 62555b6ed8760545794f83064e27cddcb3ce5284
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Tue Mar 27 21:51:17 2012 -0700

    gallivm: Fix method overriding in raw_debug_ostream.

    Use matching type qualifers to avoid method hiding.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 6a9bd784f4ac68ad0a731dcd39e5a3c39989f2be
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Tue Mar 13 22:40:52 2012 -0700

    gallivm: Fix createOProfileJITEventListener namespace with llvm-3.1.

    llvm-3.1svn r152620 refactored the OProfile profiling code.
    createOProfileJITEventListener was moved from the llvm namespace to the
    llvm::JITEventListener namespace.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit b674955d39adae272a779be85aa1bd665de24e3e
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Mar 5 22:00:40 2012 -0800

    gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.

    llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
    MCRegisterInfo argument.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 11ab69971a8a31c62f6de74905dbf8c02884599f
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Wed Feb 29 21:20:53 2012 -0800

    Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."

    This reverts commit d5a6c17254.

    llvm-3.1svn r151687 makes MemoryObject accessor members const again.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 339960c82d2a9f5c928ee9035ed31dadb7f45537
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon May 14 16:19:56 2012 +0200

    gallivm: (trivial) fix assertion failure for mipmapped 1d textures

    In lp_build_rho, we may end up with a 1-element vector (for mipmapped 1d
    textures), but in this case we require the type to be a non-vector type,
    so need a cast.

commit 9d73edb727bd6d196030dc3026b7bf0c574b3e19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 10 18:12:07 2012 +0200

    gallivm: prepare for per-quad lod calculations for large vectors

    to be able to handle multiple quads at once in texture sampling and still
    do lod calculations per quad, it is necessary to get the per-quad derivatives
    into the lp_build_rho function.
    Until now these derivative values were just scalars, which isn't going to work.
    So we now use vectors, and since the interface needs to change we also do some
    different (slightly more efficient) packing of the values.
    For 8-wide vectors the packed derivative values for 3 coords would look like
    this, this scales to a arbitrary (multiple of 4) vector size:
    ds1dx ds1dy dt1dx dt1dy ds2dx ds2dy dt2dx dt2dy
    dr1dx dr1dy _____ _____ dr2dx dr2dy _____ _____
    The second vector will be unused for 1d and 2d textures.
    To facilitate future changes the derivative values are put into a struct, since
    quite some functions just pass these values through.
    The generated code seems to be very slightly better for 2d textures (with
    4-wide vectors) than before with sse2 (if you have a cpu with physical 128bit
    simd units - otherwise it's probably not a win).
    v2: suggestions from José, rename variables, add comments, use swizzle helper

commit 0aa21de0d31466dac77b05c97005722e902517b8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 10 18:10:31 2012 +0200

    gallivm: add undefined swizzle handling to lp_build_swizzle_aos

    This is useful for vectors with "holes", it lets llvm choose the most
    efficient shuffle instructions if some elements aren't needed without having to
    worry what elements to manually pick otherwise.

commit 00faf3f370e7ce92f5ef51002b0ea42ef856e181
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri May 4 17:25:16 2012 +0100

    gallivm: Get the LLVM IR optimization passes before JIT compilation.

    MC-JIT engine compiles the module immediately on creation, so the optimization
    passes were being run too late.

    So now we create a target data layout from a string, that matches the
    ABI parameters reported by the compiler.

    The backend optimization passes were always been run, so the performance
    improvement is modest (3% on multiarb mesa demo).

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 40a43f4e2ce3074b5ce9027179d657ebba68800a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed May 2 16:03:54 2012 +0200

    gallivm: (trivial) fix wrong define used in lp_build_pack2

    should fix stack-smashing crashes.

commit e6371d0f4dffad4eb3b7a9d906c23f1c88a2ab9e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Apr 30 21:25:29 2012 +0200

    gallivm: add perf warnings when not using intrinsics with 256bit vectors

    Helper functions using integer sse2 intrinsics could split the vectors with AVX
    instead of using generic fallback (which should be faster).
    We don't actually expect to hit these paths (hence don't fix them up to actually
    do the vector splitting) so just emit warnings (for those functions where it's
    obvious doing split/intrinsic is faster than using generic path).
    Only emit warnings for 256bit vectors since we _really_ don't expect to hit
    arbitrary large vectors which would affect a lot more functions.
    The warnings do not actually depend on avx since the same logic applies to
    plain sse2 too (but of course again there's _really_ no reason we should hit
    these functions with 256bit vectors without avx).

commit 8a9ea701ea7295181e846c6383bf66a5f5e47637
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:37:07 2012 +0200

    gallivm: split vectors manually for avx in lp_build_pack2 (v2)

    There's 2 reasons for this:
    First, there's a llvm bug (fixed in 3.1) which generates tons of byte
    inserts/extracts otherwise, and second, more importantly, we want to use
    pack intrinsics instead of shuffles.
    We do this in lp_build_pack2 and not the calling code (aos sample path)
    because potentially other callers might find that useful too, even if
    for larger sequences of code using non-native vector sizes it might be
    better to manually split vectors.
    This should boost texture performance in the aos path considerably.
    v2: fix issues with intrinsics types with old llvm

commit 27ac5b48fa1f2ea3efeb5248e2ce32264aba466e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:26:22 2012 +0200

    llvmpipe: refactor lp_build_pack2 (v2)

    prettify, and it's unnecessary to assert when there's no intrinsic due to
    unsupported bit width - the shuffle path will work regardless.
    In contrast lp_build_packs2, should only rely on lp_build_pack2 doing the
    clamping for element sizes for which there is a sse2 intrinsic.
    v2: fix bug spotted by Jose regarding the intrinsic type for packusdw
    on old llvm versions.

commit ddf279031f0111de4b18eaf783bdc0a1e47813c8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:13:59 2012 +0200

    gallivm: add src width check in lp_build_packs2()

    not doing so would skip clamping even if no sse2 pack instruction is
    available, which is incorrect (in theory only, such widths would also always
    hit a (unnecessary) assertion in lp_build_pack2().

commit e7f0ad7fe079975eae7712a6e0c54be4fae0114b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 27 15:57:00 2012 +0200

    gallivm: (trivial) fix crash-causing typo for npot textures with avx

commit 28a9d7f6f655b6ec508c8a3aa6ffefc1e79793a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Apr 25 19:38:45 2012 +0200

    gallivm: (trivial) remove code mistakenly added twice.

commit d5926537316f8ff67ad0a52e7242f7c5478d919b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Apr 24 21:16:15 2012 +0200

    gallivm: add a new avx aos sample path (v2)

    Try to avoid mixing float and int address calculations. This does texture wrap
    modes with floats, and then the offset calculations still with ints (because
    of lack of precision with floats, though we could do some effort to make it work
    with not too large (16MB) textures).
    This also handles wrap repeat mode with npot-sized textures differently than
    either the old soa or aos int path (likely way faster but untested).
    Otherwise the actual address wrap code is largely similar to the soa path (not
    quite the same as this one also has some int code), it should get used by avx
    soa sampling later as well but doesn't handle more complex address modes yet
    (this will also have the benefit that we can use aos sampling path for all
    texture address modes).
    Generated code for that looks reasonable, but still does not split vectors
    explicitly for fetch/filter which means still get hit by llvm (fixed upstream)
    which generates hundreds of pinsrb/pextrb instead of two shuffles.
    It is not obvious though if it's much of a win over just doing address calcs
    4-wide but with ints, even if it is definitely much less instructions on avx.
    piglit's texwrap seems to look exactly the same but doesn't test
    neither the non-normalized nor the npot cases.
    v2: fix comments, prettify based on Brian's and Jose's feedback.

commit bffecd22dea66fb416ecff8cffd10dd4bdb73fce
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 19 01:58:29 2012 +0200

    gallivm: refactor aos lp_build_sample_image_nearest/linear

    split them up to separate address calculations and fetching/filtering.
    Need this for being able to do 8-wide float address calcs and 4-wide
    fetch/filter later (for avx). Plus the functions were very big scary monsters
    anyway (in particular lp_build_sample_image_linear).

commit a80b325c57529adddcfa367f96f03557725c4773
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Apr 16 17:17:18 2012 +0200

    gallivm: fix lp_build_resize when truncating width but expanding vector size

    Missed this case which I thought was impossible - the assertion for it was
    right after the division by zero...
    (AoS) texture sampling may ask us to do this, for things like 8 4x32int
    vectors to 1 32x8int vector conversion (eventually, we probably don't want
    this to happen).

commit f9c8337caa3eb185830d18bce8b95676a065b1d7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Apr 14 18:00:59 2012 +0200

    gallivm: fix cube maps with larger vectors

    This makes the branchless cube face selection code work with larger vectors.
    Because the complexity is quite high (cannot really be improved it seems,
    per-face selection would reduce complexity a lot but this leads to errors
    unless the derivatives are calculated all from the same face which almost
    doubles the work to be done) it is still slower than the branching version,
    hence only enable this with large vectors.
    It doesn't actually do per-quad face selection yet (only makes sense with
    matching lod selection, in fact it will select the same face for all pixels
    based on the average of the first four pixels for now) but only different
    shuffles are required to make it work (the branching version actually should
    work with larger vectors too now thanks to the improved horizontal add but of
    course it cannot be extended to really select the face per-quad unless doing
    branching per quad).

commit 7780c58869fc9a00af4f23209902db7e058e8a66
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 30 21:11:12 2012 +0100

    llvmpipe: (trivial) fix compiler warning

    and also clarify comment regarding availability of popcnt instruction.

commit a266dccf477df6d29a611154e988e8895892277e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 30 14:21:07 2012 +0100

    gallivm: remove unneeded members in lp_build_sample_context

    Minor cleanup, the texture width, height, depth aren't accessed in their
    scalar form anywhere. Makes it more obvious those values should probably be
    fetched already vectorized (but this requires more invasive changes)...

commit b678c57fb474e14f05e25658c829fc04d2792fff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 29 15:53:55 2012 +0100

    gallivm: add a helper for concatenating vectors

    Similar to the extract_range helper intended to get around slow code generated
    by llvm for 128bit insertelements.
    Concatenating two 128bit vectors this way will result in a single vinsertf128
    operation rather than two 64bit stores plus one 128bit load, though it might be
    mildly useful for other purposes as well.

commit 415ff228bcd0cf5e44a4c15350a661f0f5520029
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 19:41:15 2012 +0100

    gallivm: add a custom 2x8f->1x16ub avx conversion path

    Similar to the existing 4x4f->1x16ub sse2 path, shaves off a couple
    instructions (min/max mostly) because it relies on pack intrinsics clamping.

commit 78c08fc89f8fbcc6dba09779981b1e873e2a0299
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 18:44:07 2012 +0100

    gallivm: add avx arithmetic intrinsics

    Add all avx intrinsics for arithmetic functions (with the exception
    of the horizontal add function which needs another look).
    Seems to pass basic tests.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit a586caa2800aa5ce54c173f7c0d4fc48153dbc4e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 15:31:35 2012 +0100

    gallivm: add avx logic intrinsics

    Add the blend intrinsics for 8-wide float and 4-wide double vectors.
    Since we lack 256bit int instructions these are used for int vectors as well,
    though obviously not for byte or word element values.
    The comparison intrinsics aren't extended for avx since these are only used
    for pre-2.7 llvm versions.

commit 70275e4c13c89315fc2560a4c488c0e6935d5caf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 00:40:53 2012 +0100

    gallivm: new helper function for extract shuffles.

    Based on José's idea as we can need that in a couple places.
    Note that such shuffles should not be used lightly, since data layout
    of <4 x i8> is different to <16 x i8> for instance, hence might cause
    data rearrangement.

commit 4d586dbae1b0c55915dda1759d2faea631c0a1c2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 27 18:27:25 2012 +0100

    gallivm: (trivial) don't overallocate shuffle variable

    using wrong define meant huge array...

commit 06b0ec1f6d665d98c135f9573ddf4ba04b2121ad
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 27 17:54:20 2012 +0100

    gallivm: don't do per-element extract/insert for vector element resize

    Instead of doing per-element extract/insert if the src vectors
    and dst vector differ in total size (which generates atrocious code)
    first change the src vectors size by using shuffles to destination
    vector size.
    We can still do better than that on AVX for packing to color buffer
    (by exploiting pack intrinsics characteristics hence eleminating the
    need for some clamps) but this already generates much better code.

    v2: incorporate feedback from José, Keith and use shuffle instead of
    bitcasts/extracts. Due to llvm deficiencies the latter cause all data
    to get moved to GPRs and back in pieces (even though the data in the
    regs actually stays the same...).

commit c9970d70e05f95d3f52fe7d2cd794176a52693aa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 23 19:33:19 2012 +0000

    gallivm: fix bug in simple position interpolation

    Accidental use of position attribute instead of just pixel coordinates.
    Caused failures in piglit glsl-fs-ceil and glsl-fs-floor.

commit d0b6fcdb008d04d7f73d3d725615321544da5a7e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 23 15:31:14 2012 +0000

    gallivm: fix emission of ceil opcode

    lp_build_ceil seems more appropriate than lp_build_trunc.
    This seems to be never hit though someone performs some ceil
    to floor magic.

commit d97fafed7e62ffa6bf76560a92ea246a1a26d256
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 22 11:46:52 2012 +0000

    gallivm: new vectorized path for cubemap calculations

    should be faster when adapted to multiple quads as only selection masks need to be different.
    The code is more or less a per-pixel version adapted to only do it per quad.
    A per pixel version would be much simpler (could drop 2 selects, 6 broadcasts and the messy
    horizontal add of 3 vectors at the expense of only 2 more absolute value instructions -
    would also just work for arbitary large vectors).
    This version doesn't yet work with larger vectors because the horizontal add isn't adjusted
    to be able to work with 2x4 vectors (and also because face selection wouldn't be done per
    quad just per block though that would be only a correctness issue just as with lod selection).
    The downside is this code is quite a bit slower. On a Core2 it can be sped up by disabling the
    hw blend instructions for selection and using logicop fallbacks instead, but it is still slower
    than the old code, hence leave that in for now. Probably will chose one or the other version
    based on vector length in the end.

commit b375fbb18a3fd46859b7fdd42f3e9908ea4ff9a3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 21 14:42:29 2012 +0000

    gallivm: fix optimized occlusion query intrinsic name

commit a9ba0a3b611e48efbb0e79eb09caa85033dbe9a2
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Mar 21 16:19:43 2012 +0000

    draw,gallivm,llvmpipe: Call gallivm_verify_function everywhere.

commit f94c2238d2bc7383e088b8845b7410439a602071
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 18:54:10 2012 +0000

    gallivm: optimize calculations for cube maps a bit

    this does some more vectorized calculations and uses horizontal adds if possible.
    A definite win with sse3 otherwise it doesn't seem to make much of a difference.
    In any case this is arithmetically identical, cannot handle larger vectors.
    Should be useful as a reference point against larger vector version later...

commit 21a2c1cf3c8e1ac648ff49e59fdc0e3be77e2ebb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 15:16:27 2012 +0000

    llvmpipe: slight optimization of occlusion queries

    using movmskps when available.
    While this is slightly better for cpus without popcnt we should
    really sum the vectors ourselves (it is also possible to cast to i4 before
    doing the popcnt but that doesn't help that much neither since llvm
    is using some optimized popcnt version for i32)

commit 5ab5a35f216619bcdf55eed52b0db275c4a06c1b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 13:32:11 2012 +0000

    llvmpipe: fix occlusion queries with larger vectors

    need to adjust casts etc.

commit ff95e6fdf5f16d4ef999ffcf05ea6e8c7160b0d5
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Mar 19 20:15:25 2012 +0000

    gallivm: Restore optimization passes.

commit 57b05b4b36451e351659e98946dae27be0959832
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 19:34:22 2012 +0000

    llvmpipe: use existing min2 macro

commit bc9a20e19b4f600a439f45679451f2e87cd4b299
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 19:07:27 2012 +0000

    llvmpipe: add some safeguards against really large vectors

    As per José's suggestion, prevent things from blowing up if some cpu
    would have 1024bit or larger vectors.

commit 0e2b525e5ca1c5bbaa63158bde52ad1c1564a3a9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 18:31:08 2012 +0000

    llvmpipe: fix mask generation for uberwide vectors

    this was the only piece preventing 16-wide vectors from working
    (apart from the LP_MAX_VECTOR_WIDTH define that is), which is the maximum
    as we don't get more pixels in the fragment shader at once.
    Hence adjust that so things could be tested properly with that size
    even though there seems to be no practical value.

commit 3c8334162211c97f3a11c7f64e9e5a2a91ad9656
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 18:19:41 2012 +0000

    llvmpipe: fix the simple interpolation method with larger vectors

    so both methods actually _really_ work now. Makes textures look
    nice with larger vectors...

commit 1cb0464ef8871be1778d43b0c56adf9c06843e2d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 17:26:35 2012 +0000

    llvmpipe: fix mask generation and position interpolation with 8-wide vectors

    trivial bugs, with these things start to look somewhat reasonable.
    Textures though have some swizzling issues it seems.

commit 168277a63ef5b72542cf063c337f2d701053ff4b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 16:04:03 2012 +0000

    llvmpipe: don't overallocate variables

    we never have more than 16 (stamp size) / 4 (minimum possible vector size).
    (With larger vectors those variables are still overallocated a bit.)

commit 409b54b30f81ed0aa9ed0b01affe15c72de9abd2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 15:56:48 2012 +0000

    llvmpipe: add some 32f8 formats to lp_test_conv

    Also add the ability to handle different sized vectors.

commit 55dcd3af8366ebdac0af3cdb22c2588f24aa18ce
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 15:47:27 2012 +0000

    gallivm: handle different sized vectors in conversion / pack

    only fully generic path for now (extract/insert per element).

commit 9c040f78c54575fcd94a8808216cf415fe8868f6
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sun Mar 18 00:58:28 2012 +0100

    llvmpipe: fix harmless use of unitialized values

commit 551e9d5468b92fc7d5aa2265db9a52bb1e368a36
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 16 23:31:21 2012 +0100

    gallivm: drop special path in extract_broadcast with different sized vectors

    Not needed, llvm can handle shuffles with different sized result vector just
    fine. Should hopefully generate the same code in the end, but simpler IR.

commit 44da531119ffa07a421eaa041f63607cec88f6f8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 16 23:28:49 2012 +0100

    llvmpipe: adapt interpolation for handling multiple quads at once

    this is still WIP there are actually two methods possible not quite
    sure what makes the most sense, so there's code for both for now:
    1) the iterative method as used before (compute attrib values at upper left
    corner of stamp and upper left corner of each quad initially).
    It is improved to handle more than one quad at once, and also do some more vectorized
    calculations initially for slightly better code - newer cpus have full throughput with
    4 wide float vectors, hence don't try to code up a path which might be faster if there's
    just one channel active per attribute.
    2) just do straight interpolation for each pixel.
    Method 2) is more work per quad, but less initially - if all quads are executed
    significantly more overall though. But this might change with larger vector lengths.
    This method would also be needed if we'd do some kind of active quad merging when
    operating on multiple quads at once.
    This path contains some hack to force llvm to generate better code, it is still far
    from ideal though, still generates far too many unnecessary register spills/reloads.
    Both methods should work with different sized vectors.
    Not very well tested yet, still seems to work with four-wide vectors, need changes
    elsewhere to be able to test with wider vectors.

commit be5d3e82e2fe14ad0a46529ab79f65bf2276cd28
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 16 20:59:37 2012 +0000

    draw: Cleanup.

commit f85bc12c7fbacb3de2a94e88c6cd2d5ee0ec0e8d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 16 20:43:30 2012 +0000

    gallivm: More module compilation refactoring.

commit d76f093198f2a06a93b2204857e6fea5fd0b3ece
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Mar 15 21:29:11 2012 +0000

    llvmpipe: Use gallivm_compile/free_function() in linear code.

    Should had been done before.

commit 122e1adb613ce083ad739b153ced1cde61dfc8c0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 13 14:47:10 2012 +0100

    llvmpipe: generate partial pixel mask for multiple quads

    still works with one quad, cannot be tested yet with more
    At least for now always fixed order with multiple quads.

commit 4c4f15081d75ed585a01392cd2dcce0ad10e0ea8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 22:09:24 2012 +0100

    llvmpipe: refactor state setup a bit

    Refactor to make it easier to emit (and potentially later fetch in fs)
    coefficients for multiple attributes at once.
    Need to think more about how to make this actually happen however, the
    problem is different attributes can have different interpolation modes,
    requiring different handling in both setup and fs (though linear and
    perspective handling is close).

commit 9363e49722ff47094d688a4be6f015a03fba9c79
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 19:23:23 2012 +0100

    llvmpipe: vectorize tri offset calc

    cuts number of instructions in quad-offset-factor from 107 to 75.
    This code actually duplicated the (scalar) code calculating the determinant
    except it used different vertex order (leading to different sign but it doesn't
    matter) hence llvm could not have figured out it's the same (of course with
    determinant vectorized in the other place that wouldn't have worked any longer
    neither).
    Note this particular piece doesn't actually vectorize well, not many arithmetic
    instructions left but tons of shuffle instructions...
    Probably would need to work on n tris at a time for better vectorization.

commit 63169dcb9dd445c94605625bf86d85306e2b4297
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 03:11:37 2012 +0100

    llvmpipe: vectorize some scalar code in setup

    reduces number of arithmetic instructions, and avoids loading
    vector x,y values twice (once as scalars once as vectors).
    Results in a reduction of instructions from 76 to 64 in fs setup for glxgears
    (16%) on a cpu with sse41.
    Since this code uses vec2 disguised as vec4, on old cpus which had physical
    64bit sse units (pre-Core2) it probably is less of a win in practice (and if
    you have no vectors you can only hope llvm eliminates the arithmetic for
    unneeded elements).

commit 732ecb877f951ab89bf503ac5e35ab8d838b58a1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 7 00:32:24 2012 +0100

    draw: fix clipping

    bug introduced by 4822fea3f0440b5205e957cd303838c3b128419c broke
    clipping pretty badly (verified with lineclip test)

commit ef5d90b86d624c152d200c7c4056f47c3c6d2688
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 6 23:38:59 2012 +0100

    draw: don't store vertex header per attribute

    storing the vertex header once per attribute is totally unnecessary.
    Some quick look at the generated assembly says llvm in fact cannot optimize
    away the additional stores (maybe due to potentially aliasing pointers
    somewhere).
    Plus, this makes the code cleaner and also allows using a vector "or"
    instead of scalar ones.

commit 6b3a5a57b0b9850854cfbd7b586e4e50102dda71
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 6 19:11:01 2012 +0100

    draw: do the per-vertex "boolean" clipmask "or" with vectors

    no point extracting the values and doing it per component.
    Doesn't help that much since we still extract the values elsewhere anyway.

commit 36519caf1af40e4480251cc79a2d527350b7c61f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 2 22:27:01 2012 +0100

    gallivm: fix lp_build_extract_broadcast with different sized vectors

    Fix the obviously wrong argument, so it doesn't blow up.

commit 76d0ac3ad85066d6058486638013afd02b069c58
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 2 12:16:23 2012 +0000

    draw: Compile per module and not per function (WIP).

    Enough to get gears w/ LLVM draw + softpipe to work on AVX doing:

      GALLIUM_DRIVER=softpipe SOFTPIPE_USE_LLVM=yes glxgears

    But still hackish -- will need to rethink and refactor this.

commit 78e32b247d2a7a771be9a1a07eb000d1e54ea8bd
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 12:01:05 2012 +0000

    llvmpipe: Remove lp_state_setup_fallback.

    Never used.

commit 6895d5e40d19b4972c361e8b83fdb7eecda3c225
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Feb 27 19:14:27 2012 +0000

    llvmpipe: Don't emit EMMS on x86

    We already take precautions to ensure that LLVM never emits MMX code.

commit 4822fea3f0440b5205e957cd303838c3b128419c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Feb 29 15:58:19 2012 +0100

    draw: modifications for larger vector sizes

    We want to be able to use larger vectors especially for running the vertex
    shader. With this patch we build soa vectors which might have a different
    length than 4.
    Note that aos structures really remain the same, only when aos structures
    are converted to soa potentially different sized vectors are used.
    Samplers probably don't work yet, didn't look at them.
    Testing done:
    glxgears works with both 128bit and 256bit vectors.

commit f4950fc1ea784680ab767d3dd0dce589f4e70603
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 15:51:57 2012 +0100

    gallivm: override native vector width with LP_NATIVE_VECTOR_WIDTH env var for debug

commit 6ad6dbf0c92f3bf68ae54e5f2aca035d19b76e53
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 15:51:24 2012 +0100

    draw: allocate storage with alignment according to native vector width

commit 7bf0e3e7c9bd2469ae7279cabf4c5229ae9880c1
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Feb 24 19:06:08 2012 +0000

    gallivm: Fix comment grammar.

    Was missing several words. Spotted by Roland.

commit b20f1b28eb890b2fa2de44a0399b9b6a0d453c52
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 19:22:09 2012 +0000

    gallivm: Use MC-JIT on LLVM 3.1 + (i.e, SVN)

    MC-JIT

    Note: MC-JIT is still WIP. For this to work correctly it requires
    LLVM changes which are not yet upstream.

commit b1af4dfcadfc241fd4023f4c3f823a1286d452c0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 20:03:15 2012 +0100

    llvmpipe: use new lp_type_width() helper in lp_test_blend

commit 04e0a37e888237d4db2298f31973af459ef9c95f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 19:50:34 2012 +0100

    llvmpipe: clean up lp_test_blend a little

    Using variables just sized and aligned right makes it a bit more obvious
    what's going on.
    The test still only tests vector length 4.
    For AoS anything else probably isn't going to work.
    For SoA other lengths should work (at least with floats).

commit e61c393d3ec392ddee0a3da170e985fda885a823
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:48:30 2012 +0000

    gallivm: Ensure vector width consistency.

    Instead of assuming that everything is the max native size.

commit 330081ac7bc41c5754a92825e51456d231bf84dd
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:44:14 2012 +0000

    draw: More simd vector width consistency fixes.

commit d90ca002753596269e37297e2e6c139b19f29f03
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:43:00 2012 +0000

    gallivm: Remove unused lp_build_int32_vec4_type() helper.

commit cae23417824d75869c202aaf897808d73a2c1db0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 17:32:16 2012 +0100

    gallivm: use global variable for native vector width instead of define

    We do not know the simd extensions (and hence the simd width we should use)
    available at compile time.
    At least for now keep a define for maximum vector width, since a global
    variable obviously can't be used to adjust alignment of automatic stack
    variables.
    Leave the runtime-determined value at 128 for now in all cases.

commit 51270ace6349acc2c294fc6f34c025c707be538a
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 15:41:02 2012 +0000

    gallivm: Add a hunk inadvertedly lost when rebasing.

commit bf256df9cfdd0236637a455cbaece949b1253e98
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 14:24:23 2012 +0000

    llvmpipe: Use consistent vector width in depth/stencil test.

commit 5543b0901677146662c44be2cfba655fd55da94b
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 14:19:59 2012 +0000

    draw: Use a consistent the vector register width.

    Instead of 4x32 sometimes, LP_NATIVE_VECTOR_WIDTH other times.

commit eada8bbd22a3a61f549f32fe2a7e408222e5c824
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 12:08:04 2012 +0000

    gallivm: Remove garbagge collection.

    MC-JIT will require one compilation per module (as opposed to one
    compilation per function), therefore no state will be shared,
    eliminating the need to do garbagge collection.

commit 556697ea0ed72e0641851e4fbbbb862c470fd7eb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 10:33:41 2012 +0000

    gallivm: Move all native target initialization to lp_set_target_options().

commit c518e8f3f2649d5dc265403511fab4bcbe2cc5c8
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:52:32 2012 +0000

    llvmpipe: Create one gallivm instance for each test.

commit 90f10af8920ec6be6f2b1e7365cfc477a0cb111d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:48:08 2012 +0000

    gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().

    Brittle, complex, and unecesary. Just use function pointer constant.

commit 98fde550b33401e3fe006af59db4db628bcbf476
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:21:26 2012 +0000

    gallivm: Add a lp_build_const_func_pointer() helper.

    To be reused in all places where we want to call C code.

commit 6cfedadb62c2ce5af8d75969bc95a607f3ece118
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:44:41 2012 +0000

    gallivm: Cleanup/simplify lp_build_const_string_variable.

    - Move to lp_bld_const where it belongs
    - Rename to lp_build_const_string
    - take the length from the argument (and don't count the zero terminator twice)
    - bitcast the constant to generic i8 *

commit db1d4018c0f1fa682a9da93c032977659adfb68c
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 11:52:17 2012 +0000

    gallivm: Set NoFramePointerElimNonLeaf to true where supported.

commit 088614164aa915baaa5044fede728aa898483183
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Feb 22 19:38:47 2012 +0100

    llvmpipe: pass in/out pointers rather scalar floats in lp_bld_arit

    we don't want llvm to potentially optimize away the vectors (though it doesn't
    seem to currently), plus we want to be able to handle in/out vectors of arbitrary
    length.

commit 3f5c4e04af8a7592fdffa54938a277c34ae76b51
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Feb 21 23:22:55 2012 +0100

    gallivm: fix lp_build_sqrt() for vector length 1

    since we optimize away vectors with length 1 need to emit intrinsic
    without vector type.

commit 79d94e5f93ed8ba6757b97e2026722ea31d32c06
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 22 17:00:46 2012 +0000

    llvmpipe: Remove lp_test_round.

commit 81f41b5aeb3f4126e06453cfc78990086b85b78d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Feb 21 23:56:24 2012 +0100

    llvmpipe: subsume lp_test_round into lp_test_arit

    Much simpler, and since the arguments aren't passed as 128bit values can run
    on any arch.
    This also uses the float instead of the double versions of the c functions
    (which probably was the intention anyway).
    In contrast to lp_test_round the output is much less verbose however.
    Tested vector width of 32 to 512 bits - all pass except 32 (length 1) which
    crashes in lp_build_sqrt() due to wrong type.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 945b338b421defbd274481d8c4f7e0910fd0e7eb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 22 09:55:03 2012 +0000

    gallivm: Centralize the function compilation logic.

    This simplifies a lot of code.

    Also doing this in a central place will make it easier to carry out the
    changes necessary to use MC-JIT in the future.

gallivm: Fix typo in explicit derivative shuffle.

Trivial.

draw: make DEBUG_STORE work again

adapt to lp_build_printf() interface changes

Reviewed-by: José Fonseca <jfonseca@vmware.com>

draw: get rid of vecnf_from_scalar()

just use lp_build_broadcast directly (cannot assign a name but don't really
need it, vecnf_from_scalar() was producing much uglier IR due to using
repeated insertelement instead of insertelement+shuffle).

Reviewed-by: José Fonseca <jfonseca@vmware.com>

llvmpipe: fix typo in complex interpolation code

Fixes position interpolation when using complex mode
(piglit fp-fragment-position and similar)

Reviewed-by: José Fonseca <jfonseca@vmware.com>

draw: fix clipvertex/position storing again

This appears to be the result of a bad merge.
Fixes piglit tests relying on clipping, like a lot of the interpolation tests.

Reviewed-by: José Fonseca <jfonseca@vmware.com>

gallivm: Fix explicit derivative manipulation.

Same counter variable was being used in two nested loops. Use more
meanigful variable names for the counter to fix and avoid this.

gallivm: Prevent buffer overflow in repeat wrap mode for NPOT.

Based on Roland's patch, discussion, and review .

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: Fix dims for TGSI_TEXTURE_1D in emit_tex.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: Fix explicit volume texture derivatives.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: fix 1d shadow texture sampling

Always r coordinate is used, hence need 3 coords not two
(the second one is unused).

Reviewed-by: José Fonseca <jfonseca@vmware.com>

gallivm: Enable AVX support without MCJIT, where available.

For now, this just enables AVX on Windows for testing.  If the code is
stable then we might consider prefering the old JIT wherever possible.

No change elsewhere.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-17 13:42:39 +01:00
José Fonseca
ba9c1773d7 gallivm: Allow to force nearest filtering on a per-axis basis.
Experimental code, not really used yet.
2012-07-17 13:42:39 +01:00
Kristian Høgsberg
b262f56738 wayland: Include wl_drm format enum in wayland-drm.h
This gets referenced before we get to generate the header files, so just include the
enum that we need and don't include the generated header.
2012-07-17 08:30:39 -04:00
James Benton
e253175c9c llvmpipe: Fix bug with blend factor in complementary optimisations.
Fixes fdo 52168.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-17 13:16:38 +01:00
Christian König
89e755d762 radeonsi: fix vertex element state
The vertex element state isn't in registers any more, so
remove that old code. That fixes a memory corruption with
the blend state and gets eglgears partially working.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-17 10:44:12 +02:00
Christian König
4247fd9928 radeon/llvm: fix compiling when llvm is active, but opencl isn't
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-17 10:43:53 +02:00
Brian Paul
aa0becdbb6 mesa: include inttypes.h to get uint8_t type
To fix MSVC build.
2012-07-16 16:12:02 -06:00
Brian Paul
fe2a7b7e7f st/egl: fix uninitialized pointer bug
If no format is matched in the loop the value of xconf was undefined.

NOTE: This is a candidate for the 8.0 branch.
2012-07-16 16:03:31 -06:00
Brian Paul
2f92a9f721 r300g: silence uninitialized var warning 2012-07-16 16:03:31 -06:00
Elvis Lee
cf775c9cbf egl_dri2: NULL check for EGLNativeWindowType
Some application calls eglCreateWindowSurface with
EGLNativeWindowType parameter having zero value. It causes SEGV
and disturbs error handling like EGL_NO_SURFACE.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-16 16:03:31 -06:00
Jon TURNEY
d80fd04639 Fix building mesa with assembly enabled since a112ca5d
a112ca5d rather crassly smashed all the compiler flags together into AM_CFLAGS.
Separate them out the way they were before, putting pre-processor flags into
AM_CPPFLAGS, so assembly source gets preprocessed with the correct pre-processor
flags as well.

Also, remove unneeded CFLAGS from AM_CFLAGS, and CXXFLAGS from AM_CXXFLAGS

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Brian Paul <brianp@vmware.com>
2012-07-16 22:54:36 +01:00
Chad Versace
8dc074cd92 intel: Fix build broken by ETC1 patch
I suck at resolving merge conflicts and broke the build in a5a34b1.
This patch adds the missing field intel_mipmap_tree::wraps_etc1.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:29:24 -07:00
Chad Versace
a5a34b153d intel: Enable GL_OES_compressed_ETC1_RGB8_texture
Enable it for all hardware.

No current hardware supports ETC1, so this patch implements it by
translating the ETC1 data to RGBX data during the call to
glCompressedTexImage2D(). For details, see the doxygen for
intel_mipmap_tree::wraps_etc1.

Passes the Piglit test spec/OES_compressed_ETC1_RGB8_texture/miptree and
the ETC1 test in the GLES2 conformance suite.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:11:12 -07:00
Chad Versace
8ec721264c mesa: Add function for decoding ETC1 textures
Add function _mesa_etc1_unpack_rgba8888. It is intended to be used by
glCompressedTexSubImage2D to decode ETC1 textures into RGBA.

CC: Chia-I <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:07:57 -07:00
Chad Versace
d7458e401e gallium/util, mesa: Refactor etc1 unpack function
Move the body of util_etc1_rgb8_unpack_rgba_unorm8 into a new function
that can be shared between gallium and dri drivers,
texcompress_etc_tmp.h:etc1_unpack_rgba8888.

CC: Chia-I <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:07:57 -07:00
Kristian Høgsberg
7250cd506b gbm: Rename gbm_bo_get_pitch to gbm_bo_get_stride
We use pitch for 'pixels per row' and stride for 'bytes per row' pretty
consistently in mesa and most other places, so rename the gbm API.
2012-07-16 16:29:16 -04:00
Kristian Høgsberg
44f066b9ff gbm: Add new gbm_bo_import entry point
This generalizes and replaces gbm_bo_create_for_egl_image.  gbm_bo_import
will create a gbm_bo from either an EGLImage or a struct wl_buffer.
2012-07-16 16:29:15 -04:00
Roland Scheidegger
43ccded1e1 llvmpipe: destroy setup variants on context destruction
lp_delete_setup_variants() used to be called in garbage collection,
but this no longer exists hence the setup shaders never got freed.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-16 19:00:54 +01:00
James Benton
8684ffc141 llvmpipe: Unified common code between AoS and SoA blending.
Added a new file lp_bld_blend.c for the common code.
Merged and added some simple optimisations.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-07-16 19:00:54 +01:00
Kristian Høgsberg
636646a481 intel: Don't call _mesa_get_format_bytes for MESA_FORMAT_NONE
When we don't intend to texture from or render to a __DRIimage we
use __DRI_IMAGE_FORMAT_NONE.  In that case, we just create the __DRIimage
to reference the underlying buffer, and will create usable __DRIimages
from it using createSubImage later.

If we try to use _mesa_get_format_bytes() on MESA_FORMAT_NONE in
a debug build, we hit an assertion, so let's not do that.
2012-07-16 11:00:16 -04:00
Jon TURNEY
81de0431d6 Fix building glsl when using automake-1.12 after 68e04cc6
Commit 68e04cc6 was tested using automake-1.11.  Unfortunately, automake-1.12
made a "slightly backward-incompatible change" in the use of yacc with C++, and
for a .yy file, the generated header file is now named .hh, not .h

To work with both, write our own rule for running yacc, which generates a
header file named .h, rather than using automake's rule.

Also, remove things from BUILD_SOURCES which don't need to be there

Also, update EXCLUDE rules in doxygen/glsl.doxy, for change of generated files
from .cpp -> .cc, and glsl_lexer.h has never existed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-15 15:27:26 +01:00
Marek Olšák
bc6bff7947 r600g: compute needed CS space for vertex buffers correctly 2012-07-15 15:26:14 +02:00
Marek Olšák
15ca9d159e r600g: don't check the R600_GLSL130 env var
GLSL 1.3 has been enabled by default for quite a while.
2012-07-15 02:16:46 +02:00
Jerome Glisse
e634651024 r600g: fix DB decompression on evergreen
Separated out of the hyperz patch by Marek with minor modifications.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:06:44 +02:00
Tom Stellard
c2f444c54d r600g: Emit vertex buffers using the same method as constant buffers
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:00:27 +02:00
Tom Stellard
9b76ee70b2 r600g: Unify 3D and compute vertex buffer emission
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:00:21 +02:00
Marek Olšák
0b4c5dbb8c r600g: fix grammar constant_buffer -> constant_buffers 2012-07-15 01:41:11 +02:00
Andreas Boll
e3ff4d4c10 radeon/llvm: Fix CR/LF in AMDILSIDevice.h 2012-07-13 16:35:22 +00:00
Tom Stellard
cc3907856e radeon/llvm: Clean up AMDILIntrinsicInfo.cpp 2012-07-13 16:29:46 +00:00
Tom Stellard
f323c6260d radeon/llvm: Coding style fixes 2012-07-13 16:29:46 +00:00
Jon TURNEY
39d82a1b20 Fix linking gallium drivers and with dricore after defadf2b1
Commit defadf2b1 erroneously tries to make gallium drivers link with libdricore
as a static library, not a shared library

Also, change uses of DRI_LIB_DEPS in gallium driver Makefiles to
GALLIUM_DRI_LIB_DEPS, so the libraries added are used in the linking the gallium
driver

Also, fix the path to the libdricore.so symlink, it's made in LIB_DIR, not in
the libdricore directory

Also repair quoting of dricore settings of DRI_LIB_DEPS and GALLIUM_DRI_LIB_DEPS
variables so VERSION is interpolated in configure but TOP and LIB_DIR are
interpolated later (where they are known, but VERSION isn't)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-13 17:20:39 +01:00
Christoph Bumiller
9ed65301e0 nouveau: implement missing timer query functionality 2012-07-13 17:28:00 +02:00
Kristian Høgsberg
426a23af14 wayland: Stop trying to use make rules from aclocal, just copy and paste
Defeated by autotool, copy and paste to the rescue.

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

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-13 11:20:17 -04:00
José Fonseca
b3ba0a7afa mesa/st: Generates TGSI that always recognizes INSTANCEID/VERTEXID as integers.
Tested by running piglit draw-instanced, and by forcing llvmpipe advertise no native
integer support, which now produces:

VERT
DCL IN[0]
DCL SV[0], INSTANCEID
DCL OUT[0], POSITION
DCL OUT[1], COLOR
DCL CONST[0..19]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
DCL TEMP[2], LOCAL
DCL ADDR[0]
  0: U2F TEMP[0].x, SV[0]
  1: ARL ADDR[0].x, TEMP[0].xxxx
  2: MOV TEMP[1].xy, CONST[ADDR[0].x+8].xyxx
  3: ADD TEMP[2].x, IN[0].xxxx, TEMP[1].xxxx
  4: ADD TEMP[1].x, IN[0].yyyy, TEMP[1].yyyy
  5: MUL TEMP[2], CONST[16], TEMP[2].xxxx
  6: MAD TEMP[2], CONST[17], TEMP[1].xxxx, TEMP[2]
  7: MAD TEMP[2], CONST[18], IN[0].zzzz, TEMP[2]
  8: MAD TEMP[2], CONST[19], IN[0].wwww, TEMP[2]
  9: ARL ADDR[0].x, TEMP[0].xxxx
 10: MOV TEMP[1], CONST[ADDR[0].x]
 11: MOV OUT[0], TEMP[2]
 12: MOV OUT[1], TEMP[1]
 13: END
2012-07-13 13:01:52 +01:00
José Fonseca
6dddd18480 draw,gallivm: Fix draw_get_shader_param.
- Use LLVM limits when LLVM is being used, instead of TGSI limits
- Provide draw_get_shader_param_no_llvm for when llvm is never used (softpipe)
- Eliminate several of the hacks around draw shader caps in several drivers

Unfortunately the hack for PIPE_MAX_VERTEX_SAMPLERS is still necessary.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-13 13:01:51 +01:00
Jon TURNEY
99728076ec Don't explicitly link libOsmesa with libmesa's dependency libglsl
The libmesa convenience library is linked with the libglsl convenience
library.  libOsmesa is linked with libmesa, and also directly with libglsl.
When using libtool, this gives rise to duplicate symbol errors.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:44 +01:00
Jon TURNEY
b2a37e242e automake: convert libglapi
* "configure substitutions are not allowed in _SOURCES variables" in automake,
so remove the AC_SUBST'ed GLAPI_ASM_SOURCES and instead use some AM_CONDITIONALS
to choose which asm sources are used

* Change GLAPI_LIB to point to the .la file in other Makefile.am files, and make a link
to the .a file for the convenience of other Makefiles which have not yet been converted
to automake

v2:
- Use AM_CPPFLAGS for cleaner build output
- EXTRA_SOURCES is not needed
- Remove libglapi.a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:07 +01:00
Jon TURNEY
1e48dfeee6 Rename X86-64_API -> X86_64_API
automake doesn't allow hyphens in variable names

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:05 +01:00
Jon TURNEY
defadf2b15 Link dri drivers with mesa or dricore libtool library
Now mesa/drivers/dri is converted to automake, we want to update DRI_LIB_DEPS
so that we link with the libmesa or libdricore libtool library, as appropriate.

However, this is complicated by the fact that gallium/targets is not (yet)
converted, so we can't share the DRI_LIB_DEPS autoconf variable with that anymore.

Add an additional autoconf variable GALLIUM_DRI_LIB_DEPS, which is now used in
gallium/targets/Makefile.dri, to link with the libdircore or libmesa native library.

v2: libdricore$VERSION.a needs to be libdricore$(VERSION).a

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:03 +01:00
Jon TURNEY
cf362d00b9 Remove unused MESA_MODULES autoconf variable
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:01 +01:00
Jon TURNEY
a112ca5d5f automake: convert libmesa and libmesagallium
* "configure substitutions are not allowed in _SOURCES variables" in automake, so instead of
MESA_ASM_FILES, use some AM_CONDITIONALS to choose which architecture's asm sources are used
in libmesa_la_SOURCES. (Can't remove MESA_ASM_FILES autoconf variable as it's still used in
sources.mak)

* Update to link with the .la file in other Makefile.am files, and make a link to the
.a file for the convenience of other Makefiles which have not yet been converted to automake

v2: Remove stray -static from LDFLAGS
v3: Remove .a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:58 +01:00
Jon TURNEY
8676890018 Rename sparc/clip.S -> sparc/sparc_clip.S
Automake can't handle having both clip.S and clip.c, even though they have different paths

"src/mesa/Makefile.am: object `clip.lo' created by `$(SRCDIR)/sparc/clip.S' and `$(SRCDIR)/main/clip.c'"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:56 +01:00
Jon TURNEY
68e04cc601 automake: convert libglsl
v2: Use AM_V_GEN to silence generated code rules. Add BUILT_SOURCES to CLEANFILES
v3:
- Fix an accidental // in a path
- Use automake make rules for lex/yacc rather than writing our own
- Update .gitignore appropriately
- Build a libglcpp convenience library rather than awkwardly including
the files in libglsl and delegating the generation
- Remove libglsl.a compatibility link on clean
v4:
- Automake's rules for lex/yacc make .cc if source is .ll or .yy, and apparently we
must use those extensions "because of scons", so update everywhere glsl_parser.cpp
-> glsl_parser.cc and glsl_lexer.cpp -> glsl_lexer.cc. This fixes 'make tarballs'
and building with dricore enabled.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:41 +01:00
Laurent Carlier
284325d97b automake: convert libOSmesa
This also currently fix the installation of libOSmesa.

v2: Remove old Makefile, libOSmesa is now versioned, fix typos
v3: Keep config substitution alphabetized
v4: Update .gitignore
v5: Libraries will be in the builddir, not the srcdir.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:39 +01:00
Marek Olšák
1a06e8454e mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibility
This was not implemented, because the spec was changed just recently.

Everything has been in place already.

Gallium has PIPE_FORMAT_B5G6R5_UNORM, while Mesa has MESA_FORMAT_RGB565.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-13 01:36:07 +02:00
Kenneth Graunke
fe911c1d43 i965: Move loop over texture units into brw_populate_sampler_prog_key.
The whole reason I avoided this was because it might operate on a
brw_vertex_program or a brw_fragment_program.  However, that isn't a
problem: all we need is the gl_program base type.

This avoids awkwardly passing the loop counter 'i' as a parameter,
simplifies both callers, and also plumbs prog in place for future use.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 14:17:44 -07:00
Kenneth Graunke
86e401b771 i965: Always emit alpha when nr_color_buffers == 0.
If alpha-testing is enabled, we need to send alpha down the pipeline
even if nr_color_buffers == 0.  However, tracking whether alpha-testing
is enabled in the WM program key is expensive: it causes us to compile
multiple specializations of the same shader, using program cache space.

This patch removes the check for alpha-testing, and simply emits alpha
whenever nr_color_buffers == 0.  We believe this will also be necessary
for alpha-to-coverage, and it should add minimal overhead to an uncommon
case.  Saving the recompiles should more than make up the difference.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 13:35:46 -07:00
Kenneth Graunke
16060531ba i965: Use the blitter in intel_bufferobj_subdata for busy BOs on Gen6+.
Previously we only did this pre-Gen6, and used pwrite on Gen6+.
In one workload, this cuts significant amount of overhead.

v2: Simplify the function based on Eric's suggestions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 13:35:46 -07:00
José Fonseca
978807ef01 gallivm: Use %.9g to print floats.
So that we can see them in their full denormalized glory.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-12 21:14:35 +01:00
José Fonseca
5b8d80a783 scons: Remove -ffast-math.
We rely on proper IEEE 754 behavior in too many places for this.

See also commit 2fdbbeca43 with equivalent
change for autoconf.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-12 21:14:29 +01:00
José Fonseca
bd3aab8d79 scons: Also require recent XCB.
And don't trip when it's not found -- simply skip building src/glx.
2012-07-12 21:13:10 +01:00
Eric Anholt
6882381a2e mesa: Require current libxcb.
Without that, people with buggy apps that looked at just the server
string for GLX_ARB_create_context would call this function that just
threw an error when you tried to make a context.  Google shows plenty
of complaints about this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 12:29:12 -07:00
Tom Stellard
f92873be2c radeon/llvm: Don't use lp_build_swizzle_aos() for swizzles
This function assumes that lp_build_context::type is a vector type,
which is not true for r600 or radeonsi.

This fixes an assertion failure using glamor 2D accel.
2012-07-12 13:53:22 -04:00
Tom Stellard
185fc9a5ef radeonsi: Dump TGSI code prior to doing TGSI->LLVM conversion.
This way if the conversion fails, we know what the TGSI shader looks
like.
2012-07-12 13:53:22 -04:00
Kenneth Graunke
b546aebae9 i965: Delete previous workaround for textureGrad with shadow samplers.
It had many problems:
- The shadow comparison was done post-filtering.
- It required state-dependent recompiles whenever the comparison
  function changed.
- It didn't even work: many cases hit assertion failures.
- I never implemented it for the VS.

The new lowering pass which converts textureGrad to textureLod by
computing the LOD value works much better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:26 -07:00
Kenneth Graunke
b0c8d3be73 i965: Add a lowering pass to convert TXD to TXL by computing the LOD.
Intel hardware doesn't natively support textureGrad with shadow
comparisons.  So we need to generate code to handle it somehow.

Based on the equations of page 205 of the OpenGL 3.0 specification,
it's possible to compute the LOD value that would be selected given the
gradient values.  Then, we can simply convert the TXD to a TXL.

Currently, this passes 34/46 of oglconform's shadow-grad subtests;
four cubemap tests are regressed.  We should investigate this in the
future.

v2: Apply abs() to the scalar case (thanks to Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:23 -07:00
Kenneth Graunke
d9da350a83 glsl/ir_builder: Add a new swizzle_for_size() function.
This swizzles away unwanted components, while preserving the order of
the ones that remain.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:20 -07:00
Kenneth Graunke
0bb3d4ba54 glsl/ir_builder: Add a generic constructor for unary expressions.
I needed to compute logs and square roots in a patch I was working on,
and wanted to use the convenient interface.  We already have a similar
constructor for binops; adding one for unops seems reasonable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:18 -07:00
Kenneth Graunke
b656df990f glsl: Initialize coordinate to NULL in ir_texture constructor.
I ran into this while trying to create a TXS query, which doesn't have a
coordinate.  Since it didn't get initialized to NULL, a bunch of
visitors tried to access it and crashed.

Most of the time, this won't be a problem, but it's just a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:19:38 -07:00
José Fonseca
d9a8cd76e5 st/xorg: Fix build failure due to symbol clash. 2012-07-12 16:02:49 +01:00
Marek Olšák
0f3659bb56 docs: update relnotes-8.1 and GL3 status 2012-07-12 13:05:59 +02:00
Marek Olšák
63d8c8baa9 st/mesa: expose new transform feedback extensions 2012-07-12 13:05:59 +02:00
Marek Olšák
d24ece97e5 mesa: add ARB_transform_feedback_instanced extension enable flag
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
db7404defd mesa: implement new DrawTransformFeedback functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
7e0cb473b0 mesa: implement display list support for new DrawTransformFeedback functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
ce16ca4635 mesa: implement display list support for indexed query functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
553e13dbc2 mesa: implement indexed query functions from ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
375e73d859 mesa: implement glGet queries and error handling for ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
21cb5ed20d glsl: implement ARB_transform_feedback3 in the linker
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
9576d555e0 glapi: add ARB_transform_feedback_instanced
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
6d13d91f4e glapi: add ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
e773a48a3b r600g: fix uploading non-zero mipmap levels of depth textures
This fixes piglit/depth-level-clamp.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
fe1fd67556 r600g: don't flush depth textures set as colorbuffers
The only case a depth buffer can be set as a color buffer is when flushing.

That wasn't always the case, but now this code isn't required anymore.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
6842d5fced r600g: don't set dirty_db_mask for a flushed depth texture
A flush depth texture is never set as a depth buffer and never flushed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
5a17d8318e r600g: flush depth textures bound to vertex shaders
This was missing/broken. There are also minor code cleanups.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
dee58f94af r600g: do fine-grained depth texture flushing
- maintain a mask of which mipmap levels are dirty (instead of one big flag)
- only flush what was requested at a given point and not the whole resource
  (most often only one level and one layer has to be flushed)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
df79eb5956 r600g: remove is_flush from DSA state
we can just update the state when decompressing, there's no need to add
additional info into the DSA state

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
43e3f19c76 r600g: set DISABLE in CB_COLOR_CONTROL if colormask is 0
this will be useful for in-place DB decompression, otherwise should be harmless

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
4fe74412cf r600g: move CB_SHADER_MASK setup into cb_misc_state
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a1a1ff5ec0 r600g: move MULTIWRITE setup into cb_misc_state for r6xx-r7xx
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
0ea76916e6 r600g: move CB_TARGET_MASK setup into new cb_misc_state
to remove some overhead from draw_vbo. This is a derived state.

BTW, I've got no idea how compute interacts with 3D here, but it should
use cb_misc_state, so that 3D and compute don't conflict.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
5ba15d8d38 st/mesa: implement accelerated stencil blitting using shader stencil export
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a7f3697eb8 st/mesa: set colormask to zero when blitting depth
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
5a74e17ab0 gallium/u_blit: remove useless memset calls
the structure is calloc'd.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
24e0a26335 gallium/u_blit: drop not-very-useful wrapper around util_blit_pixels_writemask
just rename it to util_blit_pixels

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
3f13b5da15 gallium/u_blit: don't do two copies for non-2D textures
Because u_blit couldn't sample a 1D, 3D, CUBE and ARRAY texture, we created
a 2D texture holding a copy of one slice of the source texture (even for 1D).

Let's just do it right.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
2dca61bcb3 gallium/util: move pipe_tex_to_tgsi_tex helper function into u_inlines
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
bdaf0a085b gallium/u_blitter: accelerate stencil-only copying
This doesn't seem to be used by anything yet, but better safe than sorry.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
12fd81f9e7 gallium/u_blitter: accelerate depth-stencil copying using shader stencil export
This fixes stencil buffer write transfers on r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
76db2c121c gallium: add util_format_stencil_only helper function
used for stencil sampler views.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a730838a42 gallium/u_blitter: minify depth0 when initializing last_layer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
91cf9fe988 gallium/u_gen_mipmap: accelerate depth texture mipmap generation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
13b0af721a mesa: remove assertions that do not allow compressed 2D_ARRAY textures
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Paul Berry
33202b4876 i965/msaa: Enable CMS layout on Gen7 for the formats that support it.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:50 -07:00
Paul Berry
4ebbc76621 i965/msaa: Add CMS support to blorp.
This patch updates the blorp engine to properly handle the case where
the surface being textured from uses Gen7's CMS MSAA layout.  The
following changes were necessary:

- Before reading color values from the surface, we need to read from
  the MCS buffer using the ld_mcs sampler message.  This is done by
  the mcs_fetch() function, and the result is stored in the mcs_data
  register.  This only needs to be done once per pixel, since the MCS
  value is shared between all samples belonging to a pixel.

- When reading color values from the surface, we need to use the
  ld2dms sampler message instead of the ld2dss message, and we need to
  provide the value read from the MCS buffer as an argument.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
754953693d i965/msaa: Add CMS-related sampler messages to brw_defines.h.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
7b3263af69 i965/msaa: Set SURFACE_STATE properly when CMS MSAA is in use.
When a buffer using Gen7's CMS MSAA layout is bound to a texture or a
render target, the SURFACE_STATE structure needs to point to the MCS
buffer and to indicate its pitch.  This patch updates the functions
that emit SURFACE_STATE to handle CMS layout properly.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
0ba813506d i965/msaa: Add CMS MSAA settings to brw_structs.h.
Previously the DWORD used to control the CMS MSAA layout was just a
pad value, because we didn't use it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
ccae1b1cd7 i965/msaa: Allocate MCS buffer when CMS MSAA is in use.
To implement Gen7's CMS MSAA layout, we need an extra buffer, the MCS
(Multisample Control Surface) buffer.  This patch introduces code for
allocating and deallocating the buffer, and storing a pointer to it in
the intel_mipmap_tree struct.

No functional change, since the CMS layout is not enabled yet.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
1bd4d456cd i965/msaa: Add an enum to describe MSAA layout.
From the Ivy Bridge PRM, Vol 1 Part 1, p112:

    There are three types of multisampled surface layouts designated
    as follows:
      - IMS Interleaved Multisampled Surface
      - CMS Compressed Mulitsampled Surface
      - UMS Uncompressed Multisampled Surface

Previously, the i965 driver only used IMS and UMS formats, and
distinguished beetween them using the boolean
intel_mipmap_tree::msaa_is_interleaved.  To facilitate adding support
for the CMS format, this patch replaces that boolean (and other
booleans derived from it) with an enum
INTEL_MSAA_LAYOUT_{IMS,CMS,UMS}.  It also updates the terminology used
in comments throughout the driver to match the IMS/CMS/UMS terminology
used in the PRM.  CMS layout is not yet used.

The enum has a fourth possible value, INTEL_MSAA_LAYOUT_NONE, which is
used for non-multisampled surfaces.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
67b0f7c7dd i965/msaa: Move {rt,tex}_interleaved into blorp program key.
On Gen6, MSAA buffers always use an interleaved layout and non-MSAA
buffers always use a non-interleaved layout, so it is not strictly
necessary to keep track of the layout of the texture and render target
surfaces in the blorp program key.  However, it is cleaner to do so,
since (a) it makes the blorp compiler less dependent on implicit
knowledge about how the GPU pipeline is configured, and (b) it paves
the way for implementing compressed multisampled surfaces in Gen7.

This patch won't cause any redundant compiles, because the layout of
the texture and render target surfaces depends on other parameters
that are already in the blorp program key.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Kristian Høgsberg
2adfce4a18 mapi: Move GL_NV_draw_buffers extension to es_EXT.xml
We don't generate public entrypoints for GLES extensions, so move the
GL_NV_draw_buffers definition from ARB_draw_buffers.xml to es_EXT.xml.
When the extension is defined in ARB_draw_buffers.xml, we end up with a
public entry point for it, but no prototype, which gives an error when
compiled with --disable-asm and --disable-shared-glapi.

Instead, just move the GLES extension to es_EXT.xml so this doesn't happen.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:36 -04:00
Kristian Høgsberg
e6a33570b7 egl: Add EGL_WAYLAND_PLANE_WL attribute
This lets us specify the plane to create the image for for multiplanar
wl_buffers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:36 -04:00
Kristian Høgsberg
1aaec8c609 wayland-drm: Add protocol to create planar buffers 2012-07-11 15:28:35 -04:00
Kristian Høgsberg
379eb47ea6 wayland-drm: Pass struct wl_drm_buffer to the driver
We're going to extend this to support multi-plane buffers, so pass this
to the driver so it can access the details.
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
95bc0527e9 intel: Implement __DRIimage::createSubImage and bump supported version to 5
We use the new miptree offset to pick out the sub-image when we bind
the EGLImage to a texture.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
02ebad900d intel: Add offset field to miptree
This lets us specify an offset into the bo where the miptree starts,
which will let us set up a texture for a single plane in a planar buffer.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
44a2b57f93 intel: Add support for new __DRIimage formats 2012-07-11 15:28:34 -04:00
Kristian Høgsberg
c029834808 __DRIimage: version 5, add new formats and createSubImage
The additions in version 5 enables creating EGLImages for different planes
of a YUV buffer.  createImageFromName is still used to create the containing
__DRIimage, and createSubImage can then be used no that __DRIimage to create
__DRIimages that correspond to the y, u, and v planes (__DRI_IMAGE_FORMAT_R8)
or the uv planes (__DRI_IMAGE_FORMAT_RG88) for formats such as NV12 where
the u and v components are interleaved.  Packed formats such as YUYV etc
doesn't require any special treatment, we just sample those as a regular
ARGB texture.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:34 -04:00
Tom Stellard
c0f7fe7b79 r600g/compute: Disable growing the memory pool
The code for growing the memory pool (which is used for storing all of
the global buffers) wasn't working.  There seem to be two separate issues
with the memory pool code.  The first was the way it was growing the pool.
When the memory pool needed more space, it would:

1. Copy the data from the memory pool's backing texture to system memory.
2. Delete the memory pool's texture
3. Create a bigger backing texture for the memory pool.
4. Copy the data from system memory into the bigger texture.

The copy operations didn't seem to be working, and I suspect that since
they were using fragment shaders to do the copy, that there might have
been a problem with the mixing of compute and 3D state.

The other issue is that the size of 1D textures is limited, and I was
having trouble getting 2D textures to work.

I think these problems will be easier to solve once more code is shared
between 3D and compute, which is why I decided to disable it for now
rather than continue searching for a fix.
2012-07-11 17:53:54 +00:00
Tom Stellard
49ae102ee3 radeon/llvm: Use multiclasses for floating point loads
The original strategy for handling floating point loads, which was to
lower (f32 load) to (f32 bitcast (i32 load)) wasn't really working.  The
main problem was that the DAG legalizer couldn't handle replacing a node
with two results (load) with a node with only one result (bitcast).
2012-07-11 17:47:20 +00:00
Tom Stellard
bbdf3af857 radeon/llvm: Don't set the IMM bit in SMRD instruction definitions.
The IMM bit is already being set in SICodeEmitter.
2012-07-11 17:47:20 +00:00
Tom Stellard
d36499aa62 r600g/compute: Add more debugging output 2012-07-11 17:46:59 +00:00
Eric Anholt
f9b3e257d1 i965: Revert the VBOs-in-system-memory hack.
It didn't change performance on Lightsmark or Nexuiz, which both used
DYNAMIC_DRAW buffers, but it was killing performance (40% CPU wasted pwriting
buffers) on a closed-source app we're looking at.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 09:20:21 -07:00
Eric Anholt
b5c037f6b1 Add emacs setup for the docs/devinfo.html comment wrapping recommendation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-11 09:20:21 -07:00
Ian Romanick
a8724d85f8 glx/dri2: Add support for GLX_ARB_create_context_robustness
Add the infrastructure required for this extension.  There is no
xserver support and no driver support yet.  Drivers can enable this be
advertising DRI2 version 4 and accepting the
__DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
__DRI_CTX_ATTRIB_RESET_STRATEGY attribute in create context.

Some additional Mesa infrastructure is needed before drivers can do
this.  The GL_ARB_robustness spec, which all Mesa drivers already
advertise, requires:

    "If the behavior is LOSE_CONTEXT_ON_RESET_ARB, a graphics reset
    will result in the loss of all context state, requiring the
    recreation of all associated objects."

It is necessary to land this infrastructure now so that the related
infrastructure can land in the xserver.  The xserver has very long
release schedules, and the remaining Mesa parts should land long, long
before the next xserver merge window opens.

v2: Expose robustness as a DRI2 extension rather than bumping
__DRI_DRI2_VERSION.

v3: Add a comment explaining why dri2->base.version >= 3 is also
required for GLX_ARB_create_context_robustness.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 08:54:50 -07:00
Ian Romanick
de9ed51525 dri2: Hard-code the DRI2 version
This allows revising the dri_interface.h separately from adding driver
support.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 08:54:50 -07:00
Ian Romanick
2879f758b5 glapi: Apply Xorg indent rules to all files generated for the xserver
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 08:54:50 -07:00
Kenneth Graunke
a0698b000b docs: Update GL3.txt.
We neglected to list the deprecation model/forward compatible context
support.

inverse() has been done for a while.

None of us know what "highp change" means; GLSL 1.30 already added the
ability to recognize precision keywords, and it doesn't look like 1.40
has any new requirements there (precision keywords still have no meaning).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-10 16:53:49 -07:00
Chad Versace
551078bb62 mesa: Remove unneeded extern qualifiers
Remove 'extern' from the functions declared in texcompress_etc.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-10 16:51:19 -07:00
Vadim Girlin
3770847960 r600g: improve flushed depth texture handling v2
Use r600_resource_texture::flished_depth_texture for GPU access, and
allocate it in the VRAM. For transfers we'll allocate texture in the GTT
and store it in the r600_transfer::staging.

Improves performance when flushed depth texture is frequently used by the
GPU, e.g. in Lightsmark (~30%)

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-07-11 02:39:59 +04:00
Kenneth Graunke
860d5bdf98 i965: Add hardware context support.
With fixes and updates from Ben Widawsky and comments from Paul Berry.

v2: Use drm_intel_gem_context_destroy to destroy hardware context;
    remove useless initialization of hw_ctx, both suggested by Eric.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Acked-by: Paul Berry <stereotype441@gmail.com>
2012-07-10 15:09:58 -07:00
Ian Romanick
4fae5e32d5 mesa/test: Update name of GL_TIME_ELAPSED
4952caa caused the _EXT to fall off the name of this enum.  This is
fine.  Update the unit test to expect the new value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51956
2012-07-10 14:46:25 -07:00
Andreas Boll
40742fa686 docs/relnotes-8.0.4: fix html markup 2012-07-10 12:59:34 -07:00
Marek Olšák
67a8ee891b gallium/docs: document interface changes for timestamp query
the query type is already documented
2012-07-10 19:04:13 +02:00
Marek Olšák
a3fccafda9 identity: implement get_timestamp 2012-07-10 19:04:13 +02:00
Marek Olšák
e66d90ec6b noop: implement get_timestamp 2012-07-10 19:04:13 +02:00
Marek Olšák
642539e3f9 trace: implement get_timestamp 2012-07-10 19:04:12 +02:00
Marek Olšák
a471d268ec galahad: implement get_timestamp 2012-07-10 19:04:12 +02:00
Marek Olšák
768589e836 docs: update relnotes-8.1 and GL3 status 2012-07-10 19:04:12 +02:00
Marek Olšák
5ddcda060c softpipe: implement get_timestamp and expose ARB_timer_query
PIPE_QUERY_TIMESTAMP is already implemented and working.
2012-07-10 19:04:12 +02:00
Marek Olšák
21f78d2189 st/mesa: implement ARB_timer_query 2012-07-10 19:04:12 +02:00
Marek Olšák
bcc735aaca gallium: add QUERY_TIMESTAMP cap and get_timestamp screen function 2012-07-10 19:04:12 +02:00
Marek Olšák
d5a7866902 mesa: implement glGet(GL_TIMESTAMP) v2
This is adds a new driver function to retrieve the timestamp.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-10 19:04:12 +02:00
Marek Olšák
5094533040 mesa: add ARB_timer_query to the extension list
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
204777c5dc mesa: add QueryCounter display list support
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
f601dcdf70 mesa: implement TIMESTAMP query and glQueryCounter
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
4952caad2d glapi: add ARB_timer_query
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Ian Romanick
25fec2e9ca docs: Add 8.0.4 release notes
Also add news story.  Extra, extra!  Read all about it!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-10 09:05:39 -07:00
Eric Anholt
2d03f48a65 glsl: Add parsing for GLSL uniform blocks.
This doesn't do anything with the uniform block declarations yet, so
usage of those uniforms finds them to be undeclared.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:13:33 -07:00
Eric Anholt
912a429bc5 glsl: Don't hide the type of struct_declaration_list.
I've been trying to derive from this for UBO support, and the slightly
obfuscated types were putting me over the edge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:12:18 -07:00
Kenneth Graunke
532e99cbf2 glcpp: Add built-in #define for GL_ARB_uniform_buffer_object.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-09 11:11:59 -07:00
Vincent Lejeune
7fabb2b593 glsl: Parser handles "#extension GL_ARB_uniform_buffer_object"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:11:38 -07:00
Eric Anholt
f4fb6bf088 glsl: Reduce a bit of extra code in the merging of layout qualifiers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:05:33 -07:00
Eric Anholt
60a784d56e glsl: Take advantage of the layout qualifier flags union to clean up parsing.
The got_one variable was set iff one of the bits in flags.i was set.

v2: Fix incorrect dropping of the ARB_conservative_depth warning.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:04:45 -07:00
Tom Stellard
9b00edc79a r600g: Don't create a texture for the memory_pool during screen init
This fixes a segfault in r600_screen_create() introduced by
eb065f5d9d

Reported by tilman on irc.
2012-07-09 12:14:07 -04:00
Tom Stellard
76b44034b9 radeon/llvm: Rename namespace from AMDIL to AMDGPU 2012-07-09 13:43:11 +00:00
Tom Stellard
39323e8f79 r600g: Update number of gprs when adding a vertex instruction 2012-07-09 13:42:24 +00:00
Tom Stellard
da9c8a73ec r600g/compute: Use evergreen_cb() for binding RATs 2012-07-09 13:41:18 +00:00
Tom Stellard
960906d16b r600g: Add support for RATs in evergreen_cb() 2012-07-09 13:41:18 +00:00
Tom Stellard
eb065f5d9d r600g: Use a texture as the underlying resource for compute_memory_pool
This the first step towards being able to use evergreen_cb to bind RATs.
2012-07-09 13:41:18 +00:00
Tom Stellard
9d36441374 r600g: Add is_rat flag to r600_resource_texture 2012-07-09 13:41:18 +00:00
Tom Stellard
3d3194e93c r600g: Add r600_context_pipe_state_emit()
This function is used when dispatching compute shader in order to avoid
mixing compute and 3D registers in the context's dirty list.  This
allows the compute code to resuse 3D functions like evergreen_cb, which
return a struct r600_pipe_state and still have control over when and how
the register writes are emitted.
2012-07-09 13:41:17 +00:00
Tom Stellard
e00e1586dd r600g: Add pkt_flag parameter to r600_context_block_emit_dirty()
This allows the shader type bit to be set in the pm4 header when
emitting registers for compute shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
25145de03e r600g/compute: Move LOOP_CONST initialization to start_compute_cs atom 2012-07-09 13:41:17 +00:00
Tom Stellard
5016fe2d47 r600g: Add start_compute_cs atom to struct r600_context
The start_compute_cs atom initializes some config and context registers
to the values needed for running compute shaders.  When a compute shader
is dispatched, this atom is emitted after the start_cs_cmd atom, which
initializes registers that are common to both 3D and compute.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
38be0966c7 r600g: Add pkt_flag member to struct r600_command_buffer
Some packets require the shader type bit (bit 1) to be set when
used for compute shaders.  The pkt_flag will be initialized to
RADEON_CP_PACKET3_COMPUTE_MODE for any struct r600_command_buffer used
for dispatching compute shaders and it will be or'd against the result of
the PKT3 macro when adding a new packet to a struct r600_command buffer.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
7d0c17fe74 r600g: Only emit start_cs_cmd atom once for compute command streams 2012-07-09 13:41:17 +00:00
Marek Olšák
0a21b561c7 r600g: fix stencil texturing with Z32_FLOAT_S8X24_UINT 2012-07-09 13:58:00 +02:00
Marek Olšák
a460df9299 r600g: add assertions after translate_colorswap/colorformat/dbformat/texformat 2012-07-09 13:57:59 +02:00
Marek Olšák
c1e8c845ea r600g: inline r600_hw_copy_region 2012-07-09 13:57:59 +02:00
Marek Olšák
9974e9ac5d r600g: enable dual src blending on r7xx
No lockups here.
2012-07-09 13:57:59 +02:00
Marek Olšák
6657a7af61 r600g: use depth format from pipe_surface, not pipe_resource 2012-07-09 13:57:59 +02:00
Marek Olšák
b278aba423 r600g: use u_box_origin_2d helper function 2012-07-09 13:57:59 +02:00
Marek Olšák
1f50f463eb gallium/u_blitter: consolidate some state changes 2012-07-09 13:57:59 +02:00
Marek Olšák
22d032707e r600g: remove stray semicolon 2012-07-07 15:09:57 +02:00
Marek Olšák
461e9f99c7 docs: document ARB_blend_func_extended and EXT_texture_rg in relnotes-8.1
also sort the extensions
2012-07-07 15:09:57 +02:00
Eric Anholt
1e28f55ab7 i965/fs: Invalidate live intervals after copy propagation.
For copy propgation, we've dropped the use of a GRF in favor of a
(probably later) use of a different GRF.  This definitely requires
invalidating intervals.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:33 -07:00
Eric Anholt
2343fe9a5d i965/fs: Invalidate live intervals in passes that remove an instruction.
Since live intervals are based on ip, removing an instruction trashes
the intervals unless we were to go do some surgery.  These happen to
usually remove a use of a grf, so it's time to recalculate, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 release branch.
2012-07-06 14:20:33 -07:00
Eric Anholt
25ca9cc823 i965/vs: Move the other two src_reg/dst_reg constructors to brw_vec4.cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:33 -07:00
Eric Anholt
b2f5d4c3ec i965/vs: Move class functions to brw_vec4.cpp.
This has less impact than for the FS (4k savings), because it was partially
done already, but makes things more consistent.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:32 -07:00
Eric Anholt
fe27916ddf i965/fs: Move class functions from the header to .cpp files.
Cuts compile time for brw_fs.h changes from 2.7s to .7s and reduces
i965_dri.so size by 70k.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:32 -07:00
José Fonseca
8b1f1900d1 galahad: Check that texture format is supported. 2012-07-06 20:38:41 +01:00
José Fonseca
ff8ddf399a galahad: More detailed resource checks. 2012-07-06 20:22:29 +01:00
José Fonseca
f8e13e6d69 galahad: Fix zealous warnings. 2012-07-06 20:12:56 +01:00
José Fonseca
7bd926af89 galahad: Enumerate all methods that are missing. 2012-07-06 19:13:44 +01:00
José Fonseca
3d2550be9c galahad: Implement render_condition. 2012-07-06 18:45:14 +01:00
José Fonseca
5b45775e41 galahad: Don't implement context methods that are not implemented by the underlying pipe driver. 2012-07-06 18:38:51 +01:00
José Fonseca
3cb994afca galahad: Use debug_printf.
stderr is not visible on windows.
2012-07-06 18:38:39 +01:00
José Fonseca
1abb070633 galahad: Silence creation messages.
Let galahad warnings be true warnings.
2012-07-06 18:37:48 +01:00
José Fonseca
d78dee1671 galahad: Use reference counting when destroying the wraped objects.
As the wrapped pipe driver may hold internal references.
2012-07-06 18:35:44 +01:00
José Fonseca
fe602da63f galahad: Point to the galahad objects from the galahad sampler view.
And not the wraped driver's objects.
2012-07-06 18:35:32 +01:00
José Fonseca
04d29afb8b galahad: Don't defer index buffer when it's NULL. 2012-07-06 17:02:39 +01:00
José Fonseca
232073b0d9 target-helpers: Enable debug helpers only on debug builds.
Some of these helpers use debug_get_option, which works also on releases.
2012-07-06 15:05:16 +01:00
Marek Olšák
c445b0f76d st/mesa: only expose ARB_shader_bit_encoding with GLSL 1.3
I don't think it's possible or even useful to use the extension with GLSL 1.2.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-06 00:45:38 +02:00
Kristian Høgsberg
5f5746a692 egl_dri2: Reorganize the EGLImage constructors to share more code
We factor out all the EGL book-keeping into dri2_create_image() and
simplify the wayland case by using dupImage.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
1bb15c0a08 intel: Share common __DRIimage allocation code
We have the same switch and allocation code in two places.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
454fc07dde intel: Just look up image->internal_format using _mesa_get_format_base_format
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
e408c17767 intel: Remove unused __DRIimage::data_type field
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:06 -04:00
Brian Paul
bbe92dc608 svga: whitespace fixes 2012-07-05 08:07:26 -06:00
Brian Paul
76a6801240 Revert "mesa: #define fprintf to be __mingw_fprintf() on Mingw32"
This reverts commit cbffaf20e9.

Use the PRIx64 macro in the fprintf() call instead, as suggested
by Dylan Noblesmith.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:26 -06:00
Brian Paul
df2d81ea59 mesa: use the PRIx64 macro for printing 64-bit hexadecimal values
We'll revert the #define fprintf __mingw_fprintf change next.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:25 -06:00
Brian Paul
1ab37a2284 svga: implement TGSI_OPCODE_ROUND
ROUND and TRUNC are implemented with one function to reduce code duplication.
Note: ROUND isn't actually used yet, but probably will be soon.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:03 -06:00
Brian Paul
d594f72e16 svga: fix CMP translation for vertex shaders
Converting CMP to SLT+LRP didn't work when src2 or src3 was Inf/NaN.
That's the case for GLSL sqrt(0).  sqrt(0) actually happens in many
piglit auto-generated tests that use the distance() function.

v2: remove debug/devel code, per Jose

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
30f8575fde svga: properly implement TRUNC instruction
Was previously implemented with FLOOR.
Fixes quite a few piglit tests of float->int conversion, integer
division, etc.

v2: clean up left over debug/devel code, per Jose

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
0bd3a75de9 svga: fix register collision issue in emit_conditional()
If the 'dst' register is the same as the 'pass' register we'll generate
invalid code.  Use a temporary register in that case.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
9b3d87b092 svga: emit some debug messages when shader compilation fails 2012-07-05 07:59:20 -06:00
Eric Anholt
33526a2ffe intel: Fix a comment typo. 2012-07-04 13:59:14 -07:00
Gwenole Beauchesne
69f031cc19 mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x. 2012-07-04 15:26:22 -04:00
Kristian Høgsberg
3ed8d42853 GLES2: upgrade gl2ext.h to version 18099
Redo this commit, and remove the inclusion of gl2ext.h
from src/mapi/glapi/glapi_priv.h.  The include was added in
8f3be33985 to fix a missing prototype for
glDrawBuffersNV and others, but it's not possible to include both
glext.h and gl2ext.h from the same file.

I don't see the missing prototype here (with or without shared glapi)
so I'm just removing the offending #include.

Also, since we're redoing this, update to the most recent gl2ext.2.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-04 15:26:22 -04:00
Olivier Galibert
e620f3e763 mesa/st: gl_ClipDistance must be interpolated in 3d space.
That old bug was hidden but the clipper always interpolating in 3d space
no matter what it should have been doing.  Now that the interpolation
has been fixed, the bug shows up.

Fixes fdo 51364.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-07-04 10:47:14 +01:00
Stuart Abercrombie
95ce454c8c gallium/util: Save and restore vertex buffer state in util_gen_mipmap.
Calling glGenerateMipmap could overwrite vertex buffer state, leading
 to incorrect rendering or crashes depending on the Gallium driver.

This was happening on WebGL Conformance test texture-size.

Before 784dd51198 this was covered up
by redundant vertex buffer validation.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-04 03:48:29 +02:00
Marek Olšák
567fcd2eb9 Revert "GLES2: upgrade gl2ext.h to version 16994."
This reverts commit 8818b88748.

I get a lot of errors like this one:

In file included from ../../../src/mapi/glapi/glapi_priv.h:49:0,
                 from glapi_dispatch.c:40:
../../../include/GLES2/gl2ext.h:1074:28: error: redefinition of typedef ‘PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC’
../../../include/GL/glext.h:10237:25: note: previous declaration of ‘PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC’ was here

This with a clean build (with git clean -fdX).

I don't get the errors on my other machine. I didn't investigate why,
a wild guess is that this depends on the version of gcc.
2012-07-04 01:40:05 +02:00
Marek Olšák
2668aaa557 Revert "mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x."
This reverts commit d1665388ce.
2012-07-04 01:39:52 +02:00
Gwenole Beauchesne
d1665388ce mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x. 2012-07-03 16:23:38 -04:00
Gwenole Beauchesne
8818b88748 GLES2: upgrade gl2ext.h to version 16994. 2012-07-03 16:23:38 -04:00
Eric Anholt
dd4282e38f i965/fs: Allow copy propagation on uniforms.
This is a big win for savage2, hon and yofrankie.  62 new programs for
savage2/hon get 16-wide mode, along with one for humus demos and two
for tropics.  Even a few shaders from tropics see reductions of 15% or
more.

total instructions in shared programs: 216536 -> 207353 (-4.24%)
instructions in affected programs:     123941 -> 114758 (-7.41%)

In benchmarking Tropics, only a .040% +/- 034% performance improvement
was observed (n=90).  Rather disappointing, but I was primarily
motivated to do this patch by a regression in the number of 16-wide
shaders compiled after a GRF texturing on IVB patch I'm working on.
Hopefully this helps avoid that regression.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:57:10 -07:00
Eric Anholt
0c4630bae0 i965/fs: Allow copy propagation with source modifiers.
This shaves a few instructions off of a ton of programs.  For 12
shaders from tropics and sanctuary, it's enough reduction in register
pressure to get 16-wide mode.  7 shaders from heroes of newerth and
savage2 are hurt by about 1.1%, where copy propagation of negates ends
up preventing coalescing, but we could regain that by doing dataflow
analysis in our copy propagation.

No significant performance difference in tropics (n=11)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:57:04 -07:00
Eric Anholt
458f7f0141 i965/fs: Move copy propagation test out to a separate function.
It's going to get more complicated in a moment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:55:47 -07:00
Ian Romanick
5fb178ee43 glx/tests: Fix off-by-one error in allocating extension string buffer
NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50621
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=418161
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Markus Oehme <oehme.markus@gmx.de>
2012-07-03 12:28:45 -07:00
Brian Paul
1853f467c6 glsl: fix unop/binop errors in comments 2012-07-03 09:42:59 -06:00
Paul Berry
f34764ea53 msaa: Make meta-ops save and restore state of GL_MULTISAMPLE.
The meta-ops _mesa_meta_Clear() and _mesa_meta_glsl_Clear() need to
ignore the state of GL_SAMPLE_ALPHA_TO_COVERAGE,
GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
and GL_SAMPLE_COVERAGE_INVERT when clearing multisampled buffers.  The
easiest way to accomplish this is to disable GL_MULTISAMPLE during the
clear meta-ops.

Note: this patch also causes GL_MULTISAMPLE to be disabled during
_mesa_meta_GenerateMipmap() and _mesa_meta_GetTexImage() (since those
two meta-ops use MESA_META_ALL).  Arguably this isn't strictly
necessary, since those meta-ops use their own non-MSAA fbo's, but it
shouldn't do any harm.

Fixes Piglit tests "EXT_framebuffer_multisample/clear {2,4}
{color,stencil}" on i965.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-02 14:09:27 -07:00
Paul Berry
8313f44409 i965/msaa: Fix centroid interpolation of unlit pixels.
From the Ivy Bridge PRM, Vol 2 Part 1 p280-281 (3DSTATE_WM:
Barycentric Interpolation Mode):

    "Errata: When Centroid Barycentric mode is required, HW may
    produce incorrect interpolation results when a 2X2 pixels have
    unlit pixels."

To work around this problem, after doing centroid interpolation, we
replace the centroid-interpolated values for unlit pixels with
non-centroid-interpolated values (which are interpolated at pixel
centers).  This produces correct rendering at the expense of a slight
increase in shader execution time.

I've conditioned the workaround with a runtime flag
(brw->needs_unlit_centroid_workaround) in the hopes that we won't need
it in future chip generations.

Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
{centroid-deriv,centroid-deriv-disabled}".  All MSAA interpolation
tests pass now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 13:27:36 -07:00
Paul Berry
3f929efa28 i965/fs: Add FS_OPCODE_MOV_DISPATCH_TO_FLAGS to fragment shader backend.
In order to compute centroid varyings correctly, the fragment shader
needs to be able to load the current pixel/sample mask into a flag
register.  This patch adds an opcode to the fragment shader back-end
to do this; the opcode gets translated into the instruction

mov(1)  f0<1>UW  g1.14<0,1,0>UW  { align1 WE_all }

Since this instruction clobbers f0, instruction scheduling has to
treat it the same as instructions that have a conditional modifier.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 13:27:36 -07:00
Jordan Justen
8aa78c104a i965: fix transform feedback with primitive restart
When querying GL_PRIMITIVES_GENERATED, if primitive restart
is also used, then take the software primitive restart
path so GL_PRIMITIVES_GENERATED is returned correctly.

GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN is also updated
since it will also affected by the same issue.

As noted in brw_primitive_restart.c, with further work we
should be able to move this situation back to a hardware
handled path.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:42:48 -07:00
Kenneth Graunke
14311ef3f2 i965: Re-enable rendering to SNORM formats.
Commit d73f6375f5 fixed the cause of the Piglit failure with
ARB_color_buffer_float fragment clamp modes.  Now that it's fixed,
there's no reason to leave snorm format rendering disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:23:37 -07:00
Kenneth Graunke
b1802a2115 glsl: Remove unused ir_loop_jump::loop pointer.
Commit 0c005bd7 intended to make ir_loop_jump::mode public, but also
accidentally added a new pointer to the enclosing loop.  Furthermore, it
tried to initialize the new field by adding "this->loop = loop;" to the
constructor, but since there is no loop parameter, this only initialized
the field to itself---so it will likely be a garbage pointer.

A lot of code, such as lower_jumps, allocates new loop jumps without
setting this field appropriately, so any uses would probably just crash.

Thankfully, there were none, so we can just delete the field.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51574
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 11:08:59 -07:00
Kenneth Graunke
d73f6375f5 meta: Don't alter fragment color clamp in DrawPixels().
DrawPixels uses the MESA_META_CLAMP_FRAGMENT_COLOR flag to save/restore
the fragment color clamp mode.  This is unnecessary since it never
alters it.  It's also harmful: when the clamp mode is GL_FIXED_ONLY,
setting this flag causes _mesa_meta_begin to force it to GL_FALSE,
breaking clamping on SNORM formats.

DrawPixels should use the user-specified clamp mode and not change it.

Fixes Piglit's spec/ARB_color_buffer_float/GL_RGBA8_SNORM-drawpixels
test on i965/Sandybridge (with SNORM render targets re-enabled).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:08:48 -07:00
Marek Olšák
9f0f2f9512 mesa: use FLUSH_CURRENT and not FLUSH_VERTICES in _mesa_validate_*
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL calls FLUSH_VERTICES, which
is not what we want.

This fixes a breakage in classic drivers, introduced in:

  62b9716739
  vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around

It should fix:
  https://bugs.freedesktop.org/show_bug.cgi?id=51629
  https://bugs.freedesktop.org/show_bug.cgi?id=51642

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-02 17:48:36 +02:00
Dylan Noblesmith
876889b355 mesa: point to Makefile.old in the srcdir
Gets out-of-tree builds slightly closer to working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:46 +00:00
Dylan Noblesmith
91ecba9d05 mesa: fix parser source gen for out-of-tree builds
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:39 +00:00
Dylan Noblesmith
261b1389eb mesa: fix api source gen for out-of-tree builds
Add $(srcdir) where needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:27 +00:00
Dylan Noblesmith
43bca86c1b glapi/gen: fix out of tree build
Add "-f $(srcdir)/gl_API.xml" to the arguments of all
the scripts that by default look for gl_API.xml in the
working directory when run with no arguments, and prepend
$(srcdir) to those scripts that are already using an
explicit -f argument.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:13:58 +00:00
José Fonseca
f5c41e16d7 gallium/tgsi: Don't declare temps individually when they are all similar.
tgsi_ureg was recently enhanced to support local temporaries, and as result
temps are declared individually.

This change avoids many TEMP register declarations on common shaders.

(And fixes performance regression due to mismatches against performance
sensitive shaders.)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-02 12:14:53 +01:00
José Fonseca
e75fe7ba08 gallivm: Cleanup the 4 x float -> 16 ub special path in lp_build_conv.
No behaviour change intended.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-02 12:13:52 +01:00
José Fonseca
63e0e4b8f5 gallium/util: Add ULL suffix to large constants.
As suggested by Andy Furniss: it looks like some old gcc versions
require it.
2012-07-02 12:12:42 +01:00
Tom Stellard
1d21bd057a clover: Handle NULL devs argument in clBuildProgram
If devs is NULL, then the kernel should be compiled for all devices
associated with the program.
2012-07-01 15:45:24 +02:00
Francisco Jerez
c6bb41c28b clover: Define non-templated copy constructor for clover::ref_ptr.
The templated copy constructor doesn't prevent the compiler from
emitting a default copy constructor, which leads to inconsistent
memory handling and was reported to cause segfaults when doing event
manipulation.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-01 15:37:30 +02:00
Brian Paul
db2b6ca504 llvmpipe: fix comment typo 2012-06-29 17:19:12 -06:00
Brian Paul
9dfe92019a st/mesa: use DEBUG_INCOMPLETE_FBO debug flag 2012-06-29 17:19:12 -06:00
Brian Paul
b186a9df32 mesa: remove some unused gl_dlist_state fields 2012-06-29 17:19:12 -06:00
Tom Stellard
ca8fa02308 clover: Add a function internalizer pass before LTO v2
The function internalizer pass marks non-kernel functions as internal,
which enables optimizations like function inlining and global dead-code
elimination.

v2:
  - Pass vector arguments by const reference
2012-06-29 18:46:18 +00:00
Tom Stellard
a31b2f7107 radeon/llvm: Enable vec4 loads on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
e17c586d08 radeon/llvm: Enable floating point stores on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
b66ef1f48c radeon/llvm: Handle floating point loads on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
c01199dfc0 radeon/llvm: Expand UDIV and UREM nodes 2012-06-29 18:46:18 +00:00
Tom Stellard
2c485cda20 radeon/llvm: Emit raw ISA for vertex fetch instructions 2012-06-29 18:46:18 +00:00
José Fonseca
16e0ebccb6 gallium/util: Truly disable INF/NAN tests on MSVC.
Thanks to Brian for spotting this.
2012-06-29 14:49:23 +01:00
José Fonseca
c9bada497c gallium/util: Disable INF/NAN tests on MSVC.
Somehow they are not recognized as constants.
2012-06-29 13:39:07 +01:00
José Fonseca
fa8dcb848f translate: Free elt8_func/elt16_func too.
These were leaking.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-06-29 12:21:08 +01:00
James Benton
6dd8e6f9cb util: Reimplement half <-> float conversions.
Removed u_half.py used to generate the table for previous method.

Previous implementation of float to half conversion was faulty for
denormalised and NaNs and would require extra logic to fix,
thus making the speedup of using tables irrelevant.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:21:02 +01:00
James Benton
c8d3481cdb tests: Updated tests to properly handle NaN for half floats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:59 +01:00
James Benton
60dca53833 util: Updated u_format_tests to rigidly test half-float boundary values.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:57 +01:00
James Benton
d069d8ef38 util: Added functions for checking NaN / Inf for double and half-floats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:54 +01:00
James Benton
34075d4133 util: Added util_format_is_array.
This function checks whether a format description is in a simple array format.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:37 +01:00
Marek Olšák
fcebb157f0 vbo: optimize validation for glMultiDrawElements
Some parameters need to be checked only once.
check_valid_to_render needs to be called only once.

The validate function is based on the one for DrawElements.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
62b9716739 vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
d9eb1a1225 vbo: don't call twice _mesa_valid_to_render in DrawArraysInstancedBaseInstance
It's called in _mesa_validate_DrawArraysInstanced already.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
15ac66e331 mesa: rename MaxTransformFeedbackSeparateAttribs to MaxTransformFeedbackBuffers
This is a cleanup for ARB_transform_feedback3, where
GL_MAX_TRANSFORM_FEEDBACK_BUFFERS is introduced for interleaved attribs and
has the same meaning as GL_MAX_.._SEPARATE_ATTRIBS for separate attribs.

Also, the maximum number of TFB buffers is reduced from 32 to 4, which makes
this patch useful even without the extension.
I don't know of any hardware which can do more than 4.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
José Fonseca
638779e445 gallivm: Refactor lp_build_broadcast(_scalar) to share code.
Doesn't really change the generated assembly, but produces more compact IR,
and of course, makes code more consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 20:20:34 +01:00
Johannes Obermayr
bf679ce1dc gallivm: Fix potential buffer overflowing in strncat.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-28 11:47:23 +01:00
Marcin Slusarz
1906d2b46b nv50: dynamically allocate space for shader local storage
Fixes 21 piglit tests:
spec/glsl-1.10/execution/variable-indexing/
fs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-row-wr

spec/glsl-1.20/execution/variable-indexing/
fs-temp-array-mat3-index-col-row-rd
fs-temp-array-mat3-index-row-rd
fs-temp-array-mat4-col-row-wr
fs-temp-array-mat4-index-col-row-rd
fs-temp-array-mat4-index-col-row-wr
fs-temp-array-mat4-index-row-rd
fs-temp-array-mat4-index-row-wr
vs-temp-array-mat3-index-col-row-rd
vs-temp-array-mat3-index-col-row-wr
vs-temp-array-mat3-index-row-rd
vs-temp-array-mat3-index-row-wr
vs-temp-array-mat4-col-row-wr
vs-temp-array-mat4-index-col-row-rd
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-wr
vs-temp-array-mat4-index-row-rd
vs-temp-array-mat4-index-row-wr
vs-temp-array-mat4-index-wr

... and prevents a lot of GPU lockups
2012-06-28 00:01:02 +02:00
Marcin Slusarz
0fceaee4fd nv50: streamline screen_create error handling
Remove macro which changes control flow (it's evil).
Make all fail paths print (correct) error message.
2012-06-28 00:01:02 +02:00
Marcin Slusarz
96259b5128 nv50/ir: make colorful ir dump output optional 2012-06-28 00:01:02 +02:00
Brian Paul
9881bf6e69 mesa: more const qualifiers to match the latest glext.h
For some reason regular gcc on Linux didn't catch these but the mingw
compiler did (generated errors, not warnings).

v2: include the changes in src/mapi/ too
2012-06-27 15:37:10 -06:00
Brian Paul
827bdee7d1 glapi: add const qualifier to glShaderSourceARB() parameter
Fixes the es2 build with gcc.

Note: in glext.h the prototypes for glShaderSource() and glShaderSourceARB()
disagree:  only the former has the extra const qualifier.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-27 15:37:10 -06:00
Jordan Justen
3588098ed8 i965: enable ARB_instanced_arrays extension
Set the step_rate value when drawing to implement
ARB_instanced_arrays for gen >= 4.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-27 10:35:14 -07:00
Brian Paul
8fb1e4a462 glsl: be more careful about counting varying vars in the linker
Previously, we were counting gl_FrontFacing, gl_FragCoord and gl_PointCoord
against the limit of varying variables.  This prevented some valid shaders
from linking.

The other potential solution to this is to have the driver advertise
more varying vars or set the GLSLSkipStrictMaxVaryingLimitCheck flag.
But the above-mentioned variables aren't conventional varying attributes
so it doesn't seem right to count them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-27 11:31:16 -06:00
Andreas Boll
d9d84068e7 docs/helpwanted: add some useful todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-27 11:19:21 -06:00
Brian Paul
098aa5f9ab softpipe: fix numFragsEmitted debug code 2012-06-27 07:50:57 -06:00
Brian Paul
81e2a238bc gallium: minor whitespace, comment changes 2012-06-27 07:50:57 -06:00
Brian Paul
51b0a0b33c mesa: update glext.h to version 81 2012-06-27 07:50:57 -06:00
Brian Paul
52dd8961eb mesa: update glxext.h to version 33 2012-06-27 07:50:57 -06:00
Brian Paul
8459f4a63a mesa: make _mesa_reference_array_object() an inline function
As we do for texture objects, buffer objects, etc.
2012-06-27 07:50:57 -06:00
Brian Paul
dcf1dafa9e mesa: look up enum name for glEnable/Disable errors 2012-06-27 07:50:56 -06:00
Brian Paul
86ccd9aaac mesa: move TEXGEN defines closer to gl_texgen struct 2012-06-27 07:50:56 -06:00
Brian Paul
4cb3579e52 mesa: rename ColorMaterialBitmask to _ColorMaterialBitmask
Since it's a derived field.
2012-06-27 07:50:56 -06:00
Brian Paul
b114ff3783 mesa: re-order, update comments on lighting-related structs 2012-06-27 07:50:56 -06:00
José Fonseca
d1c5ea9207 gallium/util: Fix parsing of options with underscore.
For example

  GALLIVM_DEBUG=no_brilinear

which was being parsed as two options, "no" and "brilinear".
2012-06-27 11:16:18 +01:00
James Benton
789436f1e0 gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.
Updated lp_build_printf to share common code.
Removed specific lp_build_print_vecX.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-27 11:16:18 +01:00
Stéphane Marchesin
45fc069600 i915g: Implement sRGB textures
Since we don't have them in hw we emulate them in the shader. Although not
recommended by the spec it is legit.

As a side effect we also get GL 2.1. I think this is as far as we can take
the i915.
2012-06-26 23:18:15 -07:00
Brian Paul
3bc39414ab svga: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 17:03:33 -06:00
Brian Paul
ac8613c298 llvmpipe: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 17:03:33 -06:00
Carl Worth
d8e61f8f86 glsl: glcpp: Extend testing of #line directives
The most recent commit adds support for comments and macro expansion
on #line directives. Add testing to verify the new features.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:23:55 -07:00
Carl Worth
aac78ce823 glsl: glcpp: Move handling of #line directives from lexer to parser.
The GLSL specification requires that #line directives be interpreted
after macro expansion. Our existing implementation of #line macros in
the lexer prevents conformance on this point.

Moving the handling of #line from the lexer to the parser gives us the
macro expansion we need. An additional benefit is that the
preprocessor also now supports comments on the same line as #line
directives.

Finally, the preprocessor now emits the (fully-macro-expanded) #line
directives into the output. This allows the full GLSL compiler to also
see and interpret these directives so it can also generate correct
line numbers in error messages.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:23:49 -07:00
Carl Worth
39f8c46eaa glsl: glcpp: Rename and document _glcpp_parser_expand_if
This function is currently used only in the expansion of #if lines,
but we will soon be using it more generally (for the expansion of
(_glcpp_parser_expand_and_lex_from) and some more documentation.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:21:16 -07:00
Carl Worth
1db463ce2e glsl: Consistently use length-based ralloc string functions for info_log.
Commit b823b99ec0 switched from using
functions such as ralloc_asprintf and ralloc_strcat to
ralloc_asprintf_rewrite_tail. This change maintains the string's
length as a aparamter that is updated by the ralloc functions (rather
than recomputing it with strlen over and over).

However, the change failed to updated two locations (glcpp_error and
glcpp_warning), with the result that the string's length wasn't
updated by these calls. Then, subsequent calls to other
ralloc_asprintf_rewrite_tail would overwrite the text appended by
glcpp_error.

This commit fixes the two missing updates, and restores line numbers
to the output of glcpp error messages, (as noticed by a glcpp unit
test case that has been failing since the above-mentioned commit).

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:20:53 -07:00
Carl Worth
c96b8302a3 glsl: glcpp: Allow "#if undefined-macro' to evaluate to false.
A strict reading of the GLSL specification would have this be an
error, but we've received reports from users who expect the
preprocessor to interepret undefined macros as 0. This is the standard
behavior of the rpeprocessor for C, and according to these user
reports is also the behavior of other OpenGL implementations.

So here's one of those cases where we can make our users happier by
ignoring the specification. And it's hard to imagine users who really,
really want to see an error for this case.

The two affected tests cases are updated to reflect the new behavior.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:20:03 -07:00
Jerome Glisse
b75f1d973c r600g: enable DUAL_EXPORT mode when possible on r6xx/r7xx
DUAL_EXPORT can be enabled on r6xx/r7xx when all CBs use 16-bit export
and there is no depth/stencil export.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
470d00c0e2 r600g: enable DUAL_EXPORT mode when possible
It seems DUAL_EXPORT on evergreen may be enabled when all CBs use 16-bit export
mode (EXPORT_4C_16BPC), also there should be at least one CB, and the PS
shouldn't export depth/stencil.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
0c47d9dcab r600g: avoid unnecessary shader exports v2
In some cases TGSI shader has more color outputs than the number of CBs,
so it seems we need to limit the number of color exports. This requires
different shader variants depending on the nr_cbufs, but on the other hand
we are doing less exports, which are very costly.

v2: fix various piglit regressions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
4acf71f01e r600g: cache shader variants instead of rebuilding v3
Shader variants are stored in the list, the key for lookup is based on the
states that require different hw shaders - currently it's rctx->two_side (all
gpus) and rctx->nr_cbufs (evergreen/cayman, when writes_all property is set).

v2:
 - use simple list instead of keymap as suggested by Marek on irc
 - call r600_adjust_gprs from r600_bind_vs_shader for r6xx/r7xx
   (r600_shader_select isn't used for vertex shaders currently)

v3:
 - fix call to r600_adjust_gprs - do it after updating current shader

Improves performance for some apps, e.g. FlightGear -
see https://bugs.freedesktop.org/show_bug.cgi?id=50360

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-06-27 02:06:55 +04:00
Brian Paul
55a89889ba svga: handle missing PIPE_CAP_x queries
And fix incorrect error message for a bad shader type/number.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 15:03:44 -06:00
Brian Paul
056e9b4511 llvmpipe: handle more PIPE_CAP_x queries
As with the previous commit for softpipe.

v2: remove 'default' case to get compile-time warning

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 15:03:44 -06:00
Brian Paul
7d23dcdacc softpipe: handle more PIPE_CAP_x queries
These all return zero.  Add a debug_printf() to catch the default case so
we don't accidently mishandle something important in the future.

v2: remove 'default' case to get compile-time warning

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 15:03:43 -06:00
Brian Paul
80efb524ee svga: return 1 for PIPE_CAP_MIXED_COLORBUFFER_FORMATS
This is actually required for GL_ARB_framebuffer_object, but the state
tracker doesn't currently check it.
Direct3D 9 allows mixed format color buffers with some restrictions.
Setting this allows Unigine Heaven 2.5 and 3.0 to run.  Tested both on
GL and D3D hosts.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-06-26 15:03:43 -06:00
Brian Paul
36b3ee2ffc glsl: fix comment typo 2012-06-26 10:01:03 -06:00
Olivier Galibert
27e94ba4ea u2f_emit: Fix type parameter in LLVM call.
The type is the destination type (i.e. float vector) and not the
source type.  Fixes piglit fs-{in,de}crement-uint.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 16:55:40 +01:00
Paul Berry
6c355cca91 i965/msaa: Set KILL_ENABLE when GL_ALPHA_TO_COVERAGE enabled.
i965 hardware needs to be informed of situations in which it's
possible for pixels (or samples) to be discarded for reasons other
than depth/stencil testing (e.g. due to an explicit "discard" in the
fragment shader).  One of these situations is when
GL_ALPHA_TO_COVERAGE is enabled, since that can cause samples to be
discarded by the color calculator when the pixel's alpha value is less
than 1.0.

Without this patch, GL_ALPHA_TO_COVERAGE does not take effect on depth
buffers.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
Paul Berry
bc53e14d98 i965/msaa: Implement GL_SAMPLE_ALPHA_TO_{COVERAGE,ONE}.
This patch enables the multisampling parameters
GL_SAMPLE_ALPHA_TO_COVERAGE and GL_SAMPLE_ALPHA_TO_ONE, which allow
the fragment shader's alpha output to be converted into a sample
coverage mask and ignored for blending.  i965 supports these
parameters through the BLEND_STATE structure.

The GL spec allows, but does not require, the implementation to dither
the conversion from alpha to a sample coverage mask, so that alpha
values that aren't a multiple of 1/num_samples result in the correct
proportion of samples being lit.  A bit exists in the BLEND_STATE
structure to enable this functionality, but according to the hardware
docs it must be disabled on Sandy Bridge (see the Sandy Bridge PRM,
Vol2, Part1, p379: AlphaToCoverage Dither Enable).  So it is enabled
for Gen7 only.

Fixes piglit tests
"EXT_framebuffer_multisample/sample-alpha-to-{coverage,one} {2,4}".

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
Paul Berry
9ea60ce58f i965/msaa: Implement glSampleCoverage.
This patch enables glSampleCoverage() functionality, which allows the
client program to specify that only a portion of the samples be lit up
when performing multisampled rendering.  i965 supports
glSampleCoverage() through the 3DSTATE_SAMPLE_MASK command packet,
which allows the driver to specify a bitfield indicating which samples
to light up.

Fixes piglit tests "EXT_framebuffer_multisample/sample-coverage {2,4}
{inverted,non-inverted}".

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
José Fonseca
4bde1ba7fb st/wgl: Add a few more comments. 2012-06-26 10:15:36 +01:00
Marek Olšák
cc2cd8b356 r600g: don't disable streamout if it hasn't been started 2012-06-26 03:37:24 +02:00
Marek Olšák
496399d8e9 u_blitter: disable streamout before rendering
This fixes piglit EXT_transform_feedback tests:
- intervening-read output
- intervening-read prims_written
2012-06-26 03:37:23 +02:00
Chad Versace
cf0bbb30f6 i965/fs: Fix conversions float->bool, int->bool
Fixes gles2conform GL.equal.equal_bvec2_frag.

This fixes brw_fs_visitor's translation of ir_unop_f2b.  It used CMP to
convert the float to one of 0 or ~0. However, the convention in the
compiler is that true is represented by 1, not ~0. This patch adds an AND
to convert ~0 to 1.

By inspection, a similar problem existed with ir_unop_i2b, with a similar
fix.

[v2 kayden]: eliminate extra temporary register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49621
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-25 15:56:40 -07:00
2348 changed files with 128744 additions and 186388 deletions

View File

@@ -3,6 +3,7 @@
(tab-width . 8)
(c-basic-offset . 3)
(c-file-style . "stroustrup")
(fill-column . 78)
(eval . (progn
(c-set-offset 'innamespace '0)
(c-set-offset 'inline-open '0)))

7
.gitignore vendored
View File

@@ -4,6 +4,7 @@
*.ilk
*.la
*.lo
*.log
*.o
*.obj
*.os
@@ -17,6 +18,7 @@
*.tar
*.tar.bz2
*.tar.gz
*.trs
*.zip
*~
depend
@@ -36,8 +38,9 @@ config.py
build
libtool
manifest.txt
Makefile.in
.dir-locals.el
.deps/
.dirstamp
.libs/
/Makefile
Makefile
Makefile.in

View File

@@ -34,20 +34,20 @@ LOCAL_C_INCLUDES += \
$(MESA_TOP)/include
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
major := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
minor := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
LOCAL_CFLAGS += \
-DANDROID_VERSION=0x0$(major)0$(minor)
-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
LOCAL_CFLAGS += \
-DPTHREADS \
-DHAVE_PTHREAD=1 \
-fvisibility=hidden \
-Wno-sign-compare
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += \
-DUSE_X86_ASM
-DUSE_X86_ASM \
-DHAVE_DLOPEN \
endif
endif

View File

@@ -30,6 +30,11 @@
# module will also be built. DRI modules will be loaded by libGLES_mesa.
MESA_TOP := $(call my-dir)
MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
MESA_ANDROID_MINOR_VERSION := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
MESA_ANDROID_VERSION := $(MESA_ANDROID_MAJOR_VERSION).$(MESA_ANDROID_MINOR_VERSION)
MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
MESA_PYTHON2 := python

View File

@@ -21,43 +21,37 @@
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4
doxygen:
cd doxygen && $(MAKE)
check-local:
$(MAKE) -C src/mapi/glapi/tests check
$(MAKE) -C src/mapi/shared-glapi/tests check
$(MAKE) -C src/mesa/main/tests check
$(MAKE) -C src/glsl/tests check
$(MAKE) -C src/glx/tests check
clean-local:
-@touch $(top_builddir)/configs/current
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@test -s $(top_builddir)/configs/current || rm -f $(top_builddir)/configs/current
distclean-local:
-rm -rf lib*
-rm -f $(top_builddir)/configs/current
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
.PHONY: doxygen
# Rules for making release tarballs
PACKAGE_VERSION=8.1-devel
PACKAGE_VERSION=9.1-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
bin/ar-lib \
bin/compile \
bin/config.sub \
bin/config.guess \
bin/depcomp \
bin/install-sh \
bin/ltmain.sh \
bin/missing \
bin/ylwrap \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
@@ -72,17 +66,17 @@ EXTRA_FILES = \
src/mesa/main/api_exec_es2_remap_helper.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h
src/mesa/program/program_parse.tab.h \
`git ls-files | grep "Makefile.am" | sed -e "s/Makefile.am/Makefile.in/"`
IGNORE_FILES = \
-x autogen.sh
parsers: configure
-@touch $(top_builddir)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \

View File

@@ -1,119 +0,0 @@
# A few convenience macros for Mesa, mostly to keep all the platform
# specifics out of configure.ac.
# MESA_PIC_FLAGS()
#
# Find out whether to build PIC code using the option --enable-pic and
# the configure enable_static/enable_shared settings. If PIC is needed,
# figure out the necessary flags for the platform and compiler.
#
# The platform checks have been shamelessly taken from libtool and
# stripped down to just what's needed for Mesa. See _LT_COMPILER_PIC in
# /usr/share/aclocal/libtool.m4 or
# http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=blob;f=libltdl/m4/libtool.m4;hb=HEAD
#
AC_DEFUN([MESA_PIC_FLAGS],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_ARG_VAR([PIC_FLAGS], [compiler flags for PIC code])
AC_ARG_ENABLE([pic],
[AS_HELP_STRING([--disable-pic],
[compile PIC objects @<:@default=enabled for shared builds
on supported platforms@:>@])],
[enable_pic="$enableval"
test "x$enable_pic" = x && enable_pic=auto],
[enable_pic=auto])
# disable PIC by default for static builds
if test "$enable_pic" = auto && test "$enable_static" = yes; then
enable_pic=no
fi
# if PIC hasn't been explicitly disabled, try to figure out the flags
if test "$enable_pic" != no; then
AC_MSG_CHECKING([for $CC option to produce PIC])
# allow the user's flags to override
if test "x$PIC_FLAGS" = x; then
# see if we're using GCC
if test "x$GCC" = xyes; then
case "$host_os" in
aix*|beos*|cygwin*|irix5*|irix6*|osf3*|osf4*|osf5*)
# PIC is the default for these OSes.
;;
mingw*|os2*|pw32*)
# This hack is so that the source file can tell whether
# it is being built for inclusion in a dll (and should
# export symbols for example).
PIC_FLAGS="-DDLL_EXPORT"
;;
darwin*|rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
PIC_FLAGS="-fno-common"
;;
hpux*)
# PIC is the default for IA64 HP-UX and 64-bit HP-UX,
# but not for PA HP-UX.
case $host_cpu in
hppa*64*|ia64*)
;;
*)
PIC_FLAGS="-fPIC"
;;
esac
;;
*)
# Everyone else on GCC uses -fPIC
PIC_FLAGS="-fPIC"
;;
esac
else # !GCC
case "$host_os" in
hpux9*|hpux10*|hpux11*)
# PIC is the default for IA64 HP-UX and 64-bit HP-UX,
# but not for PA HP-UX.
case "$host_cpu" in
hppa*64*|ia64*)
# +Z the default
;;
*)
PIC_FLAGS="+Z"
;;
esac
;;
linux*|k*bsd*-gnu)
case `basename "$CC"` in
icc*|ecc*|ifort*)
PIC_FLAGS="-KPIC"
;;
pgcc*|pgf77*|pgf90*|pgf95*)
# Portland Group compilers (*not* the Pentium gcc
# compiler, which looks to be a dead project)
PIC_FLAGS="-fpic"
;;
ccc*)
# All Alpha code is PIC.
;;
xl*)
# IBM XL C 8.0/Fortran 10.1 on PPC
PIC_FLAGS="-qpic"
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*|*Sun\ F*)
# Sun C 5.9 or Sun Fortran
PIC_FLAGS="-KPIC"
;;
esac
esac
;;
solaris*)
PIC_FLAGS="-KPIC"
;;
sunos4*)
PIC_FLAGS="-PIC"
;;
esac
fi # GCC
fi # PIC_FLAGS
AC_MSG_RESULT([$PIC_FLAGS])
fi
AC_SUBST([PIC_FLAGS])
])# MESA_PIC_FLAGS

View File

@@ -3,17 +3,11 @@
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
SRCDIR=`(cd "$srcdir" && pwd)`
ORIGDIR=`pwd`
if test "x$SRCDIR" != "x$ORIGDIR"; then
echo "Mesa cannot be built when srcdir != builddir" 1>&2
exit 1
fi
MAKEFLAGS=""
cd "$srcdir"
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
"$srcdir"/configure "$@"

1
bin/.gitignore vendored
View File

@@ -6,3 +6,4 @@ install-sh
ylwrap
compile
ar-lib
/test-driver

29
bin/get-pick-list.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
# Script for generating a list of candidates for cherry-picking to a stable branch
# Grep for commits with "cherry picked from commit" in the commit message.
git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
grep "cherry picked from commit" |\
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: This is a candidate' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
if [ -f bin/.cherry-ignore ] ; then
if grep -q ^$sha bin/.cherry-ignore ; then
continue
fi
fi
# Check to see if it has already been picked over.
if grep -q ^$sha already_picked ; then
continue
fi
git log -n1 --pretty=oneline $sha | cat
done
rm -f already_picked

View File

@@ -1,74 +0,0 @@
#!/bin/sh
#
# Simple shell script for installing Mesa's header and library files.
# If the copy commands below don't work on a particular system (i.e. the
# -f or -d flags), we may need to branch on `uname` to do the right thing.
#
TOP=.
INCLUDE_DIR="/usr/local/include"
LIB_DIR="/usr/local/lib"
if [ "x$#" = "x0" ] ; then
echo
echo "***** Mesa installation - You may need root privileges to do this *****"
echo
echo "Default directory for header files is:" ${INCLUDE_DIR}
echo "Enter new directory or press <Enter> to accept this default."
read INPUT
if [ "x${INPUT}" != "x" ] ; then
INCLUDE_DIR=${INPUT}
fi
echo
echo "Default directory for library files is:" ${LIB_DIR}
echo "Enter new directory or press <Enter> to accept this default."
read INPUT
if [ "x${INPUT}" != "x" ] ; then
LIB_DIR=${INPUT}
fi
echo
echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL
echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR}
echo "Press <Enter> to continue, or <ctrl>-C to abort."
read INPUT
else
INCLUDE_DIR=$1/include
LIB_DIR=$1/lib
fi
# flags:
# -f = force
# -d = preserve symlinks (does not work on BSD)
if [ `uname` = "FreeBSD" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "Darwin" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "AIX" ] ; then
CP_FLAGS="-fh"
else
CP_FLAGS="-fd"
fi
set -v
mkdir -p ${INCLUDE_DIR}
mkdir -p ${INCLUDE_DIR}/GL
# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES
mkdir -p ${LIB_DIR}
cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL
# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
echo "Done."

View File

@@ -1,112 +0,0 @@
#!/bin/sh
# A minimal replacement for 'install' that supports installing symbolic links.
# Only a limited number of options are supported:
# -d dir Create a directory
# -m mode Sets a file's mode when installing
# If these commands aren't portable, we'll need some "if (arch)" type stuff
SYMLINK="ln -s"
MKDIR="mkdir -p"
RM="rm -f"
MODE=""
if [ "$1" = "-d" ] ; then
# make a directory path
$MKDIR "$2"
exit 0
fi
if [ "$1" = "-m" ] ; then
# set file mode
MODE=$2
shift 2
fi
# install file(s) into destination
if [ $# -ge 2 ] ; then
# Last cmd line arg is the dest dir
for FILE in $@ ; do
DESTDIR="$FILE"
done
# Loop over args, moving them to DEST directory
I=1
for FILE in $@ ; do
if [ $I = $# ] ; then
# stop, don't want to install $DEST into $DEST
exit 0
fi
DEST=$DESTDIR
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
# they are installed in the executable path. Stub libraries used
# only for linking are installed in the library path
case `uname` in
CYGWIN*)
case $FILE in
*.dll)
DEST="$DEST/../bin"
;;
*)
;;
esac
;;
*)
;;
esac
PWDSAVE=`pwd`
# determine file's type
if [ -h "$FILE" ] ; then
#echo $FILE is a symlink
# Unfortunately, cp -d isn't universal so we have to
# use a work-around.
# Use ls -l to find the target that the link points to
LL=`ls -l "$FILE"`
for L in $LL ; do
TARGET=$L
done
#echo $FILE is a symlink pointing to $TARGET
FILE=`basename "$FILE"`
# Go to $DEST and make the link
cd "$DEST" # pushd
$RM "$FILE"
$SYMLINK "$TARGET" "$FILE"
cd "$PWDSAVE" # popd
elif [ -f "$FILE" ] ; then
#echo "$FILE" is a regular file
# Only copy if the files differ
if ! cmp -s $FILE $DEST/`basename $FILE`; then
$RM "$DEST/`basename $FILE`"
cp "$FILE" "$DEST"
fi
if [ $MODE ] ; then
FILE=`basename "$FILE"`
chmod $MODE "$DEST/$FILE"
fi
else
echo "Unknown type of argument: " "$FILE"
exit 1
fi
I=`expr $I + 1`
done
exit 0
fi
# If we get here, we didn't find anything to do
echo "Usage:"
echo " install -d dir Create named directory"
echo " install [-m mode] file [...] dest Install files in destination"

1037
bin/mklib

File diff suppressed because it is too large Load Diff

View File

@@ -98,5 +98,6 @@ def AddOptions(opts):
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
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('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

2
configs/.gitignore vendored
View File

@@ -1,2 +0,0 @@
current
autoconf

View File

@@ -1,227 +0,0 @@
# Autoconf configuration
# Pull in the defaults
include $(TOP)/configs/default
# This is generated by configure
CONFIG_NAME = autoconf
# Compiler and flags
CC = @CC@
CXX = @CXX@
OPT_FLAGS = @OPT_FLAGS@
ARCH_FLAGS = @ARCH_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LIBS = @RADEON_LIBS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_BINDIR = @LLVM_BINDIR@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_CPPFLAGS = @LLVM_CPPFLAGS@
LLVM_CXXFLAGS = @LLVM_CXXFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBDIR = @LLVM_LIBDIR@
LLVM_LIBS = @LLVM_LIBS@
LLVM_INCLUDEDIR = @LLVM_INCLUDEDIR@
GLW_CFLAGS = @GLW_CFLAGS@
GLX_TLS = @GLX_TLS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_FILES = @MESA_ASM_FILES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
MAKE = @MAKE@
SHELL = @SHELL@
MKLIB_OPTIONS = @MKLIB_OPTIONS@
MKDEP = @MKDEP@
MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
AWK = @AWK@
GREP = @GREP@
NM = @NM@
# Perl
PERL = @PERL@
# Indent (used for generating dispatch tables)
INDENT = @INDENT@
INDENT_FLAGS = @INDENT_FLAGS@
# Python and flags (generally only needed by the developers)
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @LEX@
BISON = @YACC@
# Library names (base name)
GL_LIB = @GL_LIB@
GLU_LIB = @GLU_LIB@
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
GLU_LIB_NAME = @GLU_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLU_LIB_GLOB = @GLU_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
# GLw motif setup
GLW_SOURCES = @GLW_SOURCES@
MOTIF_CFLAGS = @MOTIF_CFLAGS@
# Library/program dependencies
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
# Installation directories (for make install)
INSTALL_DIR = $(prefix)
INSTALL_LIB_DIR = $(libdir)
INSTALL_INC_DIR = $(includedir)
# DRI installation directories
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
# XVMC library install directory
XVMC_LIB_INSTALL_DIR=@XVMC_LIB_INSTALL_DIR@
# VDPAU library install directory
VDPAU_LIB_INSTALL_DIR=@VDPAU_LIB_INSTALL_DIR@
# VA library install directory
VA_LIB_INSTALL_DIR=@VA_LIB_INSTALL_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
# Path to OpenCL C library libclc
LIBCLC_PATH = @LIBCLC_PATH@
# pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
GL_PC_CFLAGS = @GL_PC_CFLAGS@
DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@
GLU_PC_REQ = @GLU_PC_REQ@
GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@
GALLIUM_PIPE_LOADER_DEFINES = @GALLIUM_PIPE_LOADER_DEFINES@
GALLIUM_PIPE_LOADER_LIBS = @GALLIUM_PIPE_LOADER_LIBS@

View File

@@ -1,182 +0,0 @@
# Default/template configuration
# This is included by other config files which may override some
# of these variables.
# Think of this as a base class from which configs are derived.
CONFIG_NAME = default
# Version info
MESA_MAJOR=8
MESA_MINOR=1
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
DRM_SOURCE_PATH=$(TOP)/../drm
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
GLU_CFLAGS =
GLX_TLS = no
# Compiler for building demos/tests/etc
APP_CC = $(CC)
APP_CXX = $(CXX)
# Misc tools and flags
SHELL = /bin/sh
MKLIB = $(SHELL) $(TOP)/bin/mklib
MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
PKG_CONFIG = pkg-config
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
INSTALL = $(MINSTALL)
# Tools for regenerating glapi (generally only needed by the developers)
PYTHON2 = python
PYTHON_FLAGS = -t -O -O
INDENT = indent
INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLW_LIB = GLw
OSMESA_LIB = OSMesa
EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
GLU_LIB_NAME = lib$(GLU_LIB).so
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
EGL_LIB_NAME = lib$(EGL_LIB).so
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
# Optional assembly language optimization files for libGL
MESA_ASM_FILES =
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
# order to build the Motif widget too)
GLW_SOURCES = GLwDrawA.c
MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 svga r300 nvfx nv50
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
GALLIUM_STATE_TRACKERS_DIRS = glx vega
# native platforms EGL should support
EGL_PLATFORMS = x11
EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
# Program dependencies - specific GL libraries added in Makefiles
X11_LIBS = -lX11
DLOPEN_LIBS = -ldl
# Installation directories (for make install)
INSTALL_DIR = /usr/local
INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)
INSTALL_INC_DIR = $(INSTALL_DIR)/include
DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
# pkg-config substitutions
GL_PC_REQ_PRIV =
GL_PC_LIB_PRIV =
GL_PC_CFLAGS =
DRI_PC_REQ_PRIV =
GLU_PC_REQ = gl
GLU_PC_REQ_PRIV =
GLU_PC_LIB_PRIV =
GLU_PC_CFLAGS =
GLW_PC_REQ_PRIV =
GLW_PC_LIB_PRIV =
GLW_PC_CFLAGS =
OSMESA_PC_REQ =
OSMESA_PC_LIB_PRIV =
GLESv1_CM_PC_REQ_PRIV =
GLESv1_CM_PC_LIB_PRIV =
GLESv1_CM_PC_CFLAGS =
GLESv2_PC_REQ_PRIV =
GLESv2_PC_LIB_PRIV =
GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
# default targets
# this helps reduce the mismatch between our automake Makefiles and the old
# custom Makefiles while we transition.
all: default
am--refresh:
distclean: clean
check:
test:

File diff suppressed because it is too large Load Diff

View File

@@ -23,40 +23,39 @@ GL_EXT_texture_shared_exponent DONE (i965, r600, swrast)
Float depth buffers (GL_ARB_depth_buffer_float) DONE (i965, r600)
Framebuffer objects (GL_ARB_framebuffer_object) DONE (i965, r300, r600, swrast)
Half-float DONE
Non-normalized Integer texture/framebuffer formats DONE (i965)
Non-normalized Integer texture/framebuffer formats DONE (i965, r600)
1D/2D Texture arrays DONE
Per-buffer blend and masks (GL_EXT_draw_buffers2) DONE (i965, r600, swrast)
GL_EXT_texture_compression_rgtc DONE (i965, r300, r600, swrast)
Red and red/green texture formats DONE (i965, swrast, gallium)
Transform feedback (GL_EXT_transform_feedback) DONE (i965)
Transform feedback (GL_EXT_transform_feedback) DONE (i965, r600)
Vertex array objects (GL_APPLE_vertex_array_object) DONE (i965, r300, r600, swrast)
sRGB framebuffer format (GL_EXT_framebuffer_sRGB) DONE (i965, r600)
glClearBuffer commands DONE
glGetStringi command DONE
glTexParameterI, glGetTexParameterI commands DONE
glVertexAttribI commands ~50% done (converts int
values to floats)
glVertexAttribI commands DONE
Depth format cube textures DONE
GLX_ARB_create_context (GLX 1.4 is required) DONE
GL 3.1:
GLSL 1.40 missing: UBOS, inverse(),
highp change
GLSL 1.40 DONE (i965, r600)
Forward compatibile context support/deprecations DONE (i965, r600)
Instanced drawing (GL_ARB_draw_instanced) DONE (i965, gallium, swrast)
Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, swrast)
Primitive restart (GL_NV_primitive_restart) DONE (i965, r600)
16 vertex texture image units DONE
Texture buffer objs (GL_ARB_texture_buffer_object) needs GL3.1 enabling (i965)
Texture buffer objs (GL_ARB_texture_buffer_object) DONE for OpenGL 3.1 contexts (i965, r600)
Rectangular textures (GL_ARB_texture_rectangle) DONE (i965, r300, r600, swrast)
Uniform buffer objs (GL_ARB_uniform_buffer_object) not started
Uniform buffer objs (GL_ARB_uniform_buffer_object) DONE (i965, r600, swrast)
Signed normalized textures (GL_EXT_texture_snorm) DONE (i965, r300, r600)
GL 3.2:
Core/compatibility profiles not started
Core/compatibility profiles DONE
GLSL 1.50 not started
Geometry shaders (GL_ARB_geometry_shader4) partially done (Zack)
BGRA vertex order (GL_ARB_vertex_array_bgra) DONE (i965, r300, r600, swrast)
@@ -75,14 +74,14 @@ GL 3.3:
GLSL 3.30 new features in this version pretty much done
GL_ARB_blend_func_extended DONE (i965, r600, softpipe)
GL_ARB_explicit_attrib_location DONE (i915, i965, r300, r600, swrast)
GL_ARB_occlusion_query2 DONE (r300, r600, swrast)
GL_ARB_occlusion_query2 DONE (i965, r300, r600, swrast)
GL_ARB_sampler_objects DONE (i965, r300, r600)
GL_ARB_shader_bit_encoding DONE
GL_ARB_texture_rgb10_a2ui DONE (r600)
GL_ARB_texture_rgb10_a2ui DONE (i965, r600)
GL_ARB_texture_swizzle DONE (same as EXT version) (i965, r300, r600, swrast)
GL_ARB_timer_query ~60% done (the EXT variant)
GL_ARB_instanced_arrays DONE (r300, r600)
GL_ARB_vertex_type_2_10_10_10_rev DONE (r600)
GL_ARB_timer_query DONE (i965, r600)
GL_ARB_instanced_arrays DONE (i965, r300, r600)
GL_ARB_vertex_type_2_10_10_10_rev DONE (i965, r600)
GL 4.0:
@@ -91,15 +90,16 @@ GLSL 4.0 not started
GL_ARB_texture_query_lod not started
GL_ARB_draw_buffers_blend DONE (i965, r600, softpipe)
GL_ARB_draw_indirect not started
GL_ARB_gpu_shader5 not started
GL_ARB_gpu_shader_fp64 not started
GL_ARB_sample_shading not started
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 not started
GL_ARB_texture_cube_map_array not started
GL_ARB_texture_buffer_object_rgb32 DONE (i965, softpipe)
GL_ARB_texture_cube_map_array DONE (i965, softpipe)
GL_ARB_texture_gather not started
GL_ARB_transform_feedback2 DONE
GL_ARB_transform_feedback3 not started
GL_ARB_transform_feedback3 DONE
GL 4.1:
@@ -114,18 +114,46 @@ GL_ARB_viewport_array not started
GL 4.2:
GLSL 4.2 not started
GL_ARB_texture_compression_bptc not started
GL_ARB_compressed_texture_pixel_storage not started
GL_ARB_shader_atomic_counters not started
GL_ARB_texture_storage DONE (r300, r600, swrast)
GL_ARB_transform_feedback_instanced not started
GL_ARB_base_instance DONE (nv50, nvc0, r600, radeonsi)
GL_ARB_texture_storage DONE (r300, r600, swrast, gallium)
GL_ARB_transform_feedback_instanced DONE
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi)
GL_ARB_shader_image_load_store not started
GL_ARB_conservative_depth DONE (softpipe)
GL_ARB_shading_language_420pack not started
GL_ARB_internalformat_query not started
GL_ARB_map_buffer_alignment not started
GL_ARB_map_buffer_alignment DONE (r300, r600, radeonsi)
GL 4.3:
GLSL 4.3 not started
ARB_arrays_of_arrays not started
ARB_ES3_compatibility not started
ARB_clear_buffer_object not started
ARB_compute_shader started (gallium)
ARB_copy_image not started
KHR_debug some work done (ARB_debug_output)
ARB_explicit_uniform_location not started
ARB_fragment_layer_viewport not started
ARB_framebuffer_no_attachments not started
ARB_internalformat_query2 not started
ARB_invalidate_subdata not started
ARB_multi_draw_indirect not started
ARB_program_interface_query not started
ARB_robust_buffer_access_behavior not started
ARB_shader_image_size not started
ARB_shader_storage_buffer_object not started
ARB_stencil_texturing not started
ARB_texture_buffer_range not started
ARB_texture_query_levels not started
ARB_texture_storage_multisample not started
ARB_texture_view not started
ARB_vertex_attrib_binding not started
More info about these features and the work involved can be found at

View File

@@ -1,38 +0,0 @@
VMS support contributed by Jouk Jansen (joukj@hrem.stm.tudelft.nl)
The latest version was tested on a VMSAlpha7.2 system using DECC6.0, but
probably also works for other versions.
At the moment only the libraries LIBMESGL.EXE/LIBMESGL.OLB,
LIBMESAGLU.EXE/LIBMESAGLU.OLB and LIBGLUT.EXE/LIBGLUT.OLB and the demos of the
directory [.DEMOS] can be build.
However, feel free to create the missing "decrip.mms-files" in the other
directories.
The make files were tested
using the DIGITAL make utility called MMS. There is also a public domain
clone available (MMK) and I think, but it is not tested, that this
utility will give (hardly) any problem.
To make everything just type MMS (or MMK) in the main directory of
mesagl. For MMS the deafult makefile is called descrip.mms, and
that is what I have called it. I included alse some config files,
all having mms somewhere in the name which all the makefiles need
(just as your unix makefiles).
On Alpha platforms at default a sharable images for the libraries are created.
To get a static library make it by typing MMS/MACRO=(NOSHARE=1).
On VAX platforms only static libraries can be build.
23-sep-2005
changed default compilation to use /float=ieee/ieee=denorm. The reason for
this is that it makes Mesa on OpenVMS better compatible with other platforms
and other packages for VMS that I maintain.
For more information see
http://nchrem.tnw.tudelft.nl/openvms
https://bugs.freedesktop.org/show_bug.cgi?id=4270
You may want to compile Mesa to use VAX-floating point arithmetic, instead
of IEEE floating point by removing the /float=IEEE/denorm flag from the
compiler options in the descrip.mms files.

View File

@@ -56,12 +56,27 @@ New Procedures and Functions
EGLBoolean eglUnbindWaylandDisplayWL(EGLDisplay dpy,
struct wl_display *display);
EGLBoolean eglQueryWaylandBufferWL(EGLDisplay dpy,
struct wl_buffer *buffer,
EGLint attribute, EGLint *value);
New Tokens
Accepted as <target> in eglCreateImageKHR
EGL_WAYLAND_BUFFER_WL 0x31D5
Accepted in the <attrib_list> parameter of eglCreateImageKHR:
EGL_WAYLAND_PLANE_WL 0x31D6
Possible values for EGL_TEXTURE_FORMAT:
EGL_TEXTURE_Y_U_V_WL 0x31D7
EGL_TEXTURE_Y_UV_WL 0x31D8
EGL_TEXTURE_Y_XUXV_WL 0x31D9
Additions to the EGL 1.4 Specification:
To bind a server side wl_display to an EGLDisplay, call
@@ -80,9 +95,67 @@ Additions to the EGL 1.4 Specification:
eglUnbindWaylandDisplayWL returns EGL_FALSE when there is no
wl_display bound to the EGLDisplay currently otherwise EGL_TRUE.
Import a wl_buffer by calling eglCreateImageKHR with
wl_buffer as EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target,
NULL context and an empty attribute_list.
A wl_buffer can have several planes, typically in case of planar
YUV formats. Depending on the exact YUV format in use, the
compositor will have to create one or more EGLImages for the
various planes. The eglQueryWaylandBufferWL function should be
used to first query the wl_buffer texture format using
EGL_TEXTURE_FORMAT as the attribute. If the wl_buffer object is
not an EGL wl_buffer (wl_shm and other wayland extensions can
create wl_buffer objects of different types), this query will
return EGL_FALSE. In that case the wl_buffer can not be used with
EGL and the compositor should have another way to get the buffer
contents.
If eglQueryWaylandBufferWL succeeds, the returned value will be
one of EGL_TEXTURE_RGB, EGL_TEXTURE_RGBA, EGL_TEXTURE_Y_U_V_WL,
EGL_TEXTURE_Y_UV_WL, EGL_TEXTURE_Y_XUXV_WL. The value returned
describes how many EGLImages must be used, which components will
be sampled from each EGLImage and how they map to rgba components
in the shader. The naming conventions separates planes by _ and
within each plane, the order or R, G, B, A, Y, U, and V indicates
how those components map to the rgba value returned by the
sampler. X indicates that the corresponding component in the rgba
value isn't used.
RGB and RGBA buffer types:
EGL_TEXTURE_RGB
One plane, samples RGB from the texture to rgb in the
shader. Alpha channel is not valid.
EGL_TEXTURE_RGBA
One plane, samples RGBA from the texture to rgba in the
shader.
YUV buffer types:
EGL_TEXTURE_Y_U_V_WL
Three planes, samples Y from the first plane to r in
the shader, U from the second plane to r, and V from
the third plane to r.
EGL_TEXTURE_Y_UV_WL
Two planes, samples Y from the first plane to r in
the shader, U and V from the second plane to rg.
EGL_TEXTURE_Y_XUXV_WL
Two planes, samples Y from the first plane to r in
the shader, U and V from the second plane to g and a.
After querying the wl_buffer layout, create EGLImages for the
planes by calling eglCreateImageKHR with wl_buffer as
EGLClientBuffer, EGL_WAYLAND_BUFFER_WL as the target, NULL
context. If no attributes are given, an EGLImage will be created
for the first plane. For multi-planar buffers, specify the plane
to create the EGLImage for by using the EGL_WAYLAND_PLANE_WL
attribute. The value of the attribute is the index of the plane,
as defined by the buffer format. Writing to an EGLImage created
from a wl_buffer in any way (such as glTexImage2D, binding the
EGLImage as a renderbuffer etc) will result in undefined behavior.
Further, eglQueryWaylandBufferWL accepts attributes EGL_WIDTH and
EGL_HEIGHT to query the width and height of the wl_buffer.
Issues
@@ -90,3 +163,13 @@ Revision History
Version 1, March 1, 2011
Initial draft (Benjamin Franzke)
Version 2, July 5, 2012
Add EGL_WAYLAND_PLANE_WL attribute to allow creating an EGLImage
for different planes of planar buffer. (Kristian Høgsberg)
Version 3, July 10, 2012
Add eglQueryWaylandBufferWL and the various buffer
formats. (Kristian Høgsberg)
Version 4, July 19, 2012
Use EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB, and EGL_TEXTURE_RGBA,
and just define the new YUV texture formats. Add support for
EGL_WIDTH and EGL_HEIGHT in the query attributes (Kristian Høgsberg)

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Compilation and Installation using Autoconf</h1>
<ol>
@@ -17,11 +24,6 @@
<li><a href="#dri">DRI Driver Options</a></li>
<li><a href="#osmesa">OSMesa Driver Options</a></li>
</ul>
<li><p><a href="#library">Library Options</a>
<ul>
<li><a href="#glu">GLU</a></li>
</ul>
<li><p><a href="#demos">Demo Program Options</a>
</ol>
@@ -60,83 +62,107 @@ configuration run <code>make realclean</code> before rebuilding.
<p>
Some of the generic autoconf options are used with Mesa:
<ul>
<li><code>--prefix=PREFIX</code> - This is the root directory where
</p>
<dl>
<dt><code>--prefix=PREFIX</code></dt>
<dd><p>This is the root directory where
files will be installed by <code>make install</code>. The default is
<code>/usr/local</code>.
</li>
<li><code>--exec-prefix=EPREFIX</code> - This is the root directory
<code>/usr/local</code>.</p>
</dd>
<dt><code>--exec-prefix=EPREFIX</code></dt>
<dd><p>This is the root directory
where architecture-dependent files will be installed. In Mesa, this is
only used to derive the directory for the libraries. The default is
<code>${prefix}</code>.
</li>
<li><code>--libdir=LIBDIR</code> - This option specifies the directory
<code>${prefix}</code>.</p>
</dd>
<dt><code>--libdir=LIBDIR</code></dt>
<dd><p>This option specifies the directory
where the GL libraries will be installed. The default is
<code>${exec_prefix}/lib</code>. It also serves as the name of the
library staging area in the source tree. For instance, if the option
<code>--libdir=/usr/local/lib64</code> is used, the libraries will be
created in a <code>lib64</code> directory at the top of the Mesa source
tree.
</li>
<li><code>--enable-static, --disable-shared</code> - By default, Mesa
tree.</p>
</dd>
<dt><code>--enable-static, --disable-shared</code></dt>
<dd><p>By default, Mesa
will build shared libraries. Either of these options will force static
libraries to be built. It is not currently possible to build static and
shared libraries in a single pass.
</li>
<li><code>CC, CFLAGS, CXX, CXXFLAGS</code> - These environment variables
shared libraries in a single pass.</p>
</dd>
<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>.
</li>
<li><code>LDFLAGS</code> - An environment variable specifying flags to
<code>"-g -O2"</code>.</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>.
</li>
<li><code>PKG_CONFIG_PATH</code> - When available, the
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
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
package metadata in <code>/usr/X11R6</code> before the standard
directories.
</li>
</ul>
directories.</p>
</dd>
</dl>
<p>
There are also a few general options for altering the Mesa build:
<ul>
<li><code>--with-x</code> - When the X11 development libraries are
</p>
<dl>
<dt><code>--with-x</code></dt>
<dd><p>When the X11 development libraries are
needed, the <code>pkg-config</code> utility <a href="#pkg-config">will
be used</a> for locating them. If they cannot be found through
<code>pkg-config</code> a fallback routing using <code>imake</code> will
be used. In this case, the <code>--with-x</code>,
<code>--x-includes</code> and <code>--x-libraries</code> options can
control the use of X for Mesa.
</li>
<li><code>--enable-gl-osmesa</code> - The <a href="osmesa.html">OSMesa
control the use of X for Mesa.</p>
</dd>
<dt><code>--enable-gl-osmesa</code></dt>
<dd><p>The <a href="osmesa.html">OSMesa
library</a> can be built on top of libGL for drivers that provide it.
This option controls whether to build libOSMesa. By default, this is
enabled for the Xlib driver and disabled otherwise. Note that this
option is different than using OSMesa as the driver.
</li>
<li><code>--enable-debug</code> - This option will enable compiler
options and macros to aid in debugging the Mesa libraries.
</li>
<li><code>--disable-asm</code> - There are assembly routines
option is different than using OSMesa as the driver.</p>
</dd>
<dt><code>--enable-debug</code></dt>
<dd><p>This option will enable compiler
options and macros to aid in debugging the Mesa libraries.</p>
</dd>
<dt><code>--disable-asm</code></dt>
<dd><p>There are assembly routines
available for a few architectures. These will be used by default if
one of these architectures is detected. This option ensures that
assembly will not be used.
</li>
<li><code>--enable-32-bit, --enable-64-bit</code> - By default, the
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.
</li>
</ul>
architectures.</p>
</dd>
</dl>
<h2 id="driver">2. Driver Options</h2>
@@ -219,31 +245,6 @@ libraries that will be built. More details on the specific GL libraries
can be found in the <a href="install.html">basic installation
instructions</a>.
<dl>
<dt id="glu">GLU <dd><p> The libGLU library will be built by default
on all drivers. This can be disable with the option
<code>--disable-glu</code>.
</dl>
<h2 id="demos">4. Demo Program Options</h2>
<p>
There are many demonstration programs in the MesaDemos tarball. If the
programs are available when <code>./configure</code> is run, a subset of
the programs will be built depending on the driver and library options
chosen. See the directory <code>progs</code> for the full set of demos.
<dl>
<dt><code>--with-demos=DEMOS,DEMOS,...</code>
<dd><p> This option allows a
specific set of demo programs to be built. For example,
<code>--with-demos="xdemos,slang"</code>. Beware that if this option is
used, it will not be ensured that the necessary GL libraries will be
available.
<dt><code>--without-demos</code> <dd><p> This completely disables building the
demo programs. It is equivalent to <code>--with-demos=no</code>.
</dl>
</div>
</body>
</html>

View File

@@ -1,33 +0,0 @@
<!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>Banner</title>
<style type="text/css">
<!--
body { background: black; color: white }
h1 {
font: x-large sans-serif; text-align: center;
height: 75px; margin-left: 100px; margin-right: 100px }
.gears { width: 100px; height: 73px; float: left; background: url('gears.png') right no-repeat }
div + .gears { float: right; background-position: left }
/*
This should happen in the future instead:
h1 {
border-left: 71px solid #c11800; border-right: 71px solid #00c130;
border-top: 0px; border-bottom: 0px;
border-image: url(gears.png) 100%; -webkit-border-image: url(gears.png) 100%;
}
*/
-->
</style>
</head>
<body>
<div class="gears"></div>
<div class="gears"></div>
<h1>The Mesa 3D Graphics Library</h1>
</body>
</html>

View File

@@ -7,18 +7,24 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Bug Database</h1>
<p>
The Mesa bug database is hosted on
<a href="http://freedesktop.org" target="_parent">freedesktop.org</a>.
<a href="http://freedesktop.org">freedesktop.org</a>.
The old bug database on SourceForge is no longer used.
</p>
<p>
To file a Mesa bug, go to
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"
target="_parent">
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa">
Bugzilla on freedesktop.org</a>
</p>
@@ -50,5 +56,6 @@ If your bug report is vague or your test program doesn't compile
easily, the problem may not be fixed very quickly.
</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Conformance</h1>
<p>
@@ -691,6 +698,6 @@ Conformx passed.
NOTE: conformx passes for all machine path levels (-p option).
</div>
</body>
</html>

View File

@@ -25,62 +25,64 @@
<b>Documentation</b>
<ul>
<li><a href="intro.html" target="MainFrame">Introduction</a>
<li><a href="news.html" target="MainFrame">News</a>
<li><a href="developers.html" target="MainFrame">Developers</a>
<li><a href="systems.html" target="MainFrame">Platforms and Drivers</a>
<li><a href="license.html" target="MainFrame">License &amp; Copyright</a>
<li><a href="faq.html" target="MainFrame">FAQ</a>
<li><a href="relnotes.html" target="MainFrame">Release Notes</a>
<li><a href="thanks.html" target="MainFrame">Acknowledgements</a>
<li><a href="conform.html" target="MainFrame">Conformance Testing</a>
<li><a href="intro.html" target="_parent">Introduction</a>
<li><a href="index.html" target="_parent">News</a>
<li><a href="developers.html" target="_parent">Developers</a>
<li><a href="systems.html" target="_parent">Platforms and Drivers</a>
<li><a href="license.html" target="_parent">License &amp; Copyright</a>
<li><a href="faq.html" target="_parent">FAQ</a>
<li><a href="relnotes.html" target="_parent">Release Notes</a>
<li><a href="thanks.html" target="_parent">Acknowledgements</a>
<li><a href="conform.html" target="_parent">Conformance Testing</a>
<li>more docs below...
</ul>
<b>Download / Install</b>
<ul>
<li><a href="download.html" target="MainFrame">Downloading / Unpacking</a>
<li><a href="install.html" target="MainFrame">Compiling / Installing</a>
<li><a href="precompiled.html" target="MainFrame">Precompiled Libraries</a>
<li><a href="download.html" target="_parent">Downloading / Unpacking</a>
<li><a href="install.html" target="_parent">Compiling / Installing</a>
<ul>
<li><a href="autoconf.html" target="_parent">Autoconf</a></li>
</ul>
</li>
<li><a href="precompiled.html" target="_parent">Precompiled Libraries</a>
</ul>
<b>Resources</b>
<ul>
<li><a href="lists.html" target="MainFrame">Mailing Lists</a>
<li><a href="bugs.html" target="MainFrame">Bug Database</a>
<li><a href="webmaster.html" target="MainFrame">Webmaster</a>
<li><a href="lists.html" target="_parent">Mailing Lists</a>
<li><a href="bugs.html" target="_parent">Bug Database</a>
<li><a href="webmaster.html" target="_parent">Webmaster</a>
<li><a href="http://dri.freedesktop.org/" target="_parent">Mesa/DRI Wiki</a>
</ul>
<b>User Topics</b>
<ul>
<li><a href="egl.html" target="MainFrame">EGL</a>
<li><a href="opengles.html" target="MainFrame">OpenGL ES</a>
<li><a href="openvg.html" target="MainFrame">OpenVG / Vega</a>
<li><a href="envvars.html" target="MainFrame">Environment Variables</a>
<li><a href="osmesa.html" target="MainFrame">Off-Screen Rendering</a>
<li><a href="debugging.html" target="MainFrame">Debugging Tips</a>
<li><a href="perf.html" target="MainFrame">Performance Tips</a>
<li><a href="extensions.html" target="MainFrame">Mesa Extensions</a>
<li><a href="mangling.html" target="MainFrame">Function Name Mangling</a>
<li><a href="llvmpipe.html" target="MainFrame">Gallium llvmpipe driver</a>
<li><a href="vmware-guest.html" target="MainFrame">VMware SVGA3D guest driver</a>
<li><a href="postprocess.html" target="MainFrame">Gallium post-processing</a>
<li><a href="viewperf.html" target="MainFrame">Viewperf Issues</a>
<li><a href="shading.html" target="_parent">Shading Language</a>
<li><a href="egl.html" target="_parent">EGL</a>
<li><a href="opengles.html" target="_parent">OpenGL ES</a>
<li><a href="openvg.html" target="_parent">OpenVG / Vega</a>
<li><a href="envvars.html" target="_parent">Environment Variables</a>
<li><a href="osmesa.html" target="_parent">Off-Screen Rendering</a>
<li><a href="debugging.html" target="_parent">Debugging Tips</a>
<li><a href="perf.html" target="_parent">Performance Tips</a>
<li><a href="extensions.html" target="_parent">Mesa Extensions</a>
<li><a href="mangling.html" target="_parent">Function Name Mangling</a>
<li><a href="llvmpipe.html" target="_parent">Gallium llvmpipe driver</a>
<li><a href="vmware-guest.html" target="_parent">VMware SVGA3D guest driver</a>
<li><a href="postprocess.html" target="_parent">Gallium post-processing</a>
<li><a href="viewperf.html" target="_parent">Viewperf Issues</a>
</ul>
<b>Developer Topics</b>
<ul>
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
<li><a href="sourcetree.html" target="MainFrame">Source Code Tree</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
<li><a href="utilities.html" target="MainFrame">Utilities</a>
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>
<li><a href="sourcedocs.html" target="MainFrame">Source Documentation</a>
<li><a href="subset.html" target="MainFrame">Mesa Subset Driver</a>
<li><a HREF="dispatch.html" target="MainFrame">GL Dispatch</a>
<li><a href="repository.html" target="_parent">Source Code Repository</a>
<li><a href="sourcetree.html" target="_parent">Source Code Tree</a>
<li><a href="utilities.html" target="_parent">Utilities</a>
<li><a href="helpwanted.html" target="_parent">Help Wanted</a>
<li><a href="devinfo.html" target="_parent">Development Notes</a>
<li><a href="sourcedocs.html" target="_parent">Source Documentation</a>
<li><a href="dispatch.html" target="_parent">GL Dispatch</a>
</ul>
<b>Links</b>
@@ -88,11 +90,6 @@
<li><a href="http://www.opengl.org" target="_parent">OpenGL website</a>
<li><a href="http://dri.freedesktop.org" target="_parent">DRI website</a>
<li><a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>
<li><a href="games.html" target="MainFrame">Games and Entertainment</a>
<li><a href="libraries.html" target="MainFrame">Libraries and Toolkits</a>
<li><a href="modelers.html" target="MainFrame">Modeling and Rendering</a>
<li><a href="science.html" target="MainFrame">Science and Technical</a>
<li><a href="utility.html" target="MainFrame">Utilities</a>
</ul>
<b>Hosted by:</b>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Debugging Tips</h1>
<p>
@@ -35,5 +42,6 @@
src/dlist.c for details.
</p>
</div>
</body>
</html>

View File

@@ -7,13 +7,20 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Developers</h1>
<p>
Both professional and volunteer developers contribute to Mesa.
</p>
<p>
<a href="http://www.vmware.com/" target="_parent">VMware</a>
<a href="http://www.vmware.com/">VMware</a>
employs several of the main Mesa developers including Brian Paul
and Keith Whitwell.
</p>
@@ -31,13 +38,13 @@ including:
<p>
Other companies including
<a href="http://www.intellinuxgraphics.org/index.html" target="_parent">Intel</a>
<a href="http://www.intellinuxgraphics.org/index.html">Intel</a>
and RedHat also actively contribute to the project.
Intel has recently contributed the new GLSL compiler in Mesa 7.9.
</p>
<p>
<a href="http://www.lunarg.com/" target="_parent">LunarG</a> can be contacted
<a href="http://www.lunarg.com/">LunarG</a> can be contacted
for custom Mesa / 3D graphics development.
</p>
@@ -46,5 +53,6 @@ Volunteers have made significant contributions to all parts of Mesa, including
complete device drivers.
</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Development Notes</h1>
@@ -149,6 +156,30 @@ src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as examples.
</p>
<h2>Marking a commit as a candidate for a stable branch</h2>
<p>
If you want a commit to be applied to a stable branch,
you should add an appropriate note to the commit message.
</p>
<p>
Here are some examples of such a note:
</p>
<ul>
<li>NOTE: This is a candidate for the 9.0 branch.</li>
<li>NOTE: This is a candidate for the 8.0 and 9.0 branches.</li>
<li>NOTE: This is a candidate for the stable branches.</li>
</ul>
<h2>Cherry-picking candidates for a stable branch</h2>
<p>
Please use <code>git cherry-pick -x &lt;commit&gt;</code> for cherry-picking a commit
from master to a stable branch.
</p>
<h2>Making a New Mesa Release</h2>
<p>
@@ -165,11 +196,9 @@ branch is relevant.
<h3>Verify and update version info</h3>
<dl>
<dt>configs/default</dt>
<dd>MESA_MAJOR, MESA_MINOR and MESA_TINY</dd>
<dt>Makefile.am</dt>
<dd>PACKAGE_VERSION</dd>
<dt>autoconf.ac</dt>
<dt>configure.ac</dt>
<dd>AC_INIT</dd>
<dt>src/mesa/main/version.h</dt>
<dd>MESA_MAJOR, MESA_MINOR, MESA_PATCH and MESA_VERSION_STRING</dd>
@@ -183,7 +212,7 @@ Link the new docs/relnotes-x.y.z.html file into the main <a href="relnotes.html"
</p>
<p>
Update <a href="news.html">docs/news.html</a>.
Update <a href="index.html">docs/index.html</a>.
</p>
<p>
@@ -243,5 +272,6 @@ and
<em>m</em><em>e</em><em>s</em><em>a</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>f</em><em>r</em><em>e</em><em>e</em><em>d</em><em>e</em><em>s</em><em>k</em><em>t</em><em>o</em><em>p</em><em>.</em><em>o</em><em>r</em><em>g</em>
</p>
</div>
</body>
</html>

View File

@@ -6,6 +6,14 @@
<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>GL Dispatch in Mesa</h1>
<p>Several factors combine to make efficient dispatch of OpenGL functions
@@ -197,7 +205,7 @@ few preprocessor defines.</p>
<ul>
<li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
<li>If <tt>PTHREADS</tt> is defined, method #3 is used.</li>
<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
<li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
<li>If none of the preceeding are defined, method #1 is used.</li>
</ul>
@@ -266,5 +274,6 @@ included.</p>
<h2 id="autogen">4. Automatic Generation of Dispatch Stubs</h2>
</div>
</body>
</html>

View File

@@ -7,17 +7,23 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Downloading</h1>
<p>
Primary Mesa download site:
<a href="ftp://ftp.freedesktop.org/pub/mesa/"
target="_parent">freedesktop.org</a> (FTP)
<a href="ftp://ftp.freedesktop.org/pub/mesa/">freedesktop.org</a> (FTP)
</p>
<p>
When a new release is coming, release candidates (betas) may be found
<a href="ftp://ftp.freedesktop.org/pub/mesa/beta/" target="_parent">here</a>.
<a href="ftp://ftp.freedesktop.org/pub/mesa/beta/">here</a>.
</p>
@@ -69,7 +75,6 @@ docs/ - documentation
src/ - source code for libraries
src/mesa - sources for the main Mesa library and device drivers
src/gallium - sources for Gallium and Gallium drivers
src/glu - libGLU source code
src/glx - sources for building libGL with full GLX and DRI support
</pre>
@@ -80,24 +85,33 @@ instructions</a>.
</p>
<h1>Demos and GLUT</h1>
<h1>Demos, GLUT, and GLU</h1>
<p>
A package of SGI's GLU library is available
<a href="ftp://ftp.freedesktop.org/pub/mesa/glu/">here</a>
</p>
<p>
A package of Mark Kilgard's GLUT library is available
<a href="ftp://ftp.freedesktop.org/pub/mesa/glut/" target="_parent">here</a>
<a href="ftp://ftp.freedesktop.org/pub/mesa/glut/">here</a>
</p>
<p>
The Mesa demos collection is available
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/" target="_parent">here</a>
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/">here</a>
</p>
<p>
In the past, GLUT and the Mesa demos were released in conjunction with
Mesa releases. But since GLUT and the demos change infrequently, they
were split off some time ago.
In the past, GLUT, GLU and the Mesa demos were released in conjunction with
Mesa releases. But since GLUT, GLU and the demos change infrequently, they
were split off into their own git repositories:
<a href="http://cgit.freedesktop.org/mesa/glut/">GLUT</a>,
<a href="http://cgit.freedesktop.org/mesa/glu/">GLU</a> and
<a href="http://cgit.freedesktop.org/mesa/demos/">Demos</a>,
</p>
</div>
</body>
</html>

View File

@@ -7,11 +7,18 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa EGL</h1>
<p>The current version of EGL in Mesa implements EGL 1.4. More information
about EGL can be found at
<a href="http://www.khronos.org/egl/" target="_parent">
<a href="http://www.khronos.org/egl/">
http://www.khronos.org/egl/</a>.</p>
<p>The Mesa's implementation of EGL uses a driver architecture. The main
@@ -53,28 +60,32 @@ or more EGL drivers.</p>
<p>There are several options that control the build of EGL at configuration
time</p>
<ul>
<li><code>--enable-egl</code>
<dl>
<dt><code>--enable-egl</code></dt>
<dd>
<p>By default, EGL is enabled. When disabled, the main library and the drivers
will not be built.</p>
</li>
</dd>
<li><code>--with-egl-driver-dir</code>
<dt><code>--with-egl-driver-dir</code></dt>
<dd>
<p>The directory EGL drivers should be installed to. If not specified, EGL
drivers will be installed to <code>${libdir}/egl</code>.</p>
</li>
</dd>
<li><code>--enable-gallium-egl</code>
<dt><code>--enable-gallium-egl</code></dt>
<dd>
<p>Enable the optional <code>egl_gallium</code> driver.</p>
</li>
</dd>
<li><code>--with-egl-platforms</code>
<dt><code>--with-egl-platforms</code></dt>
<dd>
<p>List the platforms (window systems) to support. Its argument is a comma
seprated string such as <code>--with-egl-platforms=x11,drm</code>. It decides
@@ -88,30 +99,34 @@ types such as <code>EGLNativeDisplayType</code> or
only be built with SCons. Unless for special needs, the build system should
select the right platforms automatically.</p>
</li>
</dd>
<li><code>--enable-gles1</code> and <code>--enable-gles2</code>
<dt><code>--enable-gles1</code></dt>
<dt><code>--enable-gles2</code></dt>
<dd>
<p>These options enable OpenGL ES support in OpenGL. The result is one big
internal library that supports multiple APIs.</p>
</li>
</dd>
<li><code>--enable-shared-glapi</code>
<dt><code>--enable-shared-glapi</code></dt>
<dd>
<p>By default, <code>libGL</code> has its own copy of <code>libglapi</code>.
This options makes <code>libGL</code> use the shared <code>libglapi</code>. This
is required if applications mix OpenGL and OpenGL ES.</p>
</li>
</dd>
<li><code>--enable-openvg</code>
<dt><code>--enable-openvg</code></dt>
<dd>
<p>OpenVG must be explicitly enabled by this option.</p>
</li>
</dd>
</ul>
</dl>
<h2>Use EGL</h2>
@@ -125,8 +140,9 @@ mesa/demos repository.</p>
<p>There are several environment variables that control the behavior of EGL at
runtime</p>
<ul>
<li><code>EGL_DRIVERS_PATH</code>
<dl>
<dt><code>EGL_DRIVERS_PATH</code></dt>
<dd>
<p>By default, the main library will look for drivers in the directory where
the drivers are installed to. This variable specifies a list of
@@ -144,18 +160,20 @@ may set</p>
<p>to test a build without installation</p>
</li>
</dd>
<li><code>EGL_DRIVER</code>
<dt><code>EGL_DRIVER</code></dt>
<dd>
<p>This variable specifies a full path to or the name of an EGL driver. It
forces the specified EGL driver to be loaded. It comes in handy when one wants
to test a specific driver. This variable is ignored for setuid/setgid
binaries.</p>
</li>
</dd>
<li><code>EGL_PLATFORM</code>
<dt><code>EGL_PLATFORM</code></dt>
<dd>
<p>This variable specifies the native platform. The valid values are the same
as those for <code>--with-egl-platforms</code>. When the variable is not set,
@@ -167,28 +185,31 @@ create displays for non-native platforms. These extensions are usually used by
applications that support non-native platforms. Setting this variable is
probably required only for some of the demos found in mesa/demo repository.</p>
</li>
</dd>
<li><code>EGL_LOG_LEVEL</code>
<dt><code>EGL_LOG_LEVEL</code></dt>
<dd>
<p>This changes the log level of the main library and the drivers. The valid
values are: <code>debug</code>, <code>info</code>, <code>warning</code>, and
<code>fatal</code>.</p>
</li>
</dd>
<li><code>EGL_SOFTWARE</code>
<dt><code>EGL_SOFTWARE</code></dt>
<dd>
<p>For drivers that support both hardware and software rendering, setting this
variable to true forces the use of software rendering.</p>
</li>
</ul>
</dd>
</dl>
<h2>EGL Drivers</h2>
<ul>
<li><code>egl_dri2</code>
<dl>
<dt><code>egl_dri2</code></dt>
<dd>
<p>This driver supports both <code>x11</code> and <code>drm</code> platforms.
It functions as a DRI driver loader. For <code>x11</code> support, it talks to
@@ -196,9 +217,10 @@ the X server directly using (XCB-)DRI2 protocol.</p>
<p>This driver can share DRI drivers with <code>libGL</code>.</p>
</li>
</dd>
<li><code>egl_gallium</code>
<dt><code>egl_gallium</code></dt>
<dd>
<p>This driver is based on Gallium3D. It supports all rendering APIs and
hardwares supported by Gallium3D. It is the only driver that supports OpenVG.
@@ -208,16 +230,17 @@ The supported platforms are X11, DRM, FBDEV, and GDI.</p>
(<code>pipe_&lt;hw&gt;</code>) and client API modules
(<code>st_&lt;api&gt;</code>).</p>
</li>
</dd>
<li><code>egl_glx</code>
<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>
</li>
</ul>
</dd>
</dl>
<h2>Packaging</h2>
@@ -317,5 +340,6 @@ not be called with the sample display at the same time. If a driver has access
to an <code>EGLDisplay</code> without going through the EGL APIs, the driver
should as well lock the display before using it.
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Environment Variables</h1>
<p>
@@ -62,9 +69,25 @@ If the extension string is too long, the buffer overrun can cause the game
to crash.
This is a work-around for that.
<li>MESA_GL_VERSION_OVERRIDE - changes the value returned by
glGetString(GL_VERSION). Valid values are point-separated version numbers,
such as "3.0". Mesa will not really implement all the features of the given
version if it's higher than what's normally reported.
glGetString(GL_VERSION) and possibly the GL API type.
<ul>
<li> The format should be MAJOR.MINOR[FC]
<li> FC is an optional suffix that indicates a forward compatible context.
This is only valid for versions &gt;= 3.0.
<li> GL versions &lt; 3.0 are set to a compatibility (non-Core) profile
<li> GL versions = 3.0, see below
<li> GL versions &gt; 3.0 are set to a Core profile
<li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
<ul>
<li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1
<li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0
<li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0
<li> 3.1 - select a Core profile with GL version 3.1
<li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1
</ul>
<li> Mesa may not really implement all the features of the given version.
(for developers only)
</ul>
<li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by
glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as
"130". Mesa will not really implement all the features of the given language version
@@ -168,5 +191,6 @@ Other Gallium drivers have their own environment variables. These may change
frequently so the source code should be consulted for details.
</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa Extensions</h1>
<p>
@@ -31,5 +38,6 @@ The specifications follow.
<li><a href="MESA_ycbcr_texture.spec">MESA_ycbcr_texture.spec</a>
</ul>
</div>
</body>
</html>

View File

@@ -7,9 +7,16 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<center>
<h1>Mesa Frequently Asked Questions</h1>
Last updated: 21 August 2006
Last updated: 9 October 2012
</center>
<br>
@@ -38,21 +45,25 @@ See the <a href="http://www.opengl.org/">OpenGL website</a> for more
information.
</p>
<p>
Mesa 6.x supports the OpenGL 1.5 specification.
Mesa 9.x supports the OpenGL 3.1 specification.
</p>
<h2>1.2 Does Mesa support/use graphics hardware?</h2>
<p>
Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
drivers for XFree86/X.org. See the <a href="http://dri.freedesktop.org/">DRI
website</a> for more information.
</p>
<p>
There have been other hardware drivers for Mesa over the years (such as
the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
are the modern ones.
drivers for X.org.
</p>
<ul>
<li>See the <a href="http://dri.freedesktop.org/">DRI website</a>
for more information.</li>
<li>See <a href="http://intellinuxgraphics.org">intellinuxgraphics.org</a>
for more information about Intel drivers.</li>
<li>See <a href="http://nouveau.freedesktop.org">nouveau.freedesktop.org</a>
for more information about Nouveau drivers.</li>
<li>See <a href="http://www.x.org/wiki/RadeonFeature">www.x.org/wiki/RadeonFeature</a>
for more information about Radeon drivers.</li>
</ul>
<h2>1.3 What purpose does Mesa serve today?</h2>
<p>
@@ -61,7 +72,7 @@ operating systems today.
Still, Mesa serves at least these purposes:
</p>
<ul>
<li>Mesa is used as the core of the open-source XFree86/X.org DRI
<li>Mesa is used as the core of the open-source X.org DRI
hardware drivers.
</li>
<li>Mesa is quite portable and allows OpenGL to be used on systems
@@ -83,7 +94,7 @@ Still, Mesa serves at least these purposes:
</ul>
<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
<h2>1.4 What's the difference between "Stand-Alone" Mesa and the DRI drivers?</h2>
<p>
<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
On systems running the X Window System it does all its rendering through
@@ -125,8 +136,7 @@ Just follow the Mesa <a href="install.html">compilation instructions</a>.
<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
<p>
Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
target="_parent">
Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html">
OpenGL Sample Implemenation (SI)</a> is available.
The SI was written during the time that OpenGL was originally designed.
Unfortunately, development of the SI has stagnated.
@@ -134,34 +144,33 @@ Mesa is much more up to date with modern features and extensions.
</p>
<p>
<a href="http://ogl-es.sourceforge.net" target="_parent">Vincent</a> is
<a href="http://sourceforge.net/projects/ogl-es/">Vincent</a> is
an open-source implementation of OpenGL ES for mobile devices.
<p>
<a href="http://www.dsbox.com/minigl.html" target="_parent">miniGL</a>
<a href="http://www.dsbox.com/minigl.html">miniGL</a>
is a subset of OpenGL for PalmOS devices.
<p>
<a href="http://fabrice.bellard.free.fr/TinyGL/"
target="_parent">TinyGL</a> is a subset of OpenGL.
<a href="http://bellard.org/TinyGL/">TinyGL</a>
is a subset of OpenGL.
</p>
<p>
<a href="http://softgl.studierstube.org/" target="_parent">SoftGL</a>
<a href="http://sourceforge.net/projects/softgl/">SoftGL</a>
is an OpenGL subset for mobile devices.
</p>
<p>
<a href="http://chromium.sourceforge.net/" target="_parent">Chromium</a>
<a href="http://chromium.sourceforge.net/">Chromium</a>
isn't a conventional OpenGL implementation (it's layered upon OpenGL),
but it does export the OpenGL API. It allows tiled rendering, sort-last
rendering, etc.
</p>
<p>
<a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html"
target="_parent">ClosedGL</a> is an OpenGL subset library for TI
graphing calculators.
<a href="http://www.ticalc.org/archives/files/fileinfo/361/36173.html">ClosedGL</a>
is an OpenGL subset library for TI graphing calculators.
</p>
<p>
@@ -211,8 +220,7 @@ GLw (OpenGL widget library) is now available from a separate <a href="http://cgi
<h2>2.5 What's the proper place for the libraries and headers?</h2>
<p>
On Linux-based systems you'll want to follow the
<a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"
target="_parent">Linux ABI</a> standard.
<a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html">Linux ABI</a> standard.
Basically you'll want the following:
</p>
<ul>
@@ -226,21 +234,24 @@ Basically you'll want the following:
</li><li>/usr/lib/libGL.so.1 - a symlink to libGL.so.1.xyz
</li><li>/usr/lib/libGL.so.xyz - the actual OpenGL/Mesa library. xyz denotes the
Mesa version number.
</li><li>/usr/lib/libGLU.so - a symlink to libGLU.so.1
</li><li>/usr/lib/libGLU.so.1 - a symlink to libGLU.so.1.3.xyz
</li><li>/usr/lib/libGLU.so.xyz - the OpenGL Utility library. xyz denotes the Mesa
version number.
</li></ul>
<p>
After installing XFree86/X.org and the DRI drivers, some of these files
may be symlinks into the /usr/X11R6/ tree.
When configuring Mesa, there are three autoconf options that affect the install
location that you should take care with: <code>--prefix</code>,
<code>--libdir</code>, and <code>--with-dri-driverdir</code>. To install Mesa
into the system location where it will be available for all programs to use, set
<code>--prefix=/usr</code>. Set <code>--libdir</code> to where your Linux
distribution installs system libraries, usually either <code>/usr/lib</code> or
<code>/usr/lib64</code>. Set <code>--with-dri-driverdir</code> to the directory
where your Linux distribution installs DRI drivers. To find your system's DRI
driver directory, try executing <code>find /usr -type d -name dri</code>. For
example, if the <code>find</code> command listed <code>/usr/lib64/dri</code>,
then set <code>--with-dri-driverdir=/usr/lib64/dri</code>.
</p>
<p>
The old-style Makefile system doesn't install the Mesa libraries; it's
up to you to copy them (and the headers) to the right place.
</p>
<p>
The GLUT header and library should go in the same directories.
After determining the correct values for the install location, configure Mesa
with <code>./configure --prefix=/usr --libdir=xxx --with-dri-driverdir=xxx</code>
and then install with <code>sudo make install</code>.
</p>
<br>
<br>
@@ -250,24 +261,22 @@ The GLUT header and library should go in the same directories.
<h2>3.1 Rendering is slow / why isn't my graphics hardware being used?</h2>
<p>
Stand-alone Mesa (downloaded as MesaLib-x.y.z.tar.gz) doesn't have any
support for hardware acceleration (with the exception of the 3DFX Voodoo
driver).
</p>
<p>
What you really want is a DRI or NVIDIA (or another vendor's OpenGL) driver
for your particular hardware.
If Mesa can't use its hardware accelerated drivers it falls back on one of its software renderers.
(eg. classic swrast, softpipe or llvmpipe)
</p>
<p>
You can run the <code>glxinfo</code> program to learn about your OpenGL
library.
Look for the GL_VENDOR and GL_RENDERER values.
That will identify who's OpenGL library you're using and what sort of
Look for the <code>OpenGL vendor</code> and <code>OpenGL renderer</code> values.
That will identify who's OpenGL library with which driver you're using and what sort of
hardware it has detected.
</p>
<p>
If you're using a hardware accelerated driver you want <code>direct rendering: Yes</code>.
</p>
<p>
If your DRI-based driver isn't working, go to the
<a href="http://dri.sf.net/" target="_parent">DRI website</a> for trouble-shooting information.
<a href="http://dri.freedesktop.org/">DRI website</a> for trouble-shooting information.
</p>
@@ -275,8 +284,8 @@ If your DRI-based driver isn't working, go to the
<p>
Make sure the ratio of the far to near clipping planes isn't too great.
Look
<a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040"
target="_parent"> here</a> for details.
<a href="http://www.opengl.org/resources/faq/technical/depthbuffer.htm#0040">here</a>
for details.
</p>
<p>
Mesa uses a 16-bit depth buffer by default which is smaller and faster
@@ -339,12 +348,11 @@ may introduce rasterization artifacts; see the leading comments in
<h2>4.1 How can I contribute?</h2>
<p>
First, join the <a href="http://www.mesa3d.org/lists.html">Mesa3d-dev
mailing list</a>.
First, join the <a href="lists.html">mesa-dev mailing list</a>.
That's where Mesa development is discussed.
</p>
<p>
The <a href="http://www.opengl.org/documentation" target="_parent">
The <a href="http://www.opengl.org/documentation">
OpenGL Specification</a> is the bible for OpenGL implemention work.
You should read it.
</p>
@@ -362,8 +370,8 @@ target hardware/operating system.
<p>
The best way to get started is to use an existing driver as your starting
point.
For a software driver, the X11 and OSMesa drivers are good examples.
For a hardware driver, the Radeon and R200 DRI drivers are good examples.
For a classic hardware driver, the i965 driver is a good example.
For a Gallium3D hardware driver, the r300g, r600g and the i915g are good examples.
</p>
<p>The DRI website has more information about writing hardware drivers.
The process isn't well document because the Mesa driver interface changes
@@ -378,7 +386,7 @@ the archives) is a good way to get information.
<h2>4.3 Why isn't GL_EXT_texture_compression_s3tc implemented in Mesa?</h2>
<p>
The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt" target="_parent">specification for the extension</a>
The <a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt">specification for the extension</a>
indicates that there are intellectual property (IP) and/or patent issues
to be dealt with.
</p>
@@ -388,10 +396,10 @@ implement the extension (specifically the compression/decompression
algorithms).
</p>
<p>
In the mean time, a 3rd party <a href=
"http://dri.freedesktop.org/wiki/S3TC"
target="_parent">plug-in library</a> is available.
In the mean time, a 3rd party <a href="http://dri.freedesktop.org/wiki/S3TC">
plug-in library</a> is available.
</p>
</div>
</body>
</html>

View File

@@ -1,64 +0,0 @@
<!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>Games</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Games</h1>
<ul>
<li><a href="http://www.psc.edu/%7Esmp/a3d/">Asteroids3D</a> - 3D asteroids game
</li><li><a href="http://evlweb.eecs.uic.edu/aej/AndyBattalion.html" target="_parent">Battalion</a>
- battle game
</li><li><a href="http://bzflag.sourceforge.net/" target="_parent">BZFLAG</a> - 3-D tank
battle game
</li><li><a href="http://www.speakeasy.org/%7Emorse/copter-commander" target="_parent">Copter Commander</a> - 2d multiplayer side scroller
</li><li><a href="http://www.crystalspace.org/" target="_parent">CrystalSpace</a> - Free
3d game engine
</li><li><a href="http://www.afn.org/%7Ecthugha/" target="_parent">Cthugha</a> - music-sync'ed
graphical effects
</li><li><a href="http://www.sics.se/dive/" target="_parent">DIVE</a> - Distributed Interactive
Virtual Environment
</li><li><a href="http://www.newdoom.com/doomlegacy/" target="_parent">Doom Legacy</a>
- an OpenGL port of id software's popular game, Doom
</li><li><a href="http://www.asimov.de/intern_dropit.html" target="_parent">DropIt</a> - 3-D tetris game
</li><li><a href="http://www.flightgear.org/" target="_parent">Flight Gear</a> - Flight
simulator
</li><li><a href="http://freetrek.linuxgames.com/" target="_parent">Free Trek</a> - Star
Trek battle simulator
</li><li><a href="http://glchess.sourceforge.net/" target="_parent">GLChess</a> - chess game
</li><li><a href="http://heretic.linuxgames.com/" target="_parent">GLHeretic</a> - Heretic
for Linux
</li><li><a href="http://glider3d.free.fr/" target="_parent">Glider3D</a> - flight simulator
</li><li><a href="http://www.gltron.org/" target="_parent">glTron</a> - Tron lightcycles
game
</li><li><a href="http://gracer.sourceforge.net/" target="_parent">GRacer</a> - 3D Motor
Sports Simulator
</li><li><a href="http://jongl.home.pages.de/" target="_parent">JONGL</a> - Juggling simulator
</li><li><a href="http://samba.anu.edu.au/KnightCap/" target="_parent">KnightCap</a> -
chess game
</li><li><a href="http://www.hackcraft.de/games/linwarrior_3d/" target="_parent">LinWarrior 3D</a> - A Battle Mech Simulator
</li><li><a href="http://www.nada.kth.se/%7Ef96-lfo/lunar/" target="_parent">Lunar Lander
2000</a> - 3D version of the classis lunar lander game
</li><li><a href="http://www.majik3d.org/" target="_parent">Majik 3D</a> - an online role-playing
world
</li><li><a href="http://www.pobox.com/%7Eshankel/opentrek.html" target="_parent">OpenTrek</a>
- Super Star Trek
</li><li><a href="http://www.idsoftware.com/" target="_parent">Quake(2,3)</a> - the popular
games from id software
</li><li><a href="http://torcs.free.fr/indexm.html" target="_parent">TORCS</a> - car racing
simulator
</li><li><a href="http://www.woodsoup.org/projs/tux_aqfh" target="_parent">TUX-AQFH</a>
- Tux the Penguin - a Quest for Herring
</li><li><a href="http://mordred.8m.com/voidrunner/" target="_parent">Void Runner</a>
- freeware arcade style game
</li><li><a href="http://xracer.annexia.org/" target="_parent">XRacer</a> - Free spaceship
racing game, similar to Wipeout
</li>
</ul>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,46 +0,0 @@
<!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>SGI GLU</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>SGI SI GLU</h1>
(Silicon Graphics, Inc. Sample Implementation of the OpenGL Utility library)
<p>
SGI open-sourced their OpenGL Sample Implementation (SI) in January, 2000.
This includes the GLU library.
</p>
<p>
The SI GLU library implements GLU version 1.3 whereas the original
Mesa GLU library only implemented version 1.2.
We recommend using the SI GLU library instead of Mesa's GLU library
since it's more up-to-date, complete and reliable.
We're no longer developing the original Mesa GLU library.
</p>
<p>
The SI GLU library code is included in the Mesa distribution.
You don't have to download it separately.
</p>
<p>
<b>Olivier Michel</b> has made Linux RPMs of GLU for i386 and PowerPC.
You can download them from the
<a href="http://www.sourceforge.net/project/showfiles.php?group_id=3"
target="_parent">download area</a> under <b>Miscellaneous</b>.
</p>
<p>
Visit the <a href="http://oss.sgi.com/projects/ogl-sample/" target="_parent">
OpenGL Sample Implementation home page</a> for more information about the SI.
</p>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Help Wanted / To-Do List</h1>
<p>
@@ -17,12 +24,12 @@ Here are some specific ideas and areas where help would be appreciated:
<ol>
<li>
<b>Driver patching and testing.</b>
Patches are often posted to the <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_parent">mesa-dev mailing list</a>, but aren't
Patches are often posted to the <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">mesa-dev mailing list</a>, but aren't
immediately checked into git because not enough people are testing them.
Just applying patches, testing and reporting back is helpful.
<li>
<b>Driver debugging.</b>
There are plenty of open bugs in the <a href="https://bugs.freedesktop.org/describecomponents.cgi?product=Mesa" target="_parent">bug database</a>.
There are plenty of open bugs in the <a href="https://bugs.freedesktop.org/describecomponents.cgi?product=Mesa">bug database</a>.
<li>
<b>Remove aliasing warnings.</b>
Enable gcc -Wstrict-aliasing=2 -fstrict-aliasing and track down aliasing
@@ -31,13 +38,8 @@ issues in the code.
<b>Windows driver building, testing and maintenance.</b>
Fixing MSVC builds.
<li>
<b>Maintenance and testing of lesser-used drivers.</b>
Drivers such as i810, mach64, mga, r128, savage, sis, tdfx, unichrome, etc that aren't being maintained are being
deprecated starting in Mesa 8.0.<br>
They have to be ported to DRI2 to be accepted in mesa master again.
<li>
<b>Contribute more tests to
<a href="http://people.freedesktop.org/~nh/piglit/" target="_parent">Piglit</a>.</b>
<a href="http://piglit.freedesktop.org/">Piglit</a>.</b>
<li>
<b>Automatic testing.
</b>
@@ -46,6 +48,35 @@ the latest Mesa code and run tests (such as piglit) then report issues to
the mailing list.
</ol>
<p>
You can find some further To-do lists here:
</p>
<p>
<b>Common To-Do lists:</b>
</p>
<ul>
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/docs/GL3.txt">
<b>GL3.txt</b></a> - Status of OpenGL 3.x / 4.x features in Mesa.</li>
<li><a href="http://dri.freedesktop.org/wiki/MissingFunctionality">
<b>MissingFunctionality</b></a> - Detailed information about missing OpenGL features.</li>
</ul>
<p>
<b>Driver specific To-Do lists:</b>
</p>
<ul>
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/docs/llvm-todo.txt">
<b>LLVMpipe</b></a> - Software driver using LLVM for runtime code generation.</li>
<li><a href="http://dri.freedesktop.org/wiki/RadeonsiToDo">
<b>radeonsi</b></a> - Driver for AMD Southern Island.</li>
<li><a href="http://dri.freedesktop.org/wiki/R600ToDo">
<b>r600g</b></a> - Driver for ATI/AMD R600 - Northern Island.</li>
<li><a href="http://dri.freedesktop.org/wiki/R300ToDo">
<b>r300g</b></a> - Driver for ATI R300 - R500.</li>
<li><a href="http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/i915/TODO">
<b>i915g</b></a> - Driver for Intel i915/i945.</li>
</ul>
<p>
If you want to do something new in Mesa, first join the Mesa developer's
@@ -69,6 +100,6 @@ Finally:
<li>Test your code thoroughly. Include test programs if appropriate.
</ol>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Compiling and Installing</h1>
<ol>
@@ -52,9 +59,9 @@ The following are required for DRI-based hardware acceleration with Mesa:
</p>
<ul>
<li><a href="http://xorg.freedesktop.org/releases/individual/proto/"
target="_parent">dri2proto</a> version 2.6 or later
<li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
<li><a href="http://xorg.freedesktop.org/releases/individual/proto/">
dri2proto</a> version 2.6 or later
<li><a href="http://dri.freedesktop.org/libdrm/">libDRM</a>
version 2.4.33 or later
<li>Xorg server version 1.5 or later
<li>Linux 2.6.28 or later
@@ -151,9 +158,6 @@ You'll see a set of library files similar to this:
lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
-rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
-rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
@@ -162,8 +166,6 @@ lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSM
<p>
<b>libGL</b> is the main OpenGL library (i.e. Mesa).
<br>
<b>libGLU</b> is the OpenGL Utility library.
<br>
<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
</p>
@@ -174,7 +176,6 @@ If you built the DRI hardware drivers, you'll also see the DRI drivers:
-rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
-rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i965_dri.so
-rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
-rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
-rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
</pre>
@@ -205,6 +206,6 @@ For example, compiling and linking a GLUT application can be done with:
<br>
</div>
</body>
</html>

View File

@@ -7,11 +7,18 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Introduction</h1>
<p>
Mesa is an open-source implementation of the
<a href="http://www.opengl.org/" target="_parent">OpenGL</a> specification -
<a href="http://www.opengl.org/">OpenGL</a> specification -
a system for rendering interactive 3D graphics.
</p>
@@ -23,8 +30,8 @@ for modern GPUs.
<p>
Mesa ties into several other open-source projects: the
<a href="http://dri.freedesktop.org/" target="_parent">Direct Rendering
Infrastructure</a> and <a href="http://x.org" target="_parent">X.org</a> to
<a href="http://dri.freedesktop.org/">Direct Rendering
Infrastructure</a> and <a href="http://x.org">X.org</a> to
provide OpenGL support to users of X on Linux, FreeBSD and other operating
systems.
</p>
@@ -78,7 +85,7 @@ the OpenGL API, so they didn't feel threatened by the project.
1995-1996: I continue working on Mesa both during my spare time and during
my work hours at the Space Science and Engineering Center at the University
of Wisconsin in Madison. My supervisor, Bill Hibbard, lets me do this because
Mesa is now being using for the <a href="http://www.ssec.wisc.edu/%7Ebillh/vis.html" target="_parent">Vis5D</a> project.
Mesa is now being using for the <a href="http://www.ssec.wisc.edu/%7Ebillh/vis.html">Vis5D</a> project.
</p><p>
October 1996: Mesa 2.0 is released. It implements the OpenGL 1.1 specification.
</p>
@@ -135,7 +142,7 @@ and OpenGL Shading Language.
<p>
2008: Keith Whitwell and other Tungsten Graphics employees develop
<a href="http://en.wikipedia.org/wiki/Gallium3D" target="_parent">Gallium</a>
<a href="http://en.wikipedia.org/wiki/Gallium3D">Gallium</a>
- a new GPU abstraction layer. The latest Mesa drivers are based on
Gallium and other APIs such as OpenVG are implemented on top of Gallium.
</p>
@@ -166,6 +173,17 @@ of the OpenGL specification is implemented.
</p>
<h2>Version 9.x features</h2>
<p>
Version 9.x of Mesa implements the OpenGL 3.1 API.
While the driver for Intel Sandy Bridge and Ivy Bridge is the only
driver to support OpenGL 3.1, many developers across the open-source
community contributed features required for OpenGL 3.1. The primary
features added since the Mesa 8.0 release are
GL_ARB_texture_buffer_object and GL_ARB_uniform_buffer_object.
</p>
<h2>Version 8.x features</h2>
<p>
Version 8.x of Mesa implements the OpenGL 3.0 API.
@@ -216,7 +234,7 @@ GL_SRC2_ALPHA GL_SOURCE2_ALPHA
</pre>
<p>
See the
<a href="http://www.opengl.org/documentation/spec.html" target="_parent">
<a href="http://www.opengl.org/documentation/spec.html">
OpenGL specification</a> for more details.
</p>
@@ -332,6 +350,6 @@ features.
</ul>
</ul>
</div>
</body>
</html>

View File

@@ -1,58 +0,0 @@
<!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>Libraries and Toolkits</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Libraries and Toolkits</h1>
<ul>
<li><a href="http://mrpowers.com/Apprentice/" target="_parent">Apprentice</a> - free OpenInventor work-alike
<li><a href="http://www.coin3d.org/coin.html" target="_parent">Coin</a> - OSS Open Inventor clone
<li><a href="http://www.softintegration.com/products/toolkit/opengl/" target="_parent">Ch</a> - OpenGL bindings for the Ch C/C++ interpreter
<li><a href="http://www.cfdrc.com/FOX/fox.html" target="_parent">FOX</a> - GUI Library
<li><a href="http://www.jausoft.com/gl4java.html" target="_parent">GL4Java</a> - a Java wrapper for OpenGL
<li><a href="http://www.student.oulu.fi/%7Ejlof/gtkglarea/" target="_parent">GtkGLArea</a> - OpenGL Gtk widget
<li><a href="http://www.ece.ucdavis.edu/%7Ekenelson/gtk-glarea/" target="_parent">GtkGLArea--</a> - OpenGL Gtk-- widget for C++
<li><a href="http://gtkpas.sourceforge.net/" target="_parent">GTKpas</a> - OpenGL Gtk widget for <a href="http://www.freepascal.org/" target="_parent">FreePascal</a>
<li><a href="http://freeglut.sourceforge.net/" target="_parent">FreeGLUT</a> - a GLUT work-alike
<li><a href="http://math.nist.gov/f90gl" target="_parent">Fortran77/90 bindings for OpenGL and Mesa</a> - by William Mitchell
<li><a href="http://glow.sourceforge.net/" target="_parent">GLOW</a> - a GUI toolkit for GLUT and OpenGL
<li><a href="http://www.nigels.com/glt/">Glt</a> - an OpenGL C++ toolkit
<li><a href="http://www.opengl.org/resources/libraries/glut.html" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
<li><a href="http://atrey.karlin.mff.cuni.cz/%7E0rfelyus/guileGL/" target="_parent">GuileGL</a> - OpenGL and GtkGLArea language bindings for Guile
<li><a href="http://www.rsinc.com/" target="_parent">IDL</a> - Interactive Data Language
<li><a href="http://www.newplanetsoftware.com/jx/" target="_parent">JX</a> - C++ application framework and GUI library
<li><a href="http://www.vrs3d.org/" target="_parent">MAM/VRS</a> - object-oriented toolkit for 3D graphics
<li><a href="http://www.jwdt.com/%7Epaysan/bigforth.html" target="_parent">MINOS</a> - GUI library
<li><a href="http://sourceforge.net/project/?group_id=2795" target="_parent">OglCLib</a> - C++ wrapper for OpenGL
<li><a href="http://oss.sgi.com/projects/inventor" target="_parent"> Open Inventor</a> - the Open Inventor toolkit from SGI
<li><a href="http://www.tgs.com/" target="_parent">Open Inventor</a> - the Open Inventor toolkit from Template Graphics Software, Inc.
<li><a href="http://openrm.sourceforge.net/" target="_parent">OpenRM</a>
- Open Source, multithreaded, parallel scene graph API
<li><a href="http://www.opensg.org/OpenSGPLUS/index.EN.html" target="_parent">
Open SG PLUS</a> - a scene-graph library
<li><a href="http://www.openscenegraph.org/" target="_parent">Open Scene Graph
</a> - a scene-graph library
<li><a href="http://www.openvrml.org/" target="_parent">OpenVRML</a>
- a VRML parsing/display library with "lookat" - an example VRML browser
<li><a href="http://plib.sourceforge.net/" target="_parent">PLIB</a> - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API
<li><a href="ftp://ftp.troll.no/contest/Pryan-1.2.tar.gz" target="_parent">Pryan</a> - an OpenInventor-like toolkit
<li><a href="http://starship.python.net:9673/crew/da/Code/PyOpenGL" target="_parent">PyOpenGL</a> - OpenGL interface for Python
<li><a href="http://www.quesa.org/" target="_parent">Quesa</a> - QuickDraw3D-compatible library based on OpenGL, Mesa or Direct3D
<li><a href="http://www.mesa3d.org/brianp/repgl.txt" target="_parent">repGL</a> - IRIS GL emulated with OpenGL
<li><a href="http://www.scitechsoft.com/dp_mgl.html" target="_parent">SciTech MGL</a> - A multiplatform (Windows, Linux, OS/2, DOS, QNX, SMX, RT-Target &amp; more) graphics library
<li><a href="http://sgl.sourceforge.net/" target="_parent">SGL</a> - a 3D Scene Graph Library
<li><a href="http://www.lal.in2p3.fr/SI/SoFree/" target="_parent">SoFree</a> - a free implementation of Open Inventor
<li><a href="http://togl.sourceforge.net/" target="_parent">Togl</a> - Tcl/Tk widget for OpenGL
<li><a href="http://www.int.com/" target="_parent">View3D Widget</a> - 3-D GUI widget
<li><a href="http://www.vtk.org/" target="_parent">VTK</a> - Visualization Toolkit
<li><a href="http://home.earthlink.net/%7Erzeh/YAJOGLB/doc/YAJOGLB.html" target="_parent">YAJOGL</a> - Yet Another Java GL Binding.
</ul>
</body>
</html>

View File

@@ -2,19 +2,26 @@
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>License / Cppyright Information</title>
<title>License / Copyright Information</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>Disclaimer</h1>
<p>
Mesa is a 3-D graphics library with an API which is very similar to
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
that of <a href="http://www.opengl.org/">OpenGL</a>.*
To the extent that Mesa utilizes the OpenGL command syntax or state
machine, it is being used with authorization from <a
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
href="http://www.sgi.com/">Silicon Graphics,
Inc.</a>(SGI). However, the author does not possess an OpenGL license
from SGI, and makes no claim that Mesa is in any way a compatible
replacement for OpenGL or associated with SGI. Those who want a
@@ -30,7 +37,7 @@ library</em>. <br>
<p>
* OpenGL is a trademark of <a href="http://www.sgi.com/"
target="_parent">Silicon Graphics Incorporated</a>.
>Silicon Graphics Incorporated</a>.
</p>
@@ -95,14 +102,12 @@ Device drivers src/mesa/drivers/* MIT, generally
Ext headers include/GL/glext.h Khronos
include/GL/glxext.h
SGI GLU library src/glu/sgi/ SGI Free B
</pre>
<p>
In general, consult the source files for license terms.
</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mailing Lists</h1>
@@ -14,26 +21,24 @@
</p>
<ul>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-users"
target="_parent">mesa-users</a> - intended for end-users of Mesa and DRI
drivers. Newbie questions are OK, but please try the general OpenGL
resources and Mesa/DRI documentation first.</p>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-users">mesa-users</a>
- intended for end-users of Mesa and DRI drivers. Newbie questions are OK,
but please try the general OpenGL resources and Mesa/DRI documentation first.</p>
</li>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev"
target="_parent">mesa-dev</a> - for Mesa, Gallium and DRI development
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">mesa-dev</a>
- for Mesa, Gallium and DRI development
discussion. Not for beginners.</p>
</li>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit"
target="_parent">mesa-commit</a> - relays git check-in messages
(for developers).
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit">mesa-commit</a>
- relays git check-in messages (for developers).
In general, people should not post to this list.</p>
</li>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-announce"
target="_parent">mesa-announce</a> - announcements of new Mesa
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-announce">mesa-announce</a>
- announcements of new Mesa
versions are sent to this list. Very low traffic.</p>
</li>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/piglit"
target="_parent">piglit</a> - for Piglit (OpenGL driver testing framework) discussion.</p>
<li><p><a href="http://lists.freedesktop.org/mailman/listinfo/piglit">piglit</a>
- for Piglit (OpenGL driver testing framework) discussion.</p>
</li>
</ul>
@@ -51,20 +56,24 @@ Follow the links above for list archives.
<p>
The old Mesa lists hosted at SourceForge are no longer in use.
The archives are still available, however:
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-announce" target="_parent">mesa3d-announce</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-users" target="_parent">mesa3d-users</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-dev" target="_parent">mesa3d-dev</a>.
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-announce">mesa3d-announce</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-users">mesa3d-users</a>,
<a href="http://sourceforge.net/mailarchive/forum.php?forum_name=mesa3d-dev">mesa3d-dev</a>.
</p>
<p>For mailing lists about Direct Rendering Modules (drm) in Linux/BSD
kernels, see the
<a href="http://dri.freedesktop.org/wiki/MailingLists" target="_parent">
DRI wiki</a>.
<a href="http://dri.freedesktop.org/wiki/MailingLists">DRI wiki</a>.
</p>
<br>
<h1>IRC</h1>
<p>join <a href="irc://chat.freenode.net#dri-devel">#dri-devel channel</a>
on <a href="http://webchat.freenode.net/">irc.freenode.net</a>
</p>
<h1>OpenGL Forums</h1>
@@ -73,8 +82,8 @@ Here are some other OpenGL-related forums you might find useful:
</p>
<ul>
<li><a href="http://www.opengl.org/cgi-bin/ubb/ultimatebb.cgi"
target="_parent">OpenGL discussion forums</A> at www.opengl.org</li>
<li><a href="http://www.opengl.org/cgi-bin/ubb/ultimatebb.cgi">OpenGL discussion forums</a>
at www.opengl.org</li>
<li>Usenet newsgroups:
<ul>
<li>comp.graphics.algorithms</li>
@@ -83,5 +92,6 @@ target="_parent">OpenGL discussion forums</A> at www.opengl.org</li>
</ul>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Introduction</h1>
<p>
@@ -201,5 +208,6 @@ for posterior analysis, e.g.:
</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Function Name Mangling</h1>
<p>
@@ -26,6 +33,6 @@ For example:
CFLAGS += -DUSE_MGL_NAMESPACE
</pre>
</div>
</body>
</html>

View File

@@ -31,3 +31,33 @@ pre {
/*color: black;*/
}
iframe {
width: 19em;
height: 80em;
border: none;
float: left;
}
.content {
position: absolute;
left: 20em;
right: 10px;
overflow: hidden
}
.header {
background: black url('gears.png') 15px no-repeat;
margin:0;
padding: 5px;
clear:both;
}
.header h1 {
background: url('gears.png') right no-repeat;
color: white;
font: x-large sans-serif;
text-align: center;
height: 50px;
margin: 0;
padding-top: 30px;
}

View File

@@ -1,65 +0,0 @@
<!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>Modelers, Renderers and Viewers</title>
<link rel="stylesheet" type="text/css" href="mesa.css">
</head>
<body>
<h1>Modelers, Renderers and Viewers</h1>
<ul>
<li><a href="http://www.aqsis.org/" target="_parent">Aqsis</a> - a RenderMan compatible renderer</li>
<li><a href="http://www.ac3d.org/" target="_parent">AC3D</a> - 3-D modeler
</li><li><a href="http://www.mediascape.com/" target="_parent">Artstream</a> - provides
functionality like Corel Draw and Illustrator
</li><li><a href="http://www.blender.org/" target="_parent">Blender</a> - 3-D animation
software
</li><li><a href="http://www.arq.net/%7Ekasten/demtools/" target="_parent">Demtools</a>
- Map viewer
</li><li><a href="http://www.holometric.de/dimension/" target="_parent">DIMENSION</a>
- freeform surface reconstruction
</li><li><a href="http://www.vectaport.com/vhclmaps/demviewer.html" target="_parent">demviewer</a>
- interactive terrain viewer
</li><li><a href="http://www.crc.ca/FreeWRL" target="_parent">FreeWRL</a> - VRML browser
</li><li><a href="http://www.geomview.org/" target="_parent">Geomview</a> - 3-D geometry
exploration
</li><li><a href="http://innovation3d.sourceforge.net/" target="_parent">Innovation3D</a>
- 3D modeling program
</li><li><a href="http://www.openvrml.org/" target="_parent">LibVRML97/Lookat</a>
- VRML viewer
</li><li><a href="http://aig.cs.man.ac.uk/systems/Maverik/" target="_parent">Maverik</a>
- VR graphics and interaction system
</li><li><a href="http://www.swissquake.ch/chumbalum-soft/md2v" target="_parent">MD2 Viewer</a>
- View .MD2 files
</li><li><a href="http://www.megacads.dlr.de/" target="_parent">MegaCads</a>
- Multiblock-Elliptic-Grid-Generation-And-CAD-System
</li><li><a href="http://www.swissquake.ch/chumbalum-soft/" target="_parent">MilkShape
3D</a> - 3D modeler/animator
</li><li><a href="http://mindseye.sourceforge.net/" target="_parent">Mindseye</a> - Rendering/Modeling
Package
</li><li><a href="http://www.neuralvr.com/" target="_parent">Pansophica</a> - Virtual Reality web organizer
</li><li><a href="http://www.sim.no/reducer.html" target="_parent">Rational Reducer</a>
- polygon reduction tool
</li><li><a href="http://www.cs.kuleuven.ac.be/cwis/research/graphics/RENDERPARK/" target="_parent">RenderPark</a>
- photorealistic rendering
</li><li><a href="http://www.hardgeus.com/revolution" target="_parent">Revolution 3D Engine</a>
- .3ds rendering engine
</li><li><a href="http://www.dgp.toronto.edu/%7Emjmcguff/eversion/" target="_parent">sphereEversion</a>
- inside-out sphere visualization
</li><li><a href="http://www.cs.kuleuven.ac.be/cwis/research/graphics/3DOM/" target="_parent">3Dom</a>
- 3-D modeler
</li><li><a href="http://www.microform.se/" target="_parent">VARKON</a> - product engineering,
design, modeling
</li><li><a href="http://www.sim.no/vrmlview.html" target="_parent">VRMLview</a> - VRML
model viewer
</li><li><a href="http://www.iicm.edu/vrwave/" target="_parent">VRWave</a> - a VRML 2.0
browser
</li><li><a href="http://www.csv.ica.uni-stuttgart.de/vrml/dune/" target="_parent">white_dune</a>
- graphical VRML97 Editor and animation tool
</li></ul>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -7,11 +7,18 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>OpenGL ES</h1>
<p>Mesa implements OpenGL ES 1.1 and OpenGL ES 2.0. More informations about
OpenGL ES can be found at <a href="http://www.khronos.org/opengles/"
target="_parent"> http://www.khronos.org/opengles/</a>.</p>
OpenGL ES can be found at <a href="http://www.khronos.org/opengles/">
http://www.khronos.org/opengles/</a>.</p>
<p>OpenGL ES depends on a working EGL implementation. Please refer to
<a href="egl.html">Mesa EGL</a> for more information about EGL.</p>
@@ -58,5 +65,6 @@ EGL drivers for your hardware.</p>
<p>Other than the last case, OpenGL ES uses <code>APIspec.xml</code> to generate functions to check and/or converts the arguments.</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>OpenVG State Tracker</h1>
<p>
@@ -14,7 +21,7 @@ The current version of the OpenVG state tracker implements OpenVG 1.1.
</p>
<p>
More informations about OpenVG can be found at
<a href="http://www.khronos.org/openvg/" target="_parent">
<a href="http://www.khronos.org/openvg/">
http://www.khronos.org/openvg/</a> .
</p>
<p>
@@ -47,5 +54,6 @@ or more EGL drivers.</p>
<p>OpenVG demos can be found in mesa/demos repository.</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Off-screen Rendering</h1>
@@ -27,8 +34,7 @@ more information about the API functions.
</p>
<p>
There are several examples of OSMesa in the <code>progs/osdemos/</code>
directory.
There are several examples of OSMesa in the mesa/demos repository.
</p>
@@ -85,5 +91,6 @@ the top-level Makefile. Send a patch to the Mesa developers too, if you're
inclined.
</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Performance Tips</h1>
<p>
@@ -64,6 +71,6 @@ Performance tips for software rendering:
command glEnable(GL_DITHER) will be ignored.
</ol>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Gallium Post-processing</h1>
<p>
@@ -52,6 +59,6 @@ Numbers higher than 8 see minimizing gains.
<br>
<br>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Precompiled Libraries</h1>
<p>
@@ -17,5 +24,6 @@ However, some Linux distros (such as Ubuntu) seem to closely track
Mesa and often have the latest Mesa release available as an update.
</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.4.1 / November 29, 2006</h1>
<p>
@@ -63,5 +70,6 @@ Allegro requires updates
D3D requires updates
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.4.2 / February 2, 2006</h1>
<p>
@@ -70,5 +77,6 @@ Allegro requires updates
D3D requires updates
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.4 / October 24, 2005</h1>
<p>
@@ -85,5 +92,6 @@ Allegro requires updates
D3D requires updates
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.5.1 Release Notes / September 15, 2006</h1>
<p>
@@ -134,5 +141,6 @@ Allegro needs updating
D3D needs updating
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.5.2 Release Notes / December 2, 2006</h1>
<p>
@@ -121,5 +128,6 @@ Allegro needs updating
D3D needs updating
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.5.3 Release Notes / April 27, 2007</h1>
<p>
@@ -114,5 +121,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 6.5 Release Notes / March 31, 2006</h1>
<p>
@@ -126,5 +133,6 @@ Allegro needs updating
D3D needs updating
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.0.1 Release Notes / August 3, 2007</h1>
<p>
@@ -96,5 +103,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.0.2 Release Notes / November 10, 2007</h1>
<p>
@@ -83,5 +90,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.0.3 Release Notes / April 4, 2008</h1>
<p>
@@ -79,5 +86,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.0.4 Release Notes / August 16, 2008</h1>
<p>
@@ -75,5 +82,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.0 Release Notes / June 22, 2007</h1>
<p>
@@ -88,5 +95,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.1 Release Notes / August 26, 2008</h1>
<p>
@@ -89,5 +96,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.10.1 Release Notes / March 2, 2011</h1>
<p>
@@ -371,5 +378,6 @@ with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>glx: Put null check before use</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.10.2 Release Notes / April 6, 2011</h1>
<p>
@@ -199,5 +206,6 @@ f5de82852f1243f42cc004039e10b771 MesaLib-7.10.2.tar.bz2
<li>r300/compiler: Don't try to convert RGB to Alpha in full instructions</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.10.3 Release Notes / June 13, 2011</h1>
<p>
@@ -296,5 +303,6 @@ d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
<li>st/mesa: assign renderbuffer's format field when allocating storage</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.10 Release Notes / January 7, 2011</h1>
<p>
@@ -2786,5 +2793,6 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.11.1 Release Notes / November 17, 2011</h1>
<p>
@@ -384,5 +391,6 @@ dfcb11516c1730f3981b55a65a835623 MesaLib-7.11.1.zip
<li>intel: don't call unmap pbo if pbo is not mapped</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.11.2 Release Notes / November 27, 2011</h1>
<p>
@@ -78,5 +85,6 @@ f8705fcff2510b6c39cd27b575c05dba MesaGLUT-7.11.2.zip
<li>mesa: Bump version to 7.11.2 (final)</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.11 Release Notes / July 31, 2011</h1>
<p>
@@ -341,5 +348,6 @@ driver that implemented it.
git log mesa-7.10..mesa-7.11
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.2 Release Notes / 20 September 2008</h1>
<p>
@@ -99,5 +106,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.3 Release Notes / 22 January 2009</h1>
<p>
@@ -88,5 +95,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.4.1 Release Notes / 18 April 2009</h1>
<p>
@@ -74,5 +81,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.4.2 Release Notes / May 15, 2009</h1>
<p>
@@ -69,5 +76,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.4.3 Release Notes / 19 June 2009</h1>
<p>
@@ -74,5 +81,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.4.4 Release Notes / 23 June 2009</h1>
<p>
@@ -63,5 +70,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.4 Release Notes / 27 March 2009</h1>
<p>
@@ -84,5 +91,6 @@ Allegro unsupported
D3D unsupported
</pre>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.5.1 Release Notes, 3 September 2009</h1>
<p>
@@ -14,8 +21,7 @@ Mesa 7.5.1 is a bug-fix release fixing issues found since the 7.5 release.
</p>
<p>
The main new feature of Mesa 7.5.x is the
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
target="_parent">Gallium3D</a> infrastructure.
<a href="http://wiki.freedesktop.org/wiki/Software/gallium">Gallium3D</a> infrastructure.
</p>
<p>
Mesa 7.5.1 implements the OpenGL 2.1 API, but the version reported by
@@ -66,6 +72,6 @@ da1de364df148c94b4994006191a1e69 MesaGLUT-7.5.1.zip
<li>Fixed Gallium glCopyPixels(GL_STENCIL_INDEX) mispositioned image bug.
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.5.2 Release Notes, 28 September 2009</h1>
<p>
@@ -14,8 +21,7 @@ Mesa 7.5.2 is a bug-fix release fixing issues found since the 7.5.1 release.
</p>
<p>
The main new feature of Mesa 7.5.x is the
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
target="_parent">Gallium3D</a> infrastructure.
<a href="http://wiki.freedesktop.org/wiki/Software/gallium">Gallium3D</a> infrastructure.
</p>
<p>
Mesa 7.5.2 implements the OpenGL 2.1 API, but the version reported by
@@ -62,5 +68,6 @@ e82ba28e00d653e6f437d32be8ca8481 MesaGLUT-7.5.2.zip
when using Gallium.
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.5 Release Notes / 17 July 2009</h1>
<p>
@@ -16,8 +23,7 @@ with the 7.4.x branch or wait for Mesa 7.5.1.
</p>
<p>
The main new feature of Mesa 7.5 is the
<a href="http://wiki.freedesktop.org/wiki/Software/gallium"
target="_parent">Gallium3D</a> infrastructure.
<a href="http://wiki.freedesktop.org/wiki/Software/gallium">Gallium3D</a> infrastructure.
</p>
<p>
Mesa 7.5 implements the OpenGL 2.1 API, but the version reported by
@@ -97,5 +103,6 @@ GL_SGIX_depth_texture extensions. Superseded by the ARB versions.
<li>Omitted some old Mesa demos from the release tarballs, added some others.
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.6.1 Release Notes, 21 December 2009</h1>
<p>
@@ -74,6 +81,6 @@ ca9aecb91f05b1da9fd7d5eeb19d47d7 MesaGLUT-7.6.1.tar.bz2
<li>Removed old VC6, VC7 project files for Windows
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.6 Release Notes, 28 September 2009</h1>
<p>
@@ -79,5 +86,6 @@ This was written by Zack Rusin at Tungsten Graphics.
buffers (GLSL uniforms)
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.7.1 Release Notes / March 28, 2010</h1>
<p>
@@ -54,6 +61,6 @@ d352c9e36a8e4d1059f4abc017b131e0 MesaGLUT-7.7.1.zip
<li>Fixed broken glPush/PopClientAttrib() for vertex arrays in GLX code.
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.7 Release Notes / 21 December 2009</h1>
<p>
@@ -65,5 +72,6 @@ e8dceed05a59a2d3c2619d7d734587e3 MesaGLUT-7.7.tar.bz2
<li>Removed some unused Mesa device driver hooks
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.8.1 Release Notes / April 5, 2010</h1>
<p>
@@ -57,5 +64,7 @@ ba306f603ea73c30ee0e7efa14dc5581 MesaGLUT-7.8.1.zip
<h2>Changes</h2>
<p>None.</p>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.8.2 Release Notes / June 17, 2010</h1>
<p>
@@ -140,6 +147,6 @@ a471807b65e49c325808ba4551be93ed MesaGLUT-7.8.2.tar.bz2
<li>Various build fixes for GCC 3.3.</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.8.3 Release Notes / (date tbd)</h1>
<p>
@@ -83,6 +90,6 @@ image.</li>
<li>r300c: a hardlock caused by ARB_half_float_vertex incorrectly advertised on some chipsets.</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.8 Release Notes / March 28, 2010</h1>
<p>
@@ -65,5 +72,6 @@ b54581aeb79b585b158d6a32f94feff2 MesaGLUT-7.8.zip
<li>Removed support for GCC versions earlier than 3.3.0.</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.9.1 Release Notes / January 7, 2011</h1>
<p>
@@ -399,5 +406,6 @@ ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
<li>r600c : inline vertex format is not updated in an app, switch to use vfetch constants. For the 7.9 and 7.10 branches as well.</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.9.2 Release Notes / March 2, 2011</h1>
<p>
@@ -328,5 +335,6 @@ with <tt>in</tt>, <tt>out</tt>, <tt>attribute</tt>, and <tt>varying</tt>.</li>
<li>glx: Put null check before use</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 7.9 Release Notes / October 4, 2010</h1>
<p>
@@ -132,5 +139,6 @@ repository.
<li>GL/wglext.h file upgraded to version 22
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 8.0.1 Release Notes / February 16, 2012</h1>
<p>
@@ -146,5 +153,6 @@ for DRI hardware acceleration.
<li>r600g: Use a fake reloc to sleep for fences</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 8.0.2 Release Notes / March 21, 2012</h1>
<p>
@@ -152,6 +159,6 @@ d5e5cdb85d2afdbcd1c0623d3ed1c54d MesaLib-8.0.2.zip
<li>svga: fix the rasterizer state resets</li>
</ul>
</div>
</body>
</html>

View File

@@ -7,6 +7,13 @@
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="contents.html"></iframe>
<div class="content">
<h1>Mesa 8.0.3 Release Notes / May 18, 2012</h1>
<p>
@@ -312,5 +319,6 @@ cc5ee15e306b8c15da6a478923797171 MesaLib-8.0.3.tar.bz2
<li>i965: fix wrong cube/3D texture layout</li>
</ul>
</div>
</body>
</html>

209
docs/relnotes-8.0.4.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 8.0.4 Release Notes / July 10, 2012</h1>
<p>
Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
</p>
<p>
Mesa 8.0.4 implements the OpenGL 3.0 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 3.0.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
02b96082d2f1ad72e7385f4022afafb9 MesaLib-8.0.4.tar.gz
d546f988adfdf986cff45b1efa2d8a46 MesaLib-8.0.4.tar.bz2
1f0fdabe6e8019d4de6c16e20e74d163 MesaLib-8.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=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length &lt;= buffer-&gt;width0' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb-&gt;rtt_level &lt;= strb-&gt;texture-&gt;last_level' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </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-8.0.3..mesa-8.0.4
</pre>
<p>Andreas Betz (1):</p>
<ul>
<li>vega: fix 565 color unpacking bug</li>
</ul>
<p>Antoine Labour (2):</p>
<ul>
<li>meta: Cleanup the resources we allocate.</li>
<li>mesa: Free uniforms correclty.</li>
</ul>
<p>Brian Paul (22):</p>
<ul>
<li>docs: add link to 8.0.3 release notes</li>
<li>mesa: fix Z32_FLOAT -&gt; uint conversion functions</li>
<li>draw: fix primitive restart bug by using the index buffer offset</li>
<li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
<li>svga: fix synchronization bug between sampler views and surfaces</li>
<li>mesa: new _mesa_error_check_format_and_type() function</li>
<li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
<li>mesa: fix missing return value in getteximage_error_check()</li>
<li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
<li>svga: add 0.5 in float-&gt;int conversion of sample min/max lod</li>
<li>svga: fix min/max lod clamping</li>
<li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
<li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
<li>st/mesa: copy num_immediates field when copying the immediates array</li>
<li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
<li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
<li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
<li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
<li>st/mesa: add null pointer check in st_texture_image_map()</li>
<li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
<li>draw: fix missing immediates bug in polygon stipple code</li>
<li>st/mesa: fix max_offset computation for base vertex</li>
</ul>
<p>Christoph Bumiller (1):</p>
<ul>
<li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
</ul>
<p>Dylan Noblesmith (1):</p>
<ul>
<li>mesa: require GL_MAX_SAMPLES &gt;= 4 for GL 3.0</li>
</ul>
<p>Eric Anholt (1):</p>
<ul>
<li>i965/vs: Fix texelFetchOffset()</li>
</ul>
<p>Ian Romanick (5):</p>
<ul>
<li>docs: Add 8.0.3 release md5sums</li>
<li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
<li>glsl: Remove spurious printf messages</li>
<li>glsl: Fix pi/2 constant in acos built-in function</li>
<li>mesa: Bump version number to 8.0.4</li>
</ul>
<p>José Fonseca (2):</p>
<ul>
<li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
<li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
</ul>
<p>Kenneth Graunke (15):</p>
<ul>
<li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
<li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
<li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
<li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
<li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
<li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
<li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
<li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
<li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
<li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
<li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
<li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
<li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
<li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
<li>glsl: Don't trust loop analysis in the presence of function calls.</li>
</ul>
<p>Kurt Roeckx (1):</p>
<ul>
<li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
</ul>
<p>Lukas Rössler (1):</p>
<ul>
<li>glu: fix two Clang warnings</li>
</ul>
<p>Marek Olšák (2):</p>
<ul>
<li>mesa: allow exposing GL3 without EXT_texture_integer</li>
<li>st/mesa: don't do srgb-&gt;linear conversion in decompress_with_blit</li>
</ul>
<p>Paul Seidler (1):</p>
<ul>
<li>tests: include mesa headers</li>
</ul>
<p>Stéphane Marchesin (3):</p>
<ul>
<li>glx: Handle a null reply in QueryVersion.</li>
<li>i915g: Don't invert signalled/unsignalled fences</li>
<li>i915g: Don't avoid flushing when we have a pending fence.</li>
</ul>
<p>Thomas Gstädtner (1):</p>
<ul>
<li>gallium/targets: pass ldflags parameter to MKLIB</li>
</ul>
<p>Vadim Girlin (2):</p>
<ul>
<li>st/mesa: set stObj-&gt;lastLevel in guess_and_alloc_texture</li>
<li>r600g: check gpr count limit</li>
</ul>
<p>Vinson Lee (1):</p>
<ul>
<li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
</ul>
</div>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More