Commit Graph

48538 Commits

Author SHA1 Message Date
ojab 2fe6c254f7 Strip LLVM svn rev from `llvm-config --version` output.
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
2012-01-05 22:44:16 -08:00
Vinson Lee 44c089bd48 mesa: Remove 'texelBytes' declarations that are only used in assertions.
This patch silences these GCC warnings.
warning: unused variable 'texelBytes'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 22:37:06 -08:00
Paul Berry 33fe021116 mesa: Fix transform feedback of unsubscripted arrays.
It is not explicitly stated in the GL 3.0 spec that transform feedback
can be performed on a whole varying array (without supplying a
subscript).  However, it seems clear from context that this was the
intent.  Section 2.15 (TransformFeedback) says this:

    When writing varying variables that are arrays, individual array
    elements are written in order.

And section 2.20.3 (Shader Variables), says this, in the description
of GetTransformFeedbackVarying:

    For the selected varying variable, its type is returned into
    type. The size of the varying is returned into size. The value in
    size is in units of the type returned in type.

If it were not possible to perform transform feedback on an
unsubscripted array, the returned size would always be 1.

This patch fixes the linker so that transform feedback on an
unsubscripted array is supported.

Fixes piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{4,8}]-no-subscript" and
"EXT_transform_feedback/output_type *[2]-no-subscript".

Note: on back-ends that set
gl_shader_compiler_options::LowerClipDistance (for example i965),
tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]" still fail.  I hope to address this in
a later patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry cab179a165 Add .gitignore files to exclude unit test build artifacts from git
With the addition of unit tests in commit
3ef3ba4d2e, several additional build
artifacts are created:

  bin/depcomp
  bin/missing
  tests/Makefile
  tests/Makefile.in
  tests/glx/Makefile
  tests/glx/Makefile.in
  tests/glx/.deps/
  tests/glx/.gitignore

This patch adds all of these files to .gitignore.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry 4357f8b4dc mesa: Avoid segfault when getting an unbound transform feedback buffer name.
Previously we were using
gl_transform_feedback_object::Buffers[i]->Name to service an indexed
get request for GL_TRANSFORM_FEEDBACK_BUFFER_BINDING.  However, if no
buffer has been bound, gl_transform_feedback_object::Buffers[i] is
NULL, so this was causing a segfault.

This patch switches to using
gl_transform_feedback_object::BufferNames[i], which is equal to
gl_transform_feedback_object::Buffers[i]->Name if
gl_transform_feedback_object::Buffers[i] is not NULL, and 0 if it is
NULL.

Fixes piglit test "EXT_transform_feedback/get-buffer-state
indexed_binding".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:12 -08:00
Paul Berry 456279bb33 mesa: Fix transform feedback of gl_ClipDistance.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), references to gl_ClipDistance (a float[8] array) will
be converted to references to gl_ClipDistanceMESA (a vec4[2] array).

This patch modifies the linker so that requests for transform feedback
of gl_ClipDistance are similarly converted.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipDistance".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry 913a5c238b mesa: Make tfeedback_decl::var_name a const char *.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry 367b83f890 gallium: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry e8357cb03d i965: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry 2169331d40 mesa: Add gl_transform_feedback_info::ComponentOffset.
When using transform feedback, there are three circumstances in which
it is useful for Mesa to instruct a driver to stream out just a
portion of a varying slot (rather than the whole vec4):

(a) When a varying is smaller than a vec4, Mesa needs to instruct the
driver to stream out just the first one, two, or three components of
the varying slot.

(b) In the future, when we implement varying packing, some varyings
will be offset within the vec4, so Mesa will have to instruct the
driver to stream out an arbitrary contiguous subset of the components
of the varying slot (e.g. .yzw or .yz).

(c) On drivers that set gl_shader_compiler_options::LowerClipDistance,
if the client requests that an element of gl_ClipDistance be streamed
out using transform feedback, Mesa will have to instruct the driver to
stream out a single component of one of the gl_ClipDistance varying
slots.

Previous to this patch, only (a) was possible, since
gl_transform_feedback_info specified only the number of components of
the varying slot to stream out.  This patch adds
gl_transform_feedback_info::ComponentOffset, which indicates which
components should be streamed out.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry 989b5722dc i965: Fix transform feedback of gl_ClipVertex.
Previously, on i965 Gen6 and above, we weren't allocating space for
gl_ClipVertex in the VUE, since the VS was automatically converting it
to clip distances.  This prevented transform feedback from being able
to capture gl_ClipVertex.

This patch goes aheads and allocates space for gl_ClipVertex in the
VUE on Gen6 and above.  The old behavior is retained on Gen5 and
below, since (a) transform feedback is not yet supported on those
platforms, and (b) those platforms don't currently support
gl_ClipVertex anyhow.

