Commit Graph

49240 Commits

Author SHA1 Message Date
Eric Anholt 27af00eac8 mesa: Fix the error message function names for glFlushMappedBufferRange().
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:05 +01:00
Eric Anholt f20fb80a91 mesa: Fix bad-enum/no-buffer error handling for buffer object functions.
For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:02 +01:00
Brian Paul 84a1273e7f glsl: move array_sizing_visitor class outside of link_intrastage_shaders()
To silence warnings with gcc 4.4.x on Linux and llvm-g++ 4.2 on Mac.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 20:10:51 -07:00
Brian Paul 8cbe699c0d gallium/postprocess: move declarations before code
To fix MSVC build.
2012-02-02 15:14:10 -07:00
Lauri Kasanen 81938d2137 gallium/postprocess: Just to be safe, reference all buffers from outside
Even though it should be safe to use them for one frame, better be sure.
Suggested by Michael Dänzer.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:09 -05:00
Lauri Kasanen c5976017e3 gallium/postprocess: Fix depth logic
This prevents a possible lapse of the depth buffer - the situation where
the app and pp have different depth buffers.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:06 -05:00
Carl Worth cd2e2187cb glsl: Avoid ralloc_stealing a long-lived object to a short-lived parent
In commit 6ecee54a9a a call to
talloc_reference was replaced with a call to talloc_steal. This was in
preparation for moving to ralloc which doesn't support reference
counting.

The justification for talloc_steal within token_list_append in that
commit is that the tokens are being copied already. But the copies are
shallow, so this does not work.

Fortunately, the lifetime of these tokens is easy to understand. A
token list for "replacements" is created and stored in a hash table
when a function-like macro is defined. This list will live until the
macro is #undefed (if ever).

Meanwhile, a shallow copy of the list is created when the macro is
used and the list expanded. This copy is short-lived, so is unsuitable
as a new parent.

So we can just let the original, longer-lived owner continue to own
the underlying objects and things will work.

This fixes bug #45082:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

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

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth 64fd26a8a8 glsl: Add glcpp tests for a macro used twice
This test cases exposes a bug as described in this bug report:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

Clearly, some memory is getting (incorrectly) freed on the first macro
invocation, leading to problems with the second macro invocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Carl Worth 7ab1c7f792 glcpp: Fix so that trailing punctuation does not prevent macro expansion
The trick here is that flex always chooses the rule that matches the most
text. So with a input text of "two:" which we want to be lexed as an
IDENTIFIER token "two" followed by an OTHER token ":" the previous OTHER
rule would match longer as a single token of "two:" which we don't want.

We prevent this by forcing the OTHER pattern to never match any
characters that appear in other constructs, (no letters, numbers, #,
_, whitespace, nor any punctuation that appear in CPP operators).

Fixes bug #44764:

	GLSL preprocessor doesn't replace defines ending with ":"
	https://bugs.freedesktop.org/show_bug.cgi?id=44764

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

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth e931b0e05b glcpp: Add new test showing bug where a trailing ':' prevents macro expansion
This demonstrates a bug that was recently triggered in piglit.

Here is the original bug report (containing a test case almost identical
to this one):

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Ian Romanick 2e8f8cb383 mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float
GL_RG_INTEGER only has two components, not three.  I'll be surprised
if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER,
...).  This was found by inspection.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 10:07:14 -07:00
Ian Romanick 5c341b7df3 mesa: Fix copy-and-paste bug in do_row_3D
Several of the half-float cases used 4 as the texel size when it
should have been some smaller value.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43325
2012-02-02 10:07:14 -07:00
Ian Romanick 660ed923de mesa: Convert colors if span ChanType and renderbuffer data type don't match
This is a partial revert of f9874fe.  It turns out that the types
don't always match.  Specifically, this can happen when doing
glCopyPixels from a float FBO to a RGBA8 FBO.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:14 -07:00
Ian Romanick e06b1c65bc mesa: Set the gl_array_object::ARBsemantics flag at the right time
With 0963990 the flag was only set when Bind created the object.  In
all cases where ::ARBsemantics could be true, this path never
happened.  Instead, add a _Used flag to track whether a VAO has ever
been bound.  On the first Bind, set the _Used flag, and set the
ARBsemantics flag to the correct value.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
2012-02-02 10:07:14 -07:00
Ian Romanick af1477b088 mesa: Add unpack_uint_z_row support for floating-point depth buffers
This is a hack, and it will result in incorrect rendering.  However,
it does eliminate spurious warnings in several piglit CopyPixels tests
that involve floating-point depth buffers.

The real solution is to add a zf field to SWspan to store float Z
values.  When a float depth buffer is involved, swrast should also
populate the zf field.  I'll consider this post-8.0 work.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:01 -07:00
Brian Paul e20e30b28c Revert "Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi""
This reverts commit 4e5a8937d1.
... to fix build with --enable-osmesa
2012-02-02 08:17:43 -07:00
José Fonseca edb1970795 draw: Avoid NULL pointer dereference when binding NULL fragment shaders.
Now that the draw module avoids flushing, it may flush precisely when
binding a NULL shader, so care must be taken when restoring the original
fragment shader.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:30 +00:00
José Fonseca efd73f72d8 mapi/glapi: Never use a generic no-op entry-point on Windows.
When GLAPIENTRY is __stdcall (ie Windows), the stack is popped by the
callee making the number/type of arguments significant, therefore
using a generic no-op causes stack corruption for many entry-points.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:24 +00:00
ojab db312b62f2 gallivm: Fix LLVM-2.7 build.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-02-02 09:04:10 +00:00
José Fonseca 54fd495c41 gallivm: Remove MSVC RT hack.
The hack never worked reliably, and docs/llvmpipe.html is quite clear on
the requirement of matching CRT when building LLVM and Mesa already.
2012-02-02 09:04:10 +00:00
Anuj Phogat 15986d21eb mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1)

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case: max_values
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-01 18:49:22 -08:00
Zack Rusin cff0eac702 svga: fix a crash happening before setting fragment shaders.
In certain situations API's will call pipe->clear which doesn't
require fragment shader, but then we'd try to verify the pipeline
and assume fragment shader was always set. This was leading to
crash when API would just call simple clear's before anything else.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 16:34:57 -05:00
Brian Paul 3279561e9a st-api: fix typos, whitespace, line wrapping 2012-02-01 14:02:35 -07:00
Brian Paul e53557996e vbo: fix node_attrsz[] usage in vbo_bind_vertex_list()
The node_attrsz[] array is initially copied from the node->attrsz[]
array but some values get rewritten.  Thereafter, we need to use the
node_attrsz[] values.

