Commit Graph

48619 Commits

Author SHA1 Message Date
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
Matt Turner 5a478976ae configure.ac: remove deprecated --with-driver=
See 9e7a4147.
2012-01-04 19:23:22 -08:00
Ian Romanick f22ecaa14f i965: Enable EXT_texture_integer by default
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-with-reservations-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 16:54:21 -08:00
Ian Romanick 0e52be58f0 mesa: Add missing GL_RG_INTEGER cases
Adds two missing '|| srcFormat == GL_RG_INTEGER' in assertions and a
bunch of missing pixel converions cases.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 16:52:46 -08:00
Kenneth Graunke a0a0a909f2 i965: Fix infinite loop regression in intel_miptree_all_slices_resolve.
Commit 0ed11e3331 fixed a "use after free"
bug by getting the next pointer before deleting the current node.

Unfortunately, it also made "next" never get updated if i->need != need.

Fixes infinite loops in piglit tests fbo-depth-array and fbo-depthtex.

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-01-04 15:51:51 -08:00
Kenneth Graunke fbbbc8c04e i965/vs: Use the proper dimensionality for the sampler result register.
textureSize() returns an int, ivec2, or ivec3, but never an ivec4.
Creating the destination register as an ivec4 triggered later failures,
even though the register did hold the proper values.

For example, piglit test vs-textureSize-compare calls textureSize on a
2D texture and compares the result to an expected value.  Unfortunately,
our generated code also tried to compare the third and fourth components
which were undefined, and failed.

Fixes piglit test vs-textureSize-compare as well as 19 subcases of
oglconform's glsl-bif-tex-size test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44339
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 15:07:40 -08:00
Kenneth Graunke 207cbc68dc i965: Add missing _NEW_TEXTURE dirty bit to brw_vs_prog state atom.
Commit d45814c925 totally added a data
dependency on _NEW_TEXTURE, even including the comment, but didn't
actually add the dirty bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 15:07:40 -08:00
Paul Berry 86bb45ffc3 mesa: Additional error checks for transform feedback.
From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT
    if no binding points would be used, either because no program object is
    active or because the active program object has specified no varying
    variables to record.

    ...

    The error INVALID_VALUE is generated by BindBufferRangeEXT or
    BindBufferOffsetEXT if <offset> is not word-aligned.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors no_prog_active
- EXT_transform_feedback/api-errors interleaved_no_varyings
- EXT_transform_feedback/api-errors separate_no_varyings
- EXT_transform_feedback/api-errors bind_offset_offset_1
- EXT_transform_feedback/api-errors bind_offset_offset_2
- EXT_transform_feedback/api-errors bind_offset_offset_3
- EXT_transform_feedback/api-errors bind_offset_offset_5

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:53 -08:00
Paul Berry ebfad9f6a1 mesa: Check that all buffers are bound in BeginTransformFeedback.
From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is generated by
    BeginTransformFeedbackEXT if any transform feedback buffer object
    binding point used in transform feedback mode does not have a
    buffer object bound.

This required adding a new NumBuffers field to the
gl_transform_feedback_info struct, to keep track of how many transform
feedback buffers are required by the current program.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors interleaved_unbound
- EXT_transform_feedback/api-errors separate_unbound_0_1
- EXT_transform_feedback/api-errors separate_unbound_0_2
- EXT_transform_feedback/api-errors separate_unbound_1_2

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:48 -08:00
Paul Berry 1979e22e13 mesa: Fix typos in transform feedback error messages.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:40 -08:00
Ian Romanick 3946448951 glsl: Don't use base type for bit-not when there's an error
Other parts of the compiler assume that expressions will have
well-formed types or the error type.  Just using the type of the thing
being operated on can cause expressions like ~3.14 or ~false to not
have a well-formed type.  This could then result in an assertion
failure in the context epxression handler.

If there is an error processing the expression, set the type of the IR
expression to error.

Fixes piglit's bit-not-0[789].frag tests.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
2012-01-04 12:43:10 -08:00
Ian Romanick 4becf676e0 glx: More hacking around versions of XCB that lack GLX_ARB_create_context support
Detect whether a new enough version of XCB is installed at configure
time.  If it is not, don't enable the extension and don't build the
unit tests.

v2: Move the AM_CONDIATION outside the case-statement so that it is
invoked even for non-GLX builds.  This prevents build failures with
osmesa, for example.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Robert Hooker <robert.hooker@canonical.com>
2012-01-04 12:43:10 -08:00
Brian Paul c2e537fef2 gallium/util: fix argument cast in x32_s8_get_tile_rgba() call 2012-01-04 13:35:13 -07:00
Brian Paul 2a0c515b89 st/mesa: remove st_CompressedTexSubImage1D/2D/3D()
Just use the core Mesa functions instead.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:41 -07:00
Brian Paul 2972547047 st/mesa: fix indentation in st_copy_texsubimage() 2012-01-04 13:30:35 -07:00
Brian Paul 5d67d4fbeb st/mesa: remove st_TexImage(), use core Mesa code instead
The core Mesa code does the equivalent memory allocation, image mapping,
storing and unmapping.  We just need to call prep_teximage() first to
handle the 'surface_based' stuff.

The other change is to always use the level=0 mipmap image when accessing
individual mipmap level images that are stored in resources/buffers.
Apparently, we were always using malloc'd memory for individual mipmap
images, not resource buffers, before.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:35 -07:00
Brian Paul 19840c46f3 st/mesa: refactor gl_TexImage() code into prep_teximage()
Preparation for st_TexImage() removal/refactoring.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:35 -07:00
Ian Romanick 18f53efa01 intel: Re-enable GL_OES_standard_derivatives on GEN4+
This extension only needs to be disabled on GEN3.

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-01-04 10:31:16 -08:00
Eric Anholt 43f12e5eb8 intel: Re-allow blitting glCopyBufferSubData() on gen >= 6.
This was disabled a year ago due to not having a story for handling
the blitter at the time.  We're fine with using the blitter now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Eric Anholt 8aa7fa770c intel: Fix pitch handling for linear blits.
The new assert in intelEmitCopyBlit() gets angry if we don't align to
dwords.  Rather than make the assert have a special case for height ==
1 on the assumption that the hardware doesn't use it in that case,
just supply a correct pitch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00