Note: this constitutes a slight waste of VUE space for shaders that
use gl_ClipVertex and don't use transform feedback to capture it.
However, that seems preferable to making the VUE map (and all of the
state that depends on it) dependent on transform feedback settings.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipVertex".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry 15f4bca2df i965: Fix transform feedback of gl_PointSize.
On i965 Gen6 and above, gl_PointSize is stored in component W of the
first VUE slot (which corresponds to VERT_RESULT_PSIZ in the VUE map).
Normally we store varying floats in component X of a VUE slot, so we
need special case logic for gl_PointSize.

For Gen6, we do this with a ".wwww" swizzle in the GS.  For Gen7, we
shift the component mask by 3 to select the W component.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_PointSize".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry 1be0fd8c86 mesa: Fix extra memset in store_tfeedback_info()
Commit 9d36c96d6e (mesa: Fix
glGetTransformFeedbackVarying()) accidentally added an extra memset()
call to the store_tfeedback_info() function, causing
prog->LinkedTransformFeedback.NumBuffers to be erased.

This patch removes the extra memset and rearranges the other
operations in store_tfeedback_info() to be in the correct order.

Fixes piglit tests "EXT_transform_feedback/api-errors *unbound*"

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-05 13:26:48 -08:00
Brian Paul a44d715d2b swrast: use memmove() instead of memcpy() in the SHIFT_ARRAY macro
The src/dst arrays would overlap but dst was less than src so a simple
version of memcpy() would do the right thing.  But this isn't guaranteed
when memcpy() is optimized.

Fixes demos/copypix when the dest region was clipped by the left side of
the window.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-05 12:49:45 -07:00
Bryan Cain 59be691638 st/mesa: add support for gl_ClipDistance 2012-01-05 13:03:26 -06:00
Bryan Cain 6951870e57 gallium: add support for clip distances 2012-01-05 13:03:25 -06:00
Marek Olšák f82d40d4b1 glx/dri2: print FPS when env var LIBGL_SHOW_FPS is 1 (v2)
This is useful for apps which don't print FPS.
Only enabled in SwapBuffers.

v2: track state per drawable, use libGL prefix

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2012-01-05 18:29:11 +01:00
Marek Olšák c77efc6bb6 r300/compiler: fix buffer underflow when setting SEM_WAIT on last instruction
Do it after we check whether inst_end != -1.
Also move the code structure at the beginning of r300_fragment_shader_code
to detect underflows easily with valgrind.
2012-01-05 18:29:11 +01:00
Marek Olšák c2cc630f28 u_vbuf: use cso_cache to cache vertex element states
Improves performance to 28 fps in Cogs.
2012-01-05 18:29:11 +01:00
Marek Olšák ce44bae366 u_vbuf: implement another upload codepath which unrolls indices
Improves performance from cca 1 fps to 23 fps in Cogs.
This new codepath is not always used, instead, there is a heuristic which
determines whether to use it. Using translate for uploads is generally
slower than what we have had already, it's a win only in a few cases.
2012-01-05 18:29:11 +01:00
Marek Olšák 2b851526c1 u_vbuf: cleanup variable names to be consistent 2012-01-05 18:29:11 +01:00
Marek Olšák 64242b23c1 u_vbuf: cleanup the computation of how many vertices to upload/translate 2012-01-05 18:29:11 +01:00
Marek Olšák c897b943f4 u_vbuf: convert min_index,max_index to start,count 2012-01-05 18:29:11 +01:00
Marek Olšák 1ae9e588fa util: add helper function util_dump_draw_info 2012-01-05 18:29:11 +01:00
Marek Olšák 345b1a31c9 trace: dump primitive restart info 2012-01-05 18:29:11 +01:00
Marek Olšák d1f11ed3ef translate: implement translation of 10_10_10_2 types
This is for GL_ARB_vertex_type_2_10_10_10_rev.
I just took the code from u_format_table.c. It's based on pack_rgba_float.
I had no other choice. The u_format hooks are not exactly compatible
with translate. The cleanup of it is left for future work.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák 0a8a7144a1 translate: implement translation of (pure) integer formats
The conversion is limited to only a few cases, because converting to any other
type shouldn't happen in any driver.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák 1ba3240b28 u_format: implement fetch_rgba_uint and fetch_rgba_sint for integer formats
Fetching int as float and vice versa is not allowed.
Fetching unsigned int as signed int and vice versa is not allowed either.
Doing conversions like that isn't allowed for samplers in OpenGL.

