Commit Graph

54822 Commits

Author SHA1 Message Date
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