Fixes a bug when replaying a display list that uses generic vertex
array[16] (at least).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-01 13:45:09 -07:00
Brian Paul f09910f399 nv50: add assertions missed in earlier nv50 commit 2012-02-01 08:22:16 -07:00
Colin Walters 0d736b2076 build: Note that we don't support srcdir != builddir
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-01 15:02:29 +00:00
Brian Paul 541bb2e33f nv50: use larger arrays to silence warnings and fix buffer overflows
The warnings were:
nv50_pc_regalloc.c: In function ‘pass_generate_phi_movs’:
nv50_pc_regalloc.c:423:41: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp: In member function ‘bool nv50_ir::MemoryOpt::replaceStFromSt(nv50_ir::Instruction*, nv50_ir::MemoryOpt::Record*)’:
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds

And add some assertions to catch this sooner in debug builds.
2012-02-01 07:19:54 -07:00
Brian Paul a1471e4877 mesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)
This fixes a dangling texture object pointer bug hit via wglShareLists().
When we push the GL_TEXTURE_BIT state we may push references to the default
texture objects which are owned by the gl_shared_state object.  We don't
want to accidentally delete that shared state while the attribute stack
references shared objects.  So keep a reference to it.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:44 -07:00
Brian Paul 361cd53a77 mesa: use new _mesa_reference_shared_state() function
This cleans up the reference counting of shared context state.
The next patch will use this to fix an actual bug.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:40 -07:00
Brian Paul 133c5727b5 mesa: remove stray comment in PopAttrib() code 2012-02-01 06:52:30 -07:00
Matt Turner 7ef94c6a0b Revert "automake: src/mesa/drivers/osmesa"
This reverts commit 275ac7e5c1.
2012-01-31 21:34:42 -05:00
Matt Turner a99164956f Revert "automake: src/glsl and src/glsl/glcpp"
This reverts commit 9947656168.
2012-01-31 21:33:59 -05:00
Matt Turner 70dd17152d Revert "src/glsl/glcpp: wire up glcpp-test to make check"
This reverts commit 2bb9f9e1fd.
2012-01-31 21:33:21 -05:00
Matt Turner 8c436b4ea6 Revert "Make sure libGL.so links with libglsl"
This reverts commit f53e7e981e.
2012-01-31 21:33:07 -05:00
Matt Turner f6cc4347de Revert "glsl: Fix optimization tests after converting src/glsl to automake."
This reverts commit ffe376d5a7.
2012-01-31 21:32:33 -05:00
Marek Olšák b0337b679a r600g: shorten expressions accessing family and chip_class 2012-01-31 23:28:55 +01:00
Marek Olšák 267bddaacb r300g: don't use pipe_context::winsys 2012-01-31 23:28:50 +01:00
Marek Olšák 38bf276348 r600g: remove unused variable num_dest_buffers 2012-01-31 23:28:42 +01:00
Marek Olšák f661405637 r600g: use the new code for streamout flush as well 2012-01-31 23:12:31 +01:00
Marek Olšák 70d40fc675 r600g: rename r600_reg::flush_flags -> sbu_flags
There is no other use for that.
2012-01-31 23:12:30 +01:00
Marek Olšák 6d0a011acb r600g: fix computation of how many dwords is needed for a flush at the end of CS 2012-01-31 23:12:30 +01:00
Marek Olšák 1c5625cdb9 r600g: remove unused r600_reg::flush_mask 2012-01-31 23:12:30 +01:00
Marek Olšák 0671400dcc r600g: remove more dead code 2012-01-31 23:12:30 +01:00
Marek Olšák 74027a9ba2 r600g: remove dead code for tracking relocations 2012-01-31 23:12:30 +01:00
Marek Olšák 4fd97b46a0 r600g: remove unused flush code 2012-01-31 23:12:30 +01:00
Marek Olšák 0813e58a3e r600g: rework cache flushing
This also significantly improves the RV670 flush by using the CB1 flush
*always* and also DEST_BASE_0_ENA, which appears to magically fix some tests.
I am not entirely sure, but it's possible that RV670 flushing is fixed
completely.

v2: fix cayman by flushing texture cache instead of vertex cache

Thanks to Dave Airlie for testing Cayman.
2012-01-31 23:12:30 +01:00
Marek Olšák 2fe521fa41 r600g: add a new simple API for state emission 2012-01-31 23:12:30 +01:00
Marek Olšák 621e0db71c r600g: remove redundant pm4 and pm4_cdwords in r600_context
These only mirrored radeon_winsys_cs.
2012-01-31 23:12:30 +01:00
Marek Olšák 3b04671920 r600g: consolidate some context_draw code 2012-01-31 23:12:30 +01:00
Marek Olšák 302862defa r600g: remove the now-useless internal flush callback 2012-01-31 23:12:30 +01:00