The three hooks could be consolidated into one fetch hook, which would fetch
uint as uint32, sint as sint32, and everything else as float. The receiving
parameter would be void*. This would be useful for implementing vertex fetches
for shader model 4.0, which has untyped registers.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák 0950086376 gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY
Please see the diff for further info.

This paves the way for moving user buffer uploads out of drivers and should
allow to clean up the mess in u_upload_mgr in the meantime.

For now only allowed for buffers on r300 and r600.

Acked-by: Christian König <deathsimple@vodafone.de>
2012-01-05 18:29:11 +01:00
Marek Olšák 7cd1c62b6b gallium: remove deprecated PIPE_TRANSFER_DISCARD
PIPE_TRANSFER_DISCARD_RANGE is defined the same.
2012-01-05 18:29:11 +01:00
Marek Olšák 5968e4068c u_vbuf: translate per-vertex, per-instance, and constant attribs separately
We don't wanna convert per-instance or constant (zero-stride) attribs into
ordinary vertex attribs.

More importantly, the translation of instance attribs now finally works.
2012-01-05 18:29:11 +01:00
Marek Olšák dbd60d27e8 u_vbuf: take start_instance into account when uploading instanced attribs 2012-01-05 18:29:11 +01:00
Marek Olšák f94d390213 u_upload_mgr: remove the 'flushed' parameter
Not used by anybody.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 18:29:11 +01:00
Marek Olšák c727cc175b u_vbuf: don't map user buffers, just obtain a pointer to them 2012-01-05 18:29:11 +01:00
Marek Olšák f430f794ac u_vbuf: only map a subrange of buffers to translate 2012-01-05 18:29:11 +01:00
Marek Olšák 214b87aa04 gallium: fix behavior of pipe_buffer_map_range
To match what transfer_map returns. Really, subtracting the offset leads
to bugs if someone expects it to work exactly like transfer_map.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 18:29:11 +01:00
Marek Olšák fb0aa34fab u_vbuf: remove the workaround for half floats and translate 2012-01-05 18:29:11 +01:00
Marek Olšák 1acef6a746 translate: implement translation of half floats in the generic codepath 2012-01-05 18:29:11 +01:00
Eric Anholt 501e2e3b6d mesa: Remove the dead Varyings list in the program.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-05 09:11:29 -08:00
Eric Anholt 9d36c96d6e mesa: Fix glGetTransformFeedbackVarying().
The current implementation was totally broken -- it was looking in an
unpopulated structure for varyings, and trying to do so using the
current list of varying names, not the list used at link time.

v2: Fix leaking of memory into the program per re-link.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-05 09:11:29 -08:00
Jakob Bornecrantz cc1d8a466a svga: Trim the dri binary a bit on scons release builds
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-05 17:23:32 +01:00
Jakob Bornecrantz 2bb9c64489 svga: Fix texture cube param cap
Spotted by Thomas Hellstrom.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-05 17:23:32 +01:00
Brian Paul 85b5dac705 tgsi: consolidate TGSI string arrays in new tgsi_strings.h
There was some duplication between the tgsi_dump.c and tgsi_text.c
files.  Also use some static assertions to help catch errors when
adding new TGSI values.

v2: put strings in tgsi_strings.c file instead of the .h file.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 09:01:43 -07:00
Brian Paul 188aca3492 gallium: add STATIC_ASSERT macro 2012-01-05 08:19:23 -07:00
Brian Paul 6aed626c35 mesa: only map src/dest regions in _mesa_copy_buffer_subdata()
We were wastefully mapping the whole source/dest buffers before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-01-05 08:14:32 -07:00
Brian Paul b330f1f13c mesa: print more info in buffer_object_subdata_range_good() error message 2012-01-05 08:14:26 -07:00
Brian Paul a61e164ae0 st/mesa: 80-column wrapping 2012-01-05 08:14:01 -07:00
Kenneth Graunke 9d21b5dd26 Revert "configure.ac: remove deprecated --with-driver="
This reverts commit 5a478976ae.

It broke the build.  DRI drivers were no longer being installed by
`make install` (and probably not being built at all).  It appears to be
due to a few small, subtle mistakes, and the fix isn't clear enough to
simply commit without going through review.  In the meantime, revert it.
2012-01-04 23:49:18 -08:00
Matt Turner cb96b06130 glsl: rename VERSION to VERSION_TOK for automake
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-04 19:27:56 -08:00
Matt Turner 5172383de0 configure.ac: bump AC_PREREQ to 2.60
All other xorg modules require at least 2.60 (released in 2006), so we
may as well increase it to match.  It's also doubtful anyone tests the
build with 2.59 (from 2003), so it may not even work anyway.
2012-01-04 19:23:39 -